Lines 42-59
Link Here
|
42 |
package org.netbeans.modules.java.editor.options; |
42 |
package org.netbeans.modules.java.editor.options; |
43 |
|
43 |
|
44 |
import java.awt.Component; |
44 |
import java.awt.Component; |
45 |
import java.util.Arrays; |
|
|
46 |
import java.util.Collection; |
47 |
import java.util.TreeSet; |
48 |
import java.util.Vector; |
49 |
import java.util.prefs.Preferences; |
45 |
import java.util.prefs.Preferences; |
|
|
46 |
import javax.swing.DefaultListModel; |
50 |
import javax.swing.JComponent; |
47 |
import javax.swing.JComponent; |
51 |
import javax.swing.JTable; |
48 |
import javax.swing.JList; |
52 |
import javax.swing.event.DocumentEvent; |
49 |
import javax.swing.event.DocumentEvent; |
53 |
import javax.swing.event.DocumentListener; |
50 |
import javax.swing.event.DocumentListener; |
54 |
import javax.swing.event.TableModelEvent; |
|
|
55 |
import javax.swing.event.TableModelListener; |
56 |
import javax.swing.table.DefaultTableModel; |
57 |
import org.netbeans.modules.options.editor.spi.PreferencesCustomizer; |
51 |
import org.netbeans.modules.options.editor.spi.PreferencesCustomizer; |
58 |
import org.openide.util.HelpCtx; |
52 |
import org.openide.util.HelpCtx; |
59 |
|
53 |
|
Lines 62-68
Link Here
|
62 |
* @author Dusan Balek |
56 |
* @author Dusan Balek |
63 |
* @author Sam Halliday |
57 |
* @author Sam Halliday |
64 |
*/ |
58 |
*/ |
65 |
public class CodeCompletionPanel extends javax.swing.JPanel implements DocumentListener, TableModelListener { |
59 |
public class CodeCompletionPanel extends javax.swing.JPanel implements DocumentListener { |
66 |
|
60 |
|
67 |
public static final String JAVA_AUTO_POPUP_ON_IDENTIFIER_PART = "javaAutoPopupOnIdentifierPart"; //NOI18N |
61 |
public static final String JAVA_AUTO_POPUP_ON_IDENTIFIER_PART = "javaAutoPopupOnIdentifierPart"; //NOI18N |
68 |
public static final boolean JAVA_AUTO_POPUP_ON_IDENTIFIER_PART_DEFAULT = false; |
62 |
public static final boolean JAVA_AUTO_POPUP_ON_IDENTIFIER_PART_DEFAULT = false; |
Lines 78-96
Link Here
|
78 |
public static final String JAVA_COMPLETION_WHITELIST_DEFAULT = ""; //NOI18N |
72 |
public static final String JAVA_COMPLETION_WHITELIST_DEFAULT = ""; //NOI18N |
79 |
public static final String JAVA_COMPLETION_BLACKLIST = "javaCompletionBlacklist"; //NOI18N |
73 |
public static final String JAVA_COMPLETION_BLACKLIST = "javaCompletionBlacklist"; //NOI18N |
80 |
public static final String JAVA_COMPLETION_BLACKLIST_DEFAULT = ""; //NOI18N |
74 |
public static final String JAVA_COMPLETION_BLACKLIST_DEFAULT = ""; //NOI18N |
|
|
75 |
public static final String JAVA_COMPLETION_EXCLUDER_METHODS = "javaCompletionExcluderMethods"; //NOI18N |
76 |
public static final boolean JAVA_COMPLETION_EXCLUDER_METHODS_DEFAULT = false; |
77 |
|
78 |
private static final String JAVA_FQN_REGEX = "[$\\w._]*"; |
81 |
|
79 |
|
82 |
private final Preferences preferences; |
80 |
private final Preferences preferences; |
83 |
|
81 |
|
84 |
private void initExcluderTable(JTable table, String pref) { |
82 |
// null if a new entry is to be created, otherwise the entry to be replaced |
85 |
String[] entries = pref.split(","); //NOI18N |
83 |
private volatile String javaExcluderEditing; |
86 |
DefaultTableModel model = (DefaultTableModel) table.getModel(); |
|
|
87 |
for (String entry : entries) { |
88 |
if (entry.length() > 0) { |
89 |
model.addRow(new String[]{entry}); |
90 |
} |
91 |
} |
92 |
model.addTableModelListener(this); |
93 |
} |
94 |
|
84 |
|
95 |
/** Creates new form FmtTabsIndents */ |
85 |
/** Creates new form FmtTabsIndents */ |
96 |
public CodeCompletionPanel(Preferences p) { |
86 |
public CodeCompletionPanel(Preferences p) { |
Lines 100-120
Link Here
|
100 |
javaAutoPopupOnIdentifierPart.setSelected(preferences.getBoolean(JAVA_AUTO_POPUP_ON_IDENTIFIER_PART, JAVA_AUTO_POPUP_ON_IDENTIFIER_PART_DEFAULT)); |
90 |
javaAutoPopupOnIdentifierPart.setSelected(preferences.getBoolean(JAVA_AUTO_POPUP_ON_IDENTIFIER_PART, JAVA_AUTO_POPUP_ON_IDENTIFIER_PART_DEFAULT)); |
101 |
javaAutoCompletionTriggersField.setText(preferences.get(JAVA_AUTO_COMPLETION_TRIGGERS, JAVA_AUTO_COMPLETION_TRIGGERS_DEFAULT)); |
91 |
javaAutoCompletionTriggersField.setText(preferences.get(JAVA_AUTO_COMPLETION_TRIGGERS, JAVA_AUTO_COMPLETION_TRIGGERS_DEFAULT)); |
102 |
javaCompletionSelectorsField.setText(preferences.get(JAVA_COMPLETION_SELECTORS, JAVA_COMPLETION_SELECTORS_DEFAULT)); |
92 |
javaCompletionSelectorsField.setText(preferences.get(JAVA_COMPLETION_SELECTORS, JAVA_COMPLETION_SELECTORS_DEFAULT)); |
103 |
javadocAutoCompletionTriggersField.setText(preferences.get(JAVADOC_AUTO_COMPLETION_TRIGGERS, JAVADOC_AUTO_COMPLETION_TRIGGERS_DEFAULT)); |
93 |
javadocAutoCompletionTriggersField.setText(preferences.get(JAVADOC_AUTO_COMPLETION_TRIGGERS, JAVADOC_AUTO_COMPLETION_TRIGGERS_DEFAULT)); |
104 |
String blacklist = preferences.get(JAVA_COMPLETION_BLACKLIST, JAVA_COMPLETION_BLACKLIST_DEFAULT); |
94 |
String blacklist = preferences.get(JAVA_COMPLETION_BLACKLIST, JAVA_COMPLETION_BLACKLIST_DEFAULT); |
105 |
initExcluderTable(javaCompletionExcludeTable, blacklist); |
95 |
initExcluderList(javaCompletionExcludeJlist, blacklist); |
106 |
String whitelist = preferences.get(JAVA_COMPLETION_WHITELIST, JAVA_COMPLETION_WHITELIST_DEFAULT); |
96 |
String whitelist = preferences.get(JAVA_COMPLETION_WHITELIST, JAVA_COMPLETION_WHITELIST_DEFAULT); |
107 |
initExcluderTable(javaCompletionIncludeTable, whitelist); |
97 |
initExcluderList(javaCompletionIncludeJlist, whitelist); |
|
|
98 |
javaCompletionExcluderMethodsCheckBox.setSelected(preferences.getBoolean(JAVA_COMPLETION_EXCLUDER_METHODS, JAVA_COMPLETION_EXCLUDER_METHODS_DEFAULT)); |
99 |
javaCompletionExcluderDialog2.getRootPane().setDefaultButton(javaCompletionExcluderDialogOkButton); |
100 |
|
101 |
// can't NetBeans visual editor do these automatically? |
102 |
javaCompletionExcluderDialog1.pack(); |
103 |
javaCompletionExcluderDialog1.setLocationRelativeTo(this); |
104 |
javaCompletionExcluderDialog2.pack(); |
105 |
javaCompletionExcluderDialog2.setLocationRelativeTo(this); |
106 |
|
108 |
javaAutoCompletionTriggersField.getDocument().addDocumentListener(this); |
107 |
javaAutoCompletionTriggersField.getDocument().addDocumentListener(this); |
109 |
javaCompletionSelectorsField.getDocument().addDocumentListener(this); |
108 |
javaCompletionSelectorsField.getDocument().addDocumentListener(this); |
110 |
javadocAutoCompletionTriggersField.getDocument().addDocumentListener(this); |
109 |
javadocAutoCompletionTriggersField.getDocument().addDocumentListener(this); |
111 |
} |
110 |
} |
|
|
111 |
|
112 |
private void initExcluderList(JList jList, String list) { |
113 |
DefaultListModel model = new DefaultListModel(); |
114 |
String [] entries = list.split(","); //NOI18N |
115 |
for (String entry : entries){ |
116 |
if (entry.length() != 0) |
117 |
model.addElement(entry); |
118 |
} |
119 |
jList.setModel(model); |
120 |
} |
121 |
|
122 |
private void openExcluderEditor() { |
123 |
assert !javaCompletionExcluderDialog2.isVisible(); |
124 |
javaCompletionExcluderDialogTextField.setText(javaExcluderEditing); |
125 |
javaCompletionExcluderDialog2.setVisible(true); |
126 |
javaCompletionExcluderDialogTextField.requestFocus(); |
127 |
} |
112 |
|
128 |
|
113 |
public static PreferencesCustomizer.Factory getCustomizerFactory() { |
129 |
public static PreferencesCustomizer.Factory getCustomizerFactory() { |
114 |
return new PreferencesCustomizer.Factory() { |
130 |
return new PreferencesCustomizer.Factory() { |
115 |
|
131 |
|
116 |
public PreferencesCustomizer create(Preferences preferences) { |
132 |
public PreferencesCustomizer create(Preferences preferences) { |
117 |
return new CodeCompletionPreferencesCusromizer(preferences); |
133 |
return new CodeCompletionPreferencesCustomizer(preferences); |
118 |
} |
134 |
} |
119 |
}; |
135 |
}; |
120 |
} |
136 |
} |
Lines 131-190
Link Here
|
131 |
update(e); |
147 |
update(e); |
132 |
} |
148 |
} |
133 |
|
149 |
|
134 |
// allows common excluder buttons to know which table to act on |
|
|
135 |
private JTable getSelectedExcluderTable() { |
136 |
Component selected = javaCompletionExcluderTab.getSelectedComponent(); |
137 |
if (selected == javaCompletionExcludeScrollPane) { |
138 |
return javaCompletionExcludeTable; |
139 |
} else if (selected == javaCompletionIncludeScrollPane) { |
140 |
return javaCompletionIncludeTable; |
141 |
} else { |
142 |
throw new RuntimeException(selected.getName()); |
143 |
} |
144 |
} |
145 |
|
146 |
// listen to changes in the excluder lists, and do sanity checking on input |
147 |
public void tableChanged(TableModelEvent e) { |
148 |
DefaultTableModel model = (DefaultTableModel) e.getSource(); |
149 |
String pref; |
150 |
if (model == javaCompletionExcludeTable.getModel()) { |
151 |
pref = JAVA_COMPLETION_BLACKLIST; |
152 |
} else if (model == javaCompletionIncludeTable.getModel()) { |
153 |
pref = JAVA_COMPLETION_WHITELIST; |
154 |
} else { |
155 |
throw new RuntimeException(); |
156 |
} |
157 |
@SuppressWarnings("unchecked") |
158 |
Vector<Vector<String>> data = model.getDataVector(); |
159 |
Collection<String> entries = new TreeSet<String>(); |
160 |
for (Vector<String> row : data) { |
161 |
String entry = row.elementAt(0); |
162 |
if (entry == null) { |
163 |
continue; |
164 |
} |
165 |
// users can enter wildcards, which is the same as the raw prefix |
166 |
if (entry.contains("*")) |
167 |
entry = entry.replaceAll("\\*", ""); |
168 |
entry = entry.trim(); |
169 |
if (entry.length() == 0) { |
170 |
continue; |
171 |
} |
172 |
// this could be checked by a custom editor on input |
173 |
if (!entry.matches("[$\\w._]*")) { //NOI18N |
174 |
continue; |
175 |
} |
176 |
entries.add(entry); |
177 |
} |
178 |
StringBuilder builder = new StringBuilder(); |
179 |
for (String entry : entries) { |
180 |
if (builder.length() > 0) { |
181 |
builder.append(","); //NOI18N |
182 |
} |
183 |
builder.append(entry); |
184 |
} |
185 |
preferences.put(pref, builder.toString()); |
186 |
} |
187 |
|
188 |
/** This method is called from within the constructor to |
150 |
/** This method is called from within the constructor to |
189 |
* initialize the form. |
151 |
* initialize the form. |
190 |
* WARNING: Do NOT modify this code. The content of this method is |
152 |
* WARNING: Do NOT modify this code. The content of this method is |
Lines 193-207
Link Here
|
193 |
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents |
155 |
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents |
194 |
private void initComponents() { |
156 |
private void initComponents() { |
195 |
|
157 |
|
196 |
javaCompletionExcluderFrame = new javax.swing.JFrame(); |
158 |
javaCompletionExcluderDialog2 = new javax.swing.JDialog(); |
|
|
159 |
javaCompletionExcluderDialogTextField = new javax.swing.JTextField(); |
160 |
javaCompletionExcluderDialogOkButton = new javax.swing.JButton(); |
161 |
javaCompletionExcluderDialogLabel = new javax.swing.JLabel(); |
162 |
javaCompletionExcluderDialogCancelButton = new javax.swing.JButton(); |
163 |
javaCompletionExcluderDialog1 = new javax.swing.JDialog(); |
197 |
javaCompletionExcluderTab = new javax.swing.JTabbedPane(); |
164 |
javaCompletionExcluderTab = new javax.swing.JTabbedPane(); |
198 |
javaCompletionExcludeScrollPane = new javax.swing.JScrollPane(); |
165 |
javaCompletionExcludeScrollPane = new javax.swing.JScrollPane(); |
199 |
javaCompletionExcludeTable = new javax.swing.JTable(); |
166 |
javaCompletionExcludeJlist = new javax.swing.JList(); |
200 |
javaCompletionIncludeScrollPane = new javax.swing.JScrollPane(); |
167 |
javaCompletionIncludeScrollPane = new javax.swing.JScrollPane(); |
201 |
javaCompletionIncludeTable = new javax.swing.JTable(); |
168 |
javaCompletionIncludeJlist = new javax.swing.JList(); |
202 |
javaCompletionExcluderAddButton = new javax.swing.JButton(); |
169 |
javaCompletionExcluderAddButton = new javax.swing.JButton(); |
203 |
javaCompletionExcluderRemoveButton = new javax.swing.JButton(); |
170 |
javaCompletionExcluderRemoveButton = new javax.swing.JButton(); |
204 |
javaCompletionExcluderCloseButton = new javax.swing.JButton(); |
171 |
javaCompletionExcluderCloseButton = new javax.swing.JButton(); |
|
|
172 |
javaCompletionExcluderEditButton = new javax.swing.JButton(); |
173 |
javaCompletionExcluderMethodsCheckBox = new javax.swing.JCheckBox(); |
205 |
javaCompletionPane = new javax.swing.JPanel(); |
174 |
javaCompletionPane = new javax.swing.JPanel(); |
206 |
guessMethodArguments = new javax.swing.JCheckBox(); |
175 |
guessMethodArguments = new javax.swing.JCheckBox(); |
207 |
javaAutoPopupOnIdentifierPart = new javax.swing.JCheckBox(); |
176 |
javaAutoPopupOnIdentifierPart = new javax.swing.JCheckBox(); |
Lines 215-268
Link Here
|
215 |
javaCompletionExcluderLabel = new javax.swing.JLabel(); |
184 |
javaCompletionExcluderLabel = new javax.swing.JLabel(); |
216 |
javaCompletionExcluderButton = new javax.swing.JButton(); |
185 |
javaCompletionExcluderButton = new javax.swing.JButton(); |
217 |
|
186 |
|
218 |
javaCompletionExcluderFrame.setTitle(org.openide.util.NbBundle.getMessage(CodeCompletionPanel.class, "CodeCompletionPanel.javaCompletionExcluderFrame.title")); // NOI18N |
187 |
javaCompletionExcluderDialog2.setModal(true); |
219 |
javaCompletionExcluderFrame.setAlwaysOnTop(true); |
188 |
javaCompletionExcluderDialog2.setUndecorated(true); |
220 |
javaCompletionExcluderFrame.setMinimumSize(new java.awt.Dimension(409, 233)); |
|
|
221 |
javaCompletionExcluderFrame.setUndecorated(true); |
222 |
|
189 |
|
223 |
javaCompletionExcludeTable.setModel(new javax.swing.table.DefaultTableModel( |
190 |
javaCompletionExcluderDialogTextField.setText(org.openide.util.NbBundle.getMessage(CodeCompletionPanel.class, "CodeCompletionPanel.javaCompletionExcluderDialogTextField.text")); // NOI18N |
224 |
new Object [][] { |
191 |
javaCompletionExcluderDialogTextField.addKeyListener(new java.awt.event.KeyAdapter() { |
225 |
|
192 |
public void keyTyped(java.awt.event.KeyEvent evt) { |
226 |
}, |
193 |
javaCompletionExcluderDialogTextFieldKeyTyped(evt); |
227 |
new String [] { |
|
|
228 |
"Fully Qualified Name prefix" |
229 |
} |
230 |
) { |
231 |
Class[] types = new Class [] { |
232 |
java.lang.String.class |
233 |
}; |
234 |
|
235 |
public Class getColumnClass(int columnIndex) { |
236 |
return types [columnIndex]; |
237 |
} |
194 |
} |
238 |
}); |
195 |
}); |
239 |
javaCompletionExcludeTable.getTableHeader().setReorderingAllowed(false); |
196 |
|
240 |
javaCompletionExcludeScrollPane.setViewportView(javaCompletionExcludeTable); |
197 |
org.openide.awt.Mnemonics.setLocalizedText(javaCompletionExcluderDialogOkButton, org.openide.util.NbBundle.getMessage(CodeCompletionPanel.class, "CodeCompletionPanel.javaCompletionExcluderDialogOkButton.text")); // NOI18N |
241 |
javaCompletionExcludeTable.getColumnModel().getColumn(0).setHeaderValue(org.openide.util.NbBundle.getMessage(CodeCompletionPanel.class, "CodeCompletionPanel.javaCompletionExcludeTable.columnModel.title0")); // NOI18N |
198 |
javaCompletionExcluderDialogOkButton.addActionListener(new java.awt.event.ActionListener() { |
|
|
199 |
public void actionPerformed(java.awt.event.ActionEvent evt) { |
200 |
javaCompletionExcluderDialogOkButtonActionPerformed(evt); |
201 |
} |
202 |
}); |
203 |
|
204 |
org.openide.awt.Mnemonics.setLocalizedText(javaCompletionExcluderDialogLabel, org.openide.util.NbBundle.getMessage(CodeCompletionPanel.class, "CodeCompletionPanel.javaCompletionExcluderDialogLabel.text")); // NOI18N |
205 |
|
206 |
org.openide.awt.Mnemonics.setLocalizedText(javaCompletionExcluderDialogCancelButton, org.openide.util.NbBundle.getMessage(CodeCompletionPanel.class, "CodeCompletionPanel.javaCompletionExcluderDialogCancelButton.text")); // NOI18N |
207 |
javaCompletionExcluderDialogCancelButton.addActionListener(new java.awt.event.ActionListener() { |
208 |
public void actionPerformed(java.awt.event.ActionEvent evt) { |
209 |
javaCompletionExcluderDialogCancelButtonActionPerformed(evt); |
210 |
} |
211 |
}); |
212 |
|
213 |
org.jdesktop.layout.GroupLayout javaCompletionExcluderDialog2Layout = new org.jdesktop.layout.GroupLayout(javaCompletionExcluderDialog2.getContentPane()); |
214 |
javaCompletionExcluderDialog2.getContentPane().setLayout(javaCompletionExcluderDialog2Layout); |
215 |
javaCompletionExcluderDialog2Layout.setHorizontalGroup( |
216 |
javaCompletionExcluderDialog2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) |
217 |
.add(javaCompletionExcluderDialog2Layout.createSequentialGroup() |
218 |
.addContainerGap() |
219 |
.add(javaCompletionExcluderDialog2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING, false) |
220 |
.add(org.jdesktop.layout.GroupLayout.LEADING, javaCompletionExcluderDialogLabel, 0, 0, Short.MAX_VALUE) |
221 |
.add(org.jdesktop.layout.GroupLayout.LEADING, javaCompletionExcluderDialogTextField, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 307, Short.MAX_VALUE)) |
222 |
.addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED) |
223 |
.add(javaCompletionExcluderDialog2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false) |
224 |
.add(javaCompletionExcluderDialogOkButton, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) |
225 |
.add(javaCompletionExcluderDialogCancelButton, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) |
226 |
.addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) |
227 |
); |
228 |
javaCompletionExcluderDialog2Layout.setVerticalGroup( |
229 |
javaCompletionExcluderDialog2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) |
230 |
.add(org.jdesktop.layout.GroupLayout.TRAILING, javaCompletionExcluderDialog2Layout.createSequentialGroup() |
231 |
.add(javaCompletionExcluderDialog2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) |
232 |
.add(javaCompletionExcluderDialog2Layout.createSequentialGroup() |
233 |
.addContainerGap() |
234 |
.add(javaCompletionExcluderDialogLabel) |
235 |
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) |
236 |
.add(javaCompletionExcluderDialog2Layout.createSequentialGroup() |
237 |
.addContainerGap() |
238 |
.add(javaCompletionExcluderDialogCancelButton) |
239 |
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED))) |
240 |
.add(javaCompletionExcluderDialog2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) |
241 |
.add(javaCompletionExcluderDialogTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) |
242 |
.add(javaCompletionExcluderDialogOkButton)) |
243 |
.add(61, 61, 61)) |
244 |
); |
245 |
|
246 |
javaCompletionExcluderDialogTextField.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(CodeCompletionPanel.class, "CodeCompletionPanel.javaCompletionExcluderDialogTextField.AccessibleContext.accessibleName")); // NOI18N |
247 |
javaCompletionExcluderDialogTextField.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(CodeCompletionPanel.class, "CodeCompletionPanel.javaCompletionExcluderDialogTextField.AccessibleContext.accessibleDescription")); // NOI18N |
248 |
javaCompletionExcluderDialogLabel.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(CodeCompletionPanel.class, "CodeCompletionPanel.javaCompletionExcluderDialogLabel.AccessibleContext.accessibleName")); // NOI18N |
249 |
|
250 |
javaCompletionExcluderDialog2.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(CodeCompletionPanel.class, "CodeCompletionPanel.javaCompletionExcluderDialog2.AccessibleContext.accessibleName")); // NOI18N |
251 |
|
252 |
javaCompletionExcluderDialog1.setTitle(org.openide.util.NbBundle.getMessage(CodeCompletionPanel.class, "CodeCompletionPanel.javaCompletionExcluderDialog1.title")); // NOI18N |
253 |
javaCompletionExcluderDialog1.setModal(true); |
254 |
|
255 |
javaCompletionExcludeScrollPane.setViewportView(javaCompletionExcludeJlist); |
256 |
javaCompletionExcludeJlist.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(CodeCompletionPanel.class, "CodeCompletionPanel.javaCompletionExcludeJlist.AccessibleContext.accessibleName")); // NOI18N |
242 |
|
257 |
|
243 |
javaCompletionExcluderTab.addTab(org.openide.util.NbBundle.getMessage(CodeCompletionPanel.class, "CodeCompletionPanel.javaCompletionExcludeScrollPane.TabConstraints.tabTitle"), javaCompletionExcludeScrollPane); // NOI18N |
258 |
javaCompletionExcluderTab.addTab(org.openide.util.NbBundle.getMessage(CodeCompletionPanel.class, "CodeCompletionPanel.javaCompletionExcludeScrollPane.TabConstraints.tabTitle"), javaCompletionExcludeScrollPane); // NOI18N |
|
|
259 |
javaCompletionExcludeScrollPane.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(CodeCompletionPanel.class, "CodeCompletionPanel.javaCompletionExcludeScrollPane.AccessibleContext.accessibleName")); // NOI18N |
244 |
|
260 |
|
245 |
javaCompletionIncludeTable.setModel(new javax.swing.table.DefaultTableModel( |
261 |
javaCompletionIncludeScrollPane.setViewportView(javaCompletionIncludeJlist); |
246 |
new Object [][] { |
262 |
javaCompletionIncludeJlist.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(CodeCompletionPanel.class, "CodeCompletionPanel.javaCompletionIncludeJlist.AccessibleContext.accessibleName")); // NOI18N |
247 |
|
|
|
248 |
}, |
249 |
new String [] { |
250 |
"Fully Qualified Name prefix" |
251 |
} |
252 |
) { |
253 |
Class[] types = new Class [] { |
254 |
java.lang.String.class |
255 |
}; |
256 |
|
257 |
public Class getColumnClass(int columnIndex) { |
258 |
return types [columnIndex]; |
259 |
} |
260 |
}); |
261 |
javaCompletionIncludeTable.getTableHeader().setReorderingAllowed(false); |
262 |
javaCompletionIncludeScrollPane.setViewportView(javaCompletionIncludeTable); |
263 |
javaCompletionIncludeTable.getColumnModel().getColumn(0).setHeaderValue(org.openide.util.NbBundle.getMessage(CodeCompletionPanel.class, "CodeCompletionPanel.javaCompletionExcludeTable.columnModel.title0")); // NOI18N |
264 |
|
263 |
|
265 |
javaCompletionExcluderTab.addTab(org.openide.util.NbBundle.getMessage(CodeCompletionPanel.class, "CodeCompletionPanel.javaCompletionIncludeScrollPane.TabConstraints.tabTitle"), javaCompletionIncludeScrollPane); // NOI18N |
264 |
javaCompletionExcluderTab.addTab(org.openide.util.NbBundle.getMessage(CodeCompletionPanel.class, "CodeCompletionPanel.javaCompletionIncludeScrollPane.TabConstraints.tabTitle"), javaCompletionIncludeScrollPane); // NOI18N |
|
|
265 |
javaCompletionIncludeScrollPane.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(CodeCompletionPanel.class, "CodeCompletionPanel.javaCompletionIncludeScrollPane.AccessibleContext.accessibleName")); // NOI18N |
266 |
|
266 |
|
267 |
org.openide.awt.Mnemonics.setLocalizedText(javaCompletionExcluderAddButton, org.openide.util.NbBundle.getMessage(CodeCompletionPanel.class, "CodeCompletionPanel.javaCompletionExcluderAddButton.text")); // NOI18N |
267 |
org.openide.awt.Mnemonics.setLocalizedText(javaCompletionExcluderAddButton, org.openide.util.NbBundle.getMessage(CodeCompletionPanel.class, "CodeCompletionPanel.javaCompletionExcluderAddButton.text")); // NOI18N |
268 |
javaCompletionExcluderAddButton.addActionListener(new java.awt.event.ActionListener() { |
268 |
javaCompletionExcluderAddButton.addActionListener(new java.awt.event.ActionListener() { |
Lines 285-321
Link Here
|
285 |
} |
285 |
} |
286 |
}); |
286 |
}); |
287 |
|
287 |
|
288 |
org.jdesktop.layout.GroupLayout javaCompletionExcluderFrameLayout = new org.jdesktop.layout.GroupLayout(javaCompletionExcluderFrame.getContentPane()); |
288 |
org.openide.awt.Mnemonics.setLocalizedText(javaCompletionExcluderEditButton, org.openide.util.NbBundle.getMessage(CodeCompletionPanel.class, "CodeCompletionPanel.javaCompletionExcluderEditButton.text")); // NOI18N |
289 |
javaCompletionExcluderFrame.getContentPane().setLayout(javaCompletionExcluderFrameLayout); |
289 |
javaCompletionExcluderEditButton.addActionListener(new java.awt.event.ActionListener() { |
290 |
javaCompletionExcluderFrameLayout.setHorizontalGroup( |
290 |
public void actionPerformed(java.awt.event.ActionEvent evt) { |
291 |
javaCompletionExcluderFrameLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) |
291 |
javaCompletionExcluderEditButtonActionPerformed(evt); |
292 |
.add(org.jdesktop.layout.GroupLayout.TRAILING, javaCompletionExcluderFrameLayout.createSequentialGroup() |
292 |
} |
|
|
293 |
}); |
294 |
|
295 |
org.openide.awt.Mnemonics.setLocalizedText(javaCompletionExcluderMethodsCheckBox, org.openide.util.NbBundle.getMessage(CodeCompletionPanel.class, "CodeCompletionPanel.javaCompletionExcluderMethodsCheckBox.text")); // NOI18N |
296 |
javaCompletionExcluderMethodsCheckBox.addActionListener(new java.awt.event.ActionListener() { |
297 |
public void actionPerformed(java.awt.event.ActionEvent evt) { |
298 |
javaCompletionExcluderMethodsCheckBoxActionPerformed(evt); |
299 |
} |
300 |
}); |
301 |
|
302 |
org.jdesktop.layout.GroupLayout javaCompletionExcluderDialog1Layout = new org.jdesktop.layout.GroupLayout(javaCompletionExcluderDialog1.getContentPane()); |
303 |
javaCompletionExcluderDialog1.getContentPane().setLayout(javaCompletionExcluderDialog1Layout); |
304 |
javaCompletionExcluderDialog1Layout.setHorizontalGroup( |
305 |
javaCompletionExcluderDialog1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) |
306 |
.add(javaCompletionExcluderDialog1Layout.createSequentialGroup() |
293 |
.addContainerGap() |
307 |
.addContainerGap() |
294 |
.add(javaCompletionExcluderTab, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 298, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) |
308 |
.add(javaCompletionExcluderDialog1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) |
295 |
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) |
309 |
.add(javaCompletionExcluderDialog1Layout.createSequentialGroup() |
296 |
.add(javaCompletionExcluderFrameLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false) |
310 |
.add(javaCompletionExcluderTab, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 298, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) |
297 |
.add(javaCompletionExcluderCloseButton, 0, 0, Short.MAX_VALUE) |
311 |
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) |
298 |
.add(javaCompletionExcluderRemoveButton, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) |
312 |
.add(javaCompletionExcluderDialog1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false) |
299 |
.add(javaCompletionExcluderAddButton, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) |
313 |
.add(javaCompletionExcluderEditButton, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) |
300 |
.addContainerGap(10, Short.MAX_VALUE)) |
314 |
.add(javaCompletionExcluderRemoveButton, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) |
|
|
315 |
.add(javaCompletionExcluderAddButton, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))) |
316 |
.add(javaCompletionExcluderDialog1Layout.createSequentialGroup() |
317 |
.add(javaCompletionExcluderMethodsCheckBox) |
318 |
.add(125, 125, 125) |
319 |
.add(javaCompletionExcluderCloseButton, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 93, Short.MAX_VALUE))) |
320 |
.addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) |
301 |
); |
321 |
); |
302 |
javaCompletionExcluderFrameLayout.setVerticalGroup( |
322 |
javaCompletionExcluderDialog1Layout.setVerticalGroup( |
303 |
javaCompletionExcluderFrameLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) |
323 |
javaCompletionExcluderDialog1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) |
304 |
.add(javaCompletionExcluderFrameLayout.createSequentialGroup() |
324 |
.add(javaCompletionExcluderDialog1Layout.createSequentialGroup() |
305 |
.add(javaCompletionExcluderFrameLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) |
325 |
.add(javaCompletionExcluderDialog1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) |
306 |
.add(javaCompletionExcluderFrameLayout.createSequentialGroup() |
326 |
.add(javaCompletionExcluderDialog1Layout.createSequentialGroup() |
307 |
.addContainerGap() |
327 |
.addContainerGap() |
308 |
.add(javaCompletionExcluderTab, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 221, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) |
328 |
.add(javaCompletionExcluderTab, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 221, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) |
309 |
.add(javaCompletionExcluderFrameLayout.createSequentialGroup() |
329 |
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) |
|
|
330 |
.add(javaCompletionExcluderDialog1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) |
331 |
.add(javaCompletionExcluderMethodsCheckBox) |
332 |
.add(javaCompletionExcluderCloseButton))) |
333 |
.add(javaCompletionExcluderDialog1Layout.createSequentialGroup() |
310 |
.add(59, 59, 59) |
334 |
.add(59, 59, 59) |
311 |
.add(javaCompletionExcluderAddButton) |
335 |
.add(javaCompletionExcluderAddButton) |
312 |
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) |
336 |
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) |
313 |
.add(javaCompletionExcluderRemoveButton) |
337 |
.add(javaCompletionExcluderEditButton) |
314 |
.add(63, 63, 63) |
338 |
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) |
315 |
.add(javaCompletionExcluderCloseButton))) |
339 |
.add(javaCompletionExcluderRemoveButton))) |
316 |
.addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) |
340 |
.addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) |
317 |
); |
341 |
); |
318 |
|
342 |
|
|
|
343 |
javaCompletionExcluderTab.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(CodeCompletionPanel.class, "CodeCompletionPanel.javaCompletionExcluderTab.AccessibleContext.accessibleName")); // NOI18N |
344 |
|
319 |
setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); |
345 |
setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); |
320 |
|
346 |
|
321 |
org.openide.awt.Mnemonics.setLocalizedText(guessMethodArguments, org.openide.util.NbBundle.getMessage(CodeCompletionPanel.class, "LBL_GuessMethodArgs")); // NOI18N |
347 |
org.openide.awt.Mnemonics.setLocalizedText(guessMethodArguments, org.openide.util.NbBundle.getMessage(CodeCompletionPanel.class, "LBL_GuessMethodArgs")); // NOI18N |
Lines 361-367
Link Here
|
361 |
.add(javaCompletionPaneLayout.createSequentialGroup() |
387 |
.add(javaCompletionPaneLayout.createSequentialGroup() |
362 |
.addContainerGap() |
388 |
.addContainerGap() |
363 |
.add(javaCompletionPaneLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) |
389 |
.add(javaCompletionPaneLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) |
364 |
.add(jSeparator1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 337, Short.MAX_VALUE) |
390 |
.add(jSeparator1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 511, Short.MAX_VALUE) |
365 |
.add(javaCompletionPaneLayout.createSequentialGroup() |
391 |
.add(javaCompletionPaneLayout.createSequentialGroup() |
366 |
.add(javadocAutoCompletionTriggersLabel) |
392 |
.add(javadocAutoCompletionTriggersLabel) |
367 |
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) |
393 |
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) |
Lines 371-394
Link Here
|
371 |
.add(javaCompletionPaneLayout.createSequentialGroup() |
397 |
.add(javaCompletionPaneLayout.createSequentialGroup() |
372 |
.addContainerGap() |
398 |
.addContainerGap() |
373 |
.add(javaCompletionPaneLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) |
399 |
.add(javaCompletionPaneLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) |
374 |
.add(guessMethodArguments) |
400 |
.add(guessMethodArguments) |
375 |
.add(javaCompletionPaneLayout.createSequentialGroup() |
401 |
.add(javaCompletionPaneLayout.createSequentialGroup() |
376 |
.add(javaAutoCompletionTriggersLabel) |
402 |
.add(javaAutoCompletionTriggersLabel) |
377 |
.add(34, 34, 34) |
403 |
.add(34, 34, 34) |
378 |
.add(javaAutoCompletionTriggersField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 86, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) |
404 |
.add(javaAutoCompletionTriggersField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 86, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) |
379 |
.add(javaAutoPopupOnIdentifierPart) |
405 |
.add(javaAutoPopupOnIdentifierPart) |
380 |
.add(javaCompletionPaneLayout.createSequentialGroup() |
406 |
.add(javaCompletionPaneLayout.createSequentialGroup() |
381 |
.add(javaCompletionPaneLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) |
407 |
.add(javaCompletionPaneLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) |
382 |
.add(javaCompletionExcluderLabel) |
408 |
.add(javaCompletionExcluderLabel) |
383 |
.add(javaCompletionSelectorsLabel)) |
409 |
.add(javaCompletionSelectorsLabel)) |
384 |
.add(javaCompletionPaneLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) |
410 |
.add(javaCompletionPaneLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) |
385 |
.add(javaCompletionPaneLayout.createSequentialGroup() |
411 |
.add(javaCompletionPaneLayout.createSequentialGroup() |
386 |
.add(30, 30, 30) |
412 |
.add(30, 30, 30) |
387 |
.add(javaCompletionSelectorsField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 86, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) |
413 |
.add(javaCompletionSelectorsField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 86, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) |
388 |
.add(org.jdesktop.layout.GroupLayout.TRAILING, javaCompletionPaneLayout.createSequentialGroup() |
414 |
.add(javaCompletionPaneLayout.createSequentialGroup() |
389 |
.add(23, 23, 23) |
415 |
.add(23, 23, 23) |
390 |
.add(javaCompletionExcluderButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 93, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))))) |
416 |
.add(javaCompletionExcluderButton))))) |
391 |
.addContainerGap(25, Short.MAX_VALUE))) |
417 |
.add(213, 213, 213))) |
392 |
); |
418 |
); |
393 |
javaCompletionPaneLayout.setVerticalGroup( |
419 |
javaCompletionPaneLayout.setVerticalGroup( |
394 |
javaCompletionPaneLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) |
420 |
javaCompletionPaneLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) |
Lines 399-419
Link Here
|
399 |
.add(javaCompletionPaneLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) |
425 |
.add(javaCompletionPaneLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) |
400 |
.add(javadocAutoCompletionTriggersLabel) |
426 |
.add(javadocAutoCompletionTriggersLabel) |
401 |
.add(javadocAutoCompletionTriggersField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) |
427 |
.add(javadocAutoCompletionTriggersField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) |
402 |
.addContainerGap(23, Short.MAX_VALUE)) |
428 |
.addContainerGap(31, Short.MAX_VALUE)) |
403 |
.add(javaCompletionPaneLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) |
429 |
.add(javaCompletionPaneLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) |
404 |
.add(javaCompletionPaneLayout.createSequentialGroup() |
430 |
.add(javaCompletionPaneLayout.createSequentialGroup() |
405 |
.addContainerGap() |
431 |
.addContainerGap() |
406 |
.add(guessMethodArguments, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 23, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) |
432 |
.add(guessMethodArguments, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 23, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) |
407 |
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) |
433 |
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) |
408 |
.add(javaCompletionPaneLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) |
434 |
.add(javaCompletionPaneLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) |
409 |
.add(javaAutoCompletionTriggersLabel) |
435 |
.add(javaAutoCompletionTriggersLabel) |
410 |
.add(javaAutoCompletionTriggersField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) |
436 |
.add(javaAutoCompletionTriggersField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) |
411 |
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) |
437 |
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) |
412 |
.add(javaAutoPopupOnIdentifierPart) |
438 |
.add(javaAutoPopupOnIdentifierPart) |
413 |
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) |
439 |
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) |
414 |
.add(javaCompletionPaneLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) |
440 |
.add(javaCompletionPaneLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) |
415 |
.add(javaCompletionSelectorsLabel) |
441 |
.add(javaCompletionSelectorsLabel) |
416 |
.add(javaCompletionSelectorsField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) |
442 |
.add(javaCompletionSelectorsField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) |
417 |
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) |
443 |
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) |
418 |
.add(javaCompletionPaneLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) |
444 |
.add(javaCompletionPaneLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) |
419 |
.add(javaCompletionExcluderButton) |
445 |
.add(javaCompletionExcluderButton) |
Lines 421-426
Link Here
|
421 |
.addContainerGap(91, Short.MAX_VALUE))) |
447 |
.addContainerGap(91, Short.MAX_VALUE))) |
422 |
); |
448 |
); |
423 |
|
449 |
|
|
|
450 |
javaCompletionExcluderButton.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(CodeCompletionPanel.class, "CodeCompletionPanel.javaCompletionExcluderButton.AccessibleContext.accessibleName")); // NOI18N |
451 |
|
424 |
org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this); |
452 |
org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this); |
425 |
this.setLayout(layout); |
453 |
this.setLayout(layout); |
426 |
layout.setHorizontalGroup( |
454 |
layout.setHorizontalGroup( |
Lines 442-480
Link Here
|
442 |
}//GEN-LAST:event_guessMethodArgumentsActionPerformed |
470 |
}//GEN-LAST:event_guessMethodArgumentsActionPerformed |
443 |
|
471 |
|
444 |
private void javaCompletionExcluderButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_javaCompletionExcluderButtonActionPerformed |
472 |
private void javaCompletionExcluderButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_javaCompletionExcluderButtonActionPerformed |
445 |
if (javaCompletionExcluderFrame.isVisible()) |
473 |
assert !javaCompletionExcluderDialog1.isVisible(); |
446 |
return; |
474 |
javaCompletionExcluderDialog1.setVisible(true); |
447 |
javaCompletionExcluderFrame.pack(); |
|
|
448 |
javaCompletionExcluderFrame.setLocationRelativeTo(this); |
449 |
javaCompletionExcluderFrame.setVisible(true); |
450 |
}//GEN-LAST:event_javaCompletionExcluderButtonActionPerformed |
475 |
}//GEN-LAST:event_javaCompletionExcluderButtonActionPerformed |
451 |
|
476 |
|
452 |
private void javaCompletionExcluderAddButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_javaCompletionExcluderAddButtonActionPerformed |
477 |
private void javaCompletionExcluderAddButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_javaCompletionExcluderAddButtonActionPerformed |
453 |
JTable table = getSelectedExcluderTable(); |
478 |
openExcluderEditor(); |
454 |
DefaultTableModel model = (DefaultTableModel) table.getModel(); |
|
|
455 |
int rows = model.getRowCount(); |
456 |
model.setRowCount(rows + 1); |
457 |
table.editCellAt(rows, 0); |
458 |
table.requestFocus(); |
459 |
}//GEN-LAST:event_javaCompletionExcluderAddButtonActionPerformed |
479 |
}//GEN-LAST:event_javaCompletionExcluderAddButtonActionPerformed |
460 |
|
480 |
|
461 |
private void javaCompletionExcluderRemoveButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_javaCompletionExcluderRemoveButtonActionPerformed |
481 |
private void javaCompletionExcluderRemoveButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_javaCompletionExcluderRemoveButtonActionPerformed |
462 |
JTable table = getSelectedExcluderTable(); |
482 |
JList list = getSelectedExcluderList(); |
463 |
int[] rows = table.getSelectedRows(); |
483 |
int[] rows = list.getSelectedIndices(); |
464 |
if (rows.length == 0) |
484 |
DefaultListModel model = (DefaultListModel) list.getModel(); |
465 |
return; |
|
|
466 |
// remove rows in descending order: row numbers change when a row is removed |
485 |
// remove rows in descending order: row numbers change when a row is removed |
467 |
Arrays.sort(rows); |
|
|
468 |
DefaultTableModel model = (DefaultTableModel) table.getModel(); |
469 |
for (int row = rows.length - 1; row >= 0; row--) { |
486 |
for (int row = rows.length - 1; row >= 0; row--) { |
470 |
model.removeRow(rows[row]); |
487 |
model.remove(rows[row]); |
471 |
} |
488 |
} |
|
|
489 |
updateExcluder(list); |
472 |
}//GEN-LAST:event_javaCompletionExcluderRemoveButtonActionPerformed |
490 |
}//GEN-LAST:event_javaCompletionExcluderRemoveButtonActionPerformed |
473 |
|
491 |
|
474 |
private void javaCompletionExcluderCloseButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_javaCompletionExcluderCloseButtonActionPerformed |
492 |
private void javaCompletionExcluderCloseButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_javaCompletionExcluderCloseButtonActionPerformed |
475 |
javaCompletionExcluderFrame.setVisible(false); |
493 |
javaCompletionExcluderDialog1.setVisible(false); |
476 |
}//GEN-LAST:event_javaCompletionExcluderCloseButtonActionPerformed |
494 |
}//GEN-LAST:event_javaCompletionExcluderCloseButtonActionPerformed |
477 |
|
495 |
|
|
|
496 |
private void javaCompletionExcluderEditButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_javaCompletionExcluderEditButtonActionPerformed |
497 |
JList list = getSelectedExcluderList(); |
498 |
int index = list.getSelectedIndex(); |
499 |
if (index == -1) |
500 |
return; |
501 |
DefaultListModel model = (DefaultListModel) list.getModel(); |
502 |
javaExcluderEditing = (String) model.getElementAt(index); |
503 |
openExcluderEditor(); |
504 |
}//GEN-LAST:event_javaCompletionExcluderEditButtonActionPerformed |
505 |
|
506 |
private void javaCompletionExcluderMethodsCheckBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_javaCompletionExcluderMethodsCheckBoxActionPerformed |
507 |
preferences.putBoolean(JAVA_COMPLETION_EXCLUDER_METHODS, javaCompletionExcluderMethodsCheckBox.isSelected()); |
508 |
}//GEN-LAST:event_javaCompletionExcluderMethodsCheckBoxActionPerformed |
509 |
|
510 |
private void javaCompletionExcluderDialogOkButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_javaCompletionExcluderDialogOkButtonActionPerformed |
511 |
JList list = getSelectedExcluderList(); |
512 |
String text = javaCompletionExcluderDialogTextField.getText(); |
513 |
DefaultListModel model = (DefaultListModel) list.getModel(); |
514 |
int index = model.size(); |
515 |
if (javaExcluderEditing != null){ |
516 |
// if this was an "edit" rather than "add", then remove the old entry first |
517 |
index = model.indexOf(javaExcluderEditing); |
518 |
model.remove(index); |
519 |
javaExcluderEditing = null; |
520 |
} |
521 |
String[] entries = text.split(","); // NOI18N |
522 |
for (String entry : entries) { |
523 |
// strip wildcards |
524 |
if (entry.contains("*")) { // NOI18N |
525 |
entry = entry.replaceAll("\\*", ""); // NOI18N |
526 |
} |
527 |
entry = entry.trim(); |
528 |
if (entry.length() != 0 && entry.matches(JAVA_FQN_REGEX)){ |
529 |
model.insertElementAt(entry, index); |
530 |
index++; |
531 |
} |
532 |
} |
533 |
updateExcluder(list); |
534 |
javaCompletionExcluderDialog2.setVisible(false); |
535 |
javaCompletionExcluderDialogTextField.setText(null); |
536 |
}//GEN-LAST:event_javaCompletionExcluderDialogOkButtonActionPerformed |
537 |
|
538 |
private void javaCompletionExcluderDialogCancelButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_javaCompletionExcluderDialogCancelButtonActionPerformed |
539 |
javaCompletionExcluderDialog2.setVisible(false); |
540 |
javaCompletionExcluderDialogTextField.setText(null); |
541 |
javaExcluderEditing = null; |
542 |
}//GEN-LAST:event_javaCompletionExcluderDialogCancelButtonActionPerformed |
543 |
|
544 |
private void javaCompletionExcluderDialogTextFieldKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_javaCompletionExcluderDialogTextFieldKeyTyped |
545 |
char c = evt.getKeyChar(); |
546 |
// could use javax.lang.model.SourceVersion.isIdentifier if we had Java 6 |
547 |
if (c != ' ' && c != ',' && c != '*' && !String.valueOf(c).matches(JAVA_FQN_REGEX)) { //NOI18N |
548 |
getToolkit().beep(); |
549 |
evt.consume(); |
550 |
} |
551 |
}//GEN-LAST:event_javaCompletionExcluderDialogTextFieldKeyTyped |
552 |
|
478 |
private void update(DocumentEvent e) { |
553 |
private void update(DocumentEvent e) { |
479 |
if (e.getDocument() == javaAutoCompletionTriggersField.getDocument()) |
554 |
if (e.getDocument() == javaAutoCompletionTriggersField.getDocument()) |
480 |
preferences.put(JAVA_AUTO_COMPLETION_TRIGGERS, javaAutoCompletionTriggersField.getText()); |
555 |
preferences.put(JAVA_AUTO_COMPLETION_TRIGGERS, javaAutoCompletionTriggersField.getText()); |
Lines 484-506
Link Here
|
484 |
preferences.put(JAVADOC_AUTO_COMPLETION_TRIGGERS, javadocAutoCompletionTriggersField.getText()); |
559 |
preferences.put(JAVADOC_AUTO_COMPLETION_TRIGGERS, javadocAutoCompletionTriggersField.getText()); |
485 |
} |
560 |
} |
486 |
|
561 |
|
|
|
562 |
private void updateExcluder(JList list) { |
563 |
DefaultListModel model = (DefaultListModel) list.getModel(); |
564 |
StringBuilder builder = new StringBuilder(); |
565 |
for (int i = 0 ; i < model.size() ; i++) { |
566 |
String entry = (String) model.getElementAt(i); |
567 |
if (builder.length() > 0) { |
568 |
builder.append(","); //NOI18N |
569 |
} |
570 |
builder.append(entry); |
571 |
} |
572 |
String pref; |
573 |
if (list == javaCompletionExcludeJlist) |
574 |
pref = JAVA_COMPLETION_BLACKLIST; |
575 |
else if (list == javaCompletionIncludeJlist) |
576 |
pref = JAVA_COMPLETION_WHITELIST; |
577 |
else |
578 |
throw new RuntimeException(list.getName()); |
579 |
|
580 |
preferences.put(pref, builder.toString()); |
581 |
} |
582 |
|
583 |
// allows common excluder buttons to know which table to act on |
584 |
private JList getSelectedExcluderList() { |
585 |
Component selected = javaCompletionExcluderTab.getSelectedComponent(); |
586 |
if (selected == javaCompletionExcludeScrollPane) { |
587 |
return javaCompletionExcludeJlist; |
588 |
} else if (selected == javaCompletionIncludeScrollPane) { |
589 |
return javaCompletionIncludeJlist; |
590 |
} else { |
591 |
throw new RuntimeException(selected.getName()); |
592 |
} |
593 |
} |
594 |
|
487 |
// Variables declaration - do not modify//GEN-BEGIN:variables |
595 |
// Variables declaration - do not modify//GEN-BEGIN:variables |
488 |
private javax.swing.JCheckBox guessMethodArguments; |
596 |
private javax.swing.JCheckBox guessMethodArguments; |
489 |
private javax.swing.JSeparator jSeparator1; |
597 |
private javax.swing.JSeparator jSeparator1; |
490 |
private javax.swing.JTextField javaAutoCompletionTriggersField; |
598 |
private javax.swing.JTextField javaAutoCompletionTriggersField; |
491 |
private javax.swing.JLabel javaAutoCompletionTriggersLabel; |
599 |
private javax.swing.JLabel javaAutoCompletionTriggersLabel; |
492 |
private javax.swing.JCheckBox javaAutoPopupOnIdentifierPart; |
600 |
private javax.swing.JCheckBox javaAutoPopupOnIdentifierPart; |
|
|
601 |
private javax.swing.JList javaCompletionExcludeJlist; |
493 |
private javax.swing.JScrollPane javaCompletionExcludeScrollPane; |
602 |
private javax.swing.JScrollPane javaCompletionExcludeScrollPane; |
494 |
private javax.swing.JTable javaCompletionExcludeTable; |
|
|
495 |
private javax.swing.JButton javaCompletionExcluderAddButton; |
603 |
private javax.swing.JButton javaCompletionExcluderAddButton; |
496 |
private javax.swing.JButton javaCompletionExcluderButton; |
604 |
private javax.swing.JButton javaCompletionExcluderButton; |
497 |
private javax.swing.JButton javaCompletionExcluderCloseButton; |
605 |
private javax.swing.JButton javaCompletionExcluderCloseButton; |
498 |
private javax.swing.JFrame javaCompletionExcluderFrame; |
606 |
private javax.swing.JDialog javaCompletionExcluderDialog1; |
|
|
607 |
private javax.swing.JDialog javaCompletionExcluderDialog2; |
608 |
private javax.swing.JButton javaCompletionExcluderDialogCancelButton; |
609 |
private javax.swing.JLabel javaCompletionExcluderDialogLabel; |
610 |
private javax.swing.JButton javaCompletionExcluderDialogOkButton; |
611 |
private javax.swing.JTextField javaCompletionExcluderDialogTextField; |
612 |
private javax.swing.JButton javaCompletionExcluderEditButton; |
499 |
private javax.swing.JLabel javaCompletionExcluderLabel; |
613 |
private javax.swing.JLabel javaCompletionExcluderLabel; |
|
|
614 |
private javax.swing.JCheckBox javaCompletionExcluderMethodsCheckBox; |
500 |
private javax.swing.JButton javaCompletionExcluderRemoveButton; |
615 |
private javax.swing.JButton javaCompletionExcluderRemoveButton; |
501 |
private javax.swing.JTabbedPane javaCompletionExcluderTab; |
616 |
private javax.swing.JTabbedPane javaCompletionExcluderTab; |
|
|
617 |
private javax.swing.JList javaCompletionIncludeJlist; |
502 |
private javax.swing.JScrollPane javaCompletionIncludeScrollPane; |
618 |
private javax.swing.JScrollPane javaCompletionIncludeScrollPane; |
503 |
private javax.swing.JTable javaCompletionIncludeTable; |
|
|
504 |
private javax.swing.JPanel javaCompletionPane; |
619 |
private javax.swing.JPanel javaCompletionPane; |
505 |
private javax.swing.JTextField javaCompletionSelectorsField; |
620 |
private javax.swing.JTextField javaCompletionSelectorsField; |
506 |
private javax.swing.JLabel javaCompletionSelectorsLabel; |
621 |
private javax.swing.JLabel javaCompletionSelectorsLabel; |
Lines 508-518
Link Here
|
508 |
private javax.swing.JLabel javadocAutoCompletionTriggersLabel; |
623 |
private javax.swing.JLabel javadocAutoCompletionTriggersLabel; |
509 |
// End of variables declaration//GEN-END:variables |
624 |
// End of variables declaration//GEN-END:variables |
510 |
|
625 |
|
511 |
private static class CodeCompletionPreferencesCusromizer implements PreferencesCustomizer { |
626 |
private static class CodeCompletionPreferencesCustomizer implements PreferencesCustomizer { |
512 |
|
627 |
|
513 |
private final Preferences preferences; |
628 |
private final Preferences preferences; |
514 |
|
629 |
|
515 |
private CodeCompletionPreferencesCusromizer(Preferences p) { |
630 |
private CodeCompletionPreferencesCustomizer(Preferences p) { |
516 |
preferences = p; |
631 |
preferences = p; |
517 |
} |
632 |
} |
518 |
|
633 |
|