This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 125060
Collapse All | Expand All

(-)a/java.editor/src/org/netbeans/modules/editor/java/JavaCompletionProvider.java (-7 / +11 lines)
Lines 2422-2431 Link Here
2422
                                    (Utilities.isShowDeprecatedMembers() || !elements.isDeprecated(e)) &&
2422
                                    (Utilities.isShowDeprecatedMembers() || !elements.isDeprecated(e)) &&
2423
                                    tu.isAccessible(scope, e, t);
2423
                                    tu.isAccessible(scope, e, t);
2424
                        case METHOD:
2424
                        case METHOD:
2425
                            return startsWith(env, e.getSimpleName().toString(), prefix) &&
2425
                            String sn = e.getSimpleName().toString();
2426
                                    (Utilities.isShowDeprecatedMembers() || !elements.isDeprecated(e)) &&
2426
                            return startsWith(env, sn, prefix) &&
2427
                                    (!isStatic || e.getModifiers().contains(STATIC)) &&
2427
                                    (Utilities.isShowDeprecatedMembers() || !elements.isDeprecated(e)) &&
2428
                                    tu.isAccessible(scope, e, t);
2428
                                    (!isStatic || e.getModifiers().contains(STATIC)) &&
2429
                                    tu.isAccessible(scope, e, t) &&
2430
                                    !Utilities.isExcluded(Utilities.getElementName(e.getEnclosingElement(), true) + "." + sn); //NOI18N
2429
                    }
2431
                    }
2430
                    return false;
2432
                    return false;
2431
                }
2433
                }
Lines 2606-2616 Link Here
2606
                                    isOfKindAndType(asMemberOf(e, t, types), e, kinds, baseType, scope, trees, types) &&
2608
                                    isOfKindAndType(asMemberOf(e, t, types), e, kinds, baseType, scope, trees, types) &&
2607
                                    tu.isAccessible(scope, e, t);
2609
                                    tu.isAccessible(scope, e, t);
2608
                        case METHOD:
2610
                        case METHOD:
2609
                            return startsWith(env, e.getSimpleName().toString(), prefix) &&
2611
                            String sn = e.getSimpleName().toString();
2612
                            return startsWith(env, sn, prefix) &&
2610
                                    (Utilities.isShowDeprecatedMembers() || !elements.isDeprecated(e)) &&
2613
                                    (Utilities.isShowDeprecatedMembers() || !elements.isDeprecated(e)) &&
2611
                                    isOfKindAndType(((ExecutableType)asMemberOf(e, t, types)).getReturnType(), e, kinds, baseType, scope, trees, types) &&
2614
                                    isOfKindAndType(((ExecutableType)asMemberOf(e, t, types)).getReturnType(), e, kinds, baseType, scope, trees, types) &&
2612
                                    (isSuperCall && e.getModifiers().contains(PROTECTED) || tu.isAccessible(scope, e, isSuperCall && enclType != null ? enclType : t)) &&
2615
                                    (isSuperCall && e.getModifiers().contains(PROTECTED) || tu.isAccessible(scope, e, isSuperCall && enclType != null ? enclType : t)) &&
2613
                                    (!isStatic || e.getModifiers().contains(STATIC));
2616
                                    (!isStatic || e.getModifiers().contains(STATIC)) &&
2617
                                    !Utilities.isExcluded(Utilities.getElementName(e.getEnclosingElement(), true) + "." + sn); //NOI18N
2614
                        case CLASS:
2618
                        case CLASS:
2615
                        case ENUM:
2619
                        case ENUM:
2616
                        case INTERFACE:
2620
                        case INTERFACE:
Lines 2730-2736 Link Here
2730
            if (fqnPrefix == null)
2734
            if (fqnPrefix == null)
2731
                fqnPrefix = EMPTY;
2735
                fqnPrefix = EMPTY;
2732
            for (String pkgName : env.getController().getClasspathInfo().getClassIndex().getPackageNames(fqnPrefix, true,EnumSet.allOf(ClassIndex.SearchScope.class)))
2736
            for (String pkgName : env.getController().getClasspathInfo().getClassIndex().getPackageNames(fqnPrefix, true,EnumSet.allOf(ClassIndex.SearchScope.class)))
2733
                if (pkgName.length() > 0)
2737
                if (pkgName.length() > 0 && !Utilities.isExcluded(pkgName + ".")) //NOI18N
2734
                    results.add(JavaCompletionItem.createPackageItem(pkgName, anchorOffset, inPkgStmt));
2738
                    results.add(JavaCompletionItem.createPackageItem(pkgName, anchorOffset, inPkgStmt));
2735
        }
2739
        }
2736
        
2740
        
(-)a/java.editor/src/org/netbeans/modules/editor/java/LazyTypeCompletionItem.java (-1 / +1 lines)
Lines 117-123 Link Here
117
                            TypeElement e = handle.resolve(controller);
117
                            TypeElement e = handle.resolve(controller);
118
                            Elements elements = controller.getElements();
118
                            Elements elements = controller.getElements();
119
                            if (e != null && (Utilities.isShowDeprecatedMembers() || !elements.isDeprecated(e)) && controller.getTrees().isAccessible(scope, e)) {
119
                            if (e != null && (Utilities.isShowDeprecatedMembers() || !elements.isDeprecated(e)) && controller.getTrees().isAccessible(scope, e)) {
120
                                if (isOfKind(e, kinds) && (!isInDefaultPackage(e) || isInDefaultPackage(scope.getEnclosingClass())))
120
                                if (isOfKind(e, kinds) && (!isInDefaultPackage(e) || isInDefaultPackage(scope.getEnclosingClass())) && !Utilities.isExcluded(e.getQualifiedName()))
121
                                    delegate = JavaCompletionItem.createTypeItem(e, (DeclaredType)e.asType(), substitutionOffset, true, controller.getElements().isDeprecated(e), insideNew, false);
121
                                    delegate = JavaCompletionItem.createTypeItem(e, (DeclaredType)e.asType(), substitutionOffset, true, controller.getElements().isDeprecated(e), insideNew, false);
122
                            }
122
                            }
123
                        }
123
                        }
(-)a/java.editor/src/org/netbeans/modules/editor/java/Utilities.java (-5 / +69 lines)
Lines 56-61 Link Here
56
import com.sun.source.util.Trees;
56
import com.sun.source.util.Trees;
57
57
58
import java.util.*;
58
import java.util.*;
59
import java.util.concurrent.atomic.AtomicReference;
59
import java.util.prefs.PreferenceChangeEvent;
60
import java.util.prefs.PreferenceChangeEvent;
60
import java.util.prefs.PreferenceChangeListener;
61
import java.util.prefs.PreferenceChangeListener;
61
import java.util.prefs.Preferences;
62
import java.util.prefs.Preferences;
Lines 113-131 Link Here
113
                showDeprecatedMembers = preferences.getBoolean(SimpleValueNames.SHOW_DEPRECATED_MEMBERS, true);
114
                showDeprecatedMembers = preferences.getBoolean(SimpleValueNames.SHOW_DEPRECATED_MEMBERS, true);
114
            }
115
            }
115
            if (settingName == null || CodeCompletionPanel.GUESS_METHOD_ARGUMENTS.equals(settingName)) {
116
            if (settingName == null || CodeCompletionPanel.GUESS_METHOD_ARGUMENTS.equals(settingName)) {
116
                guessMethodArguments = preferences.getBoolean(CodeCompletionPanel.GUESS_METHOD_ARGUMENTS, true);
117
                guessMethodArguments = preferences.getBoolean(CodeCompletionPanel.GUESS_METHOD_ARGUMENTS, CodeCompletionPanel.GUESS_METHOD_ARGUMENTS_DEFAULT);
117
            }
118
            }
118
            if (settingName == null || CodeCompletionPanel.JAVA_AUTO_POPUP_ON_IDENTIFIER_PART.equals(settingName)) {
119
            if (settingName == null || CodeCompletionPanel.JAVA_AUTO_POPUP_ON_IDENTIFIER_PART.equals(settingName)) {
119
                autoPopupOnJavaIdentifierPart = preferences.getBoolean(CodeCompletionPanel.JAVA_AUTO_POPUP_ON_IDENTIFIER_PART, false);
120
                autoPopupOnJavaIdentifierPart = preferences.getBoolean(CodeCompletionPanel.JAVA_AUTO_POPUP_ON_IDENTIFIER_PART, CodeCompletionPanel.JAVA_AUTO_POPUP_ON_IDENTIFIER_PART_DEFAULT);
120
            }
121
            }
121
            if (settingName == null || CodeCompletionPanel.JAVA_AUTO_COMPLETION_TRIGGERS.equals(settingName)) {
122
            if (settingName == null || CodeCompletionPanel.JAVA_AUTO_COMPLETION_TRIGGERS.equals(settingName)) {
122
                javaCompletionAutoPopupTriggers = preferences.get(CodeCompletionPanel.JAVA_AUTO_COMPLETION_TRIGGERS, "."); //NOI18N
123
                javaCompletionAutoPopupTriggers = preferences.get(CodeCompletionPanel.JAVA_AUTO_COMPLETION_TRIGGERS, CodeCompletionPanel.JAVA_AUTO_COMPLETION_TRIGGERS_DEFAULT);
123
            }
124
            }
124
            if (settingName == null || CodeCompletionPanel.JAVA_COMPLETION_SELECTORS.equals(settingName)) {
125
            if (settingName == null || CodeCompletionPanel.JAVA_COMPLETION_SELECTORS.equals(settingName)) {
125
                javaCompletionSelectors = preferences.get(CodeCompletionPanel.JAVA_COMPLETION_SELECTORS, ".,;:([+-="); //NOI18N
126
                javaCompletionSelectors = preferences.get(CodeCompletionPanel.JAVA_COMPLETION_SELECTORS, CodeCompletionPanel.JAVA_COMPLETION_SELECTORS_DEFAULT);
126
            }
127
            }
127
            if (settingName == null || CodeCompletionPanel.JAVADOC_AUTO_COMPLETION_TRIGGERS.equals(settingName)) {
128
            if (settingName == null || CodeCompletionPanel.JAVADOC_AUTO_COMPLETION_TRIGGERS.equals(settingName)) {
128
                javadocCompletionAutoPopupTriggers = preferences.get(CodeCompletionPanel.JAVADOC_AUTO_COMPLETION_TRIGGERS, ".#@"); //NOI18N
129
                javadocCompletionAutoPopupTriggers = preferences.get(CodeCompletionPanel.JAVADOC_AUTO_COMPLETION_TRIGGERS, CodeCompletionPanel.JAVADOC_AUTO_COMPLETION_TRIGGERS_DEFAULT);
130
            }
131
            if (settingName == null || CodeCompletionPanel.JAVA_COMPLETION_BLACKLIST.equals(settingName)) {
132
                String blacklist = preferences.get(CodeCompletionPanel.JAVA_COMPLETION_BLACKLIST, CodeCompletionPanel.JAVA_COMPLETION_BLACKLIST_DEFAULT);
133
                updateExcluder(exclude, blacklist);
134
            }
135
            if (settingName == null || CodeCompletionPanel.JAVA_COMPLETION_WHITELIST.equals(settingName)) {
136
                String whitelist = preferences.get(CodeCompletionPanel.JAVA_COMPLETION_WHITELIST, CodeCompletionPanel.JAVA_COMPLETION_WHITELIST_DEFAULT);
137
                updateExcluder(include, whitelist);
129
            }
138
            }
130
        }
139
        }
131
    };
140
    };
Lines 215-223 Link Here
215
        return javadocCompletionAutoPopupTriggers;
224
        return javadocCompletionAutoPopupTriggers;
216
    }
225
    }
217
226
227
    static private volatile AtomicReference<Collection<String>> exclude;
228
    static private volatile AtomicReference<Collection<String>> include;
229
230
    private static void updateExcluder(AtomicReference<Collection<String>> existing, String updated) {
231
        Collection<String> nue = new LinkedList<String>();
232
        if (updated == null || updated.length() == 0) {
233
            existing.set(nue);
234
            return;
235
        }
236
        String[] entries = updated.split(","); //NOI18N
237
        for (String entry : entries) {
238
            if (entry != null && entry.length() != 0) {
239
                nue.add(entry);
240
            }
241
        }
242
        existing.set(nue);
243
    }
244
245
    /**
246
     * @param fqn Fully Qualified Name (including method names). Packages names are expected to
247
     * end in a trailing "."
248
     * @return
249
     */
250
    public static boolean isExcluded(final CharSequence fqn) {
251
        if (fqn == null || fqn.length() == 0 || fqn.equals(".")) { //NOI18N
252
            return true;
253
        }
254
        lazyInit();
255
        String s = fqn.toString();
256
        if (!include.get().isEmpty()) {
257
            for (String entry : include.get()) {
258
                if (entry.length() > fqn.length()) {
259
                    if (entry.startsWith(s)) {
260
                        return false;
261
                    }
262
                } else if (s.startsWith(entry)) {
263
                    return false;
264
                }
265
            }
266
        }
267
268
        if (!exclude.get().isEmpty()) {
269
            for (String entry : exclude.get()) {
270
                if (entry.length() <= fqn.length() && s.startsWith(entry)) {
271
                    return true;
272
                }
273
            }
274
        }
275
276
        return false;
277
    }
278
218
    private static void lazyInit() {
279
    private static void lazyInit() {
219
        if (!inited) {
280
        if (!inited) {
220
            inited = true;
281
            inited = true;
282
            Collection<String> empty = Collections.emptySet();
283
            exclude = new AtomicReference<Collection<String>>(empty);
284
            include = new AtomicReference<Collection<String>>(empty);
221
            preferences = MimeLookup.getLookup(JavaKit.JAVA_MIME_TYPE).lookup(Preferences.class);
285
            preferences = MimeLookup.getLookup(JavaKit.JAVA_MIME_TYPE).lookup(Preferences.class);
222
            preferences.addPreferenceChangeListener(WeakListeners.create(PreferenceChangeListener.class, preferencesTracker, preferences));
286
            preferences.addPreferenceChangeListener(WeakListeners.create(PreferenceChangeListener.class, preferencesTracker, preferences));
223
            preferencesTracker.preferenceChange(null);
287
            preferencesTracker.preferenceChange(null);
(-)a/java.editor/src/org/netbeans/modules/java/editor/imports/ComputeImports.java (-1 / +3 lines)
Lines 72-77 Link Here
72
import org.netbeans.api.java.source.ClassIndex.NameKind;
72
import org.netbeans.api.java.source.ClassIndex.NameKind;
73
import org.netbeans.api.java.source.ElementHandle;
73
import org.netbeans.api.java.source.ElementHandle;
74
import org.netbeans.api.java.source.support.CancellableTreePathScanner;
74
import org.netbeans.api.java.source.support.CancellableTreePathScanner;
75
import org.netbeans.modules.editor.java.Utilities;
75
import org.netbeans.modules.java.editor.javadoc.JavadocImports;
76
import org.netbeans.modules.java.editor.javadoc.JavadocImports;
76
import org.openide.util.Union2;
77
import org.openide.util.Union2;
77
78
Lines 146-152 Link Here
146
                }
147
                }
147
                
148
                
148
                //#122334: do not propose imports from the default package:
149
                //#122334: do not propose imports from the default package:
149
                if (info.getElements().getPackageOf(te).getQualifiedName().length() != 0) {
150
                if (info.getElements().getPackageOf(te).getQualifiedName().length() != 0 &&
151
                        !Utilities.isExcluded(te.getQualifiedName())) {
150
                    classes.add(te);
152
                    classes.add(te);
151
                }
153
                }
152
            }
154
            }
(-)a/java.editor/src/org/netbeans/modules/java/editor/javadoc/JavadocCompletionQuery.java (-1 / +1 lines)
Lines 603-609 Link Here
603
        }
603
        }
604
        
604
        
605
        for (String pkgName : jdctx.javac.getClasspathInfo().getClassIndex().getPackageNames(pkgPrefix, true, EnumSet.allOf(ClassIndex.SearchScope.class)))
605
        for (String pkgName : jdctx.javac.getClasspathInfo().getClassIndex().getPackageNames(pkgPrefix, true, EnumSet.allOf(ClassIndex.SearchScope.class)))
606
            if (pkgName.length() > 0)
606
            if (pkgName.length() > 0 && !Utilities.isExcluded(pkgName + "."))
607
                items.add(JavaCompletionItem.createPackageItem(pkgName, substitutionOffset, false));
607
                items.add(JavaCompletionItem.createPackageItem(pkgName, substitutionOffset, false));
608
    }
608
    }
609
    
609
    
(-)a/java.editor/src/org/netbeans/modules/java/editor/options/Bundle.properties (+15 lines)
Lines 116-118 Link Here
116
LBL_JavaCompletionLabel=Java Code Completion
116
LBL_JavaCompletionLabel=Java Code Completion
117
LBL_GuessMethodParameters=jCheckBox1
117
LBL_GuessMethodParameters=jCheckBox1
118
LBL_GuessMethodArgs=&Guess Filled Method Arguments
118
LBL_GuessMethodArgs=&Guess Filled Method Arguments
119
CodeCompletionPanel.javaCompletionExcluderLabel.text=Packages/classes:
120
CodeCompletionPanel.javaCompletionExcludeTable.columnModel.title3=Title 4
121
CodeCompletionPanel.javaCompletionExcludeTable.columnModel.title2=Title 3
122
CodeCompletionPanel.javaCompletionExcludeTable.columnModel.title1=Title 2
123
CodeCompletionPanel.javaCompletionExcluderButton.text=Exclude
124
CodeCompletionPanel.javaCompletionExcludeTable.columnModel.title3_1=Title 4
125
CodeCompletionPanel.javaCompletionExcludeTable.columnModel.title2_1=Title 3
126
CodeCompletionPanel.javaCompletionExcludeTable.columnModel.title1_1=Title 2
127
CodeCompletionPanel.javaCompletionExcludeScrollPane.TabConstraints.tabTitle=Exclude
128
CodeCompletionPanel.javaCompletionExcludeTable.columnModel.title0=Fully Qualified Name prefix
129
CodeCompletionPanel.javaCompletionExcluderAddButton.text=Add
130
CodeCompletionPanel.javaCompletionIncludeScrollPane.TabConstraints.tabTitle=Include
131
CodeCompletionPanel.javaCompletionExcluderRemoveButton.text=Remove
132
CodeCompletionPanel.javaCompletionExcluderFrame.title=Java Completion Excluder
133
CodeCompletionPanel.javaCompletionExcluderCloseButton.text=Close
(-)a/java.editor/src/org/netbeans/modules/java/editor/options/CodeCompletionPanel.form (-121 / +351 lines)
Lines 1-6 Link Here
1
<?xml version="1.0" encoding="UTF-8" ?>
1
<?xml version="1.0" encoding="UTF-8" ?>
2
2
3
<Form version="1.4" maxVersion="1.4" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
3
<Form version="1.5" maxVersion="1.5" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
4
  <NonVisualComponents>
5
    <Container class="javax.swing.JFrame" name="javaCompletionExcluderFrame">
6
      <Properties>
7
        <Property name="title" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
8
          <ResourceString bundle="org/netbeans/modules/java/editor/options/Bundle.properties" key="CodeCompletionPanel.javaCompletionExcluderFrame.title" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
9
        </Property>
10
        <Property name="alwaysOnTop" type="boolean" value="true"/>
11
        <Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
12
          <Dimension value="[409, 233]"/>
13
        </Property>
14
        <Property name="undecorated" type="boolean" value="true"/>
15
      </Properties>
16
17
      <Layout>
18
        <DimensionLayout dim="0">
19
          <Group type="103" groupAlignment="0" attributes="0">
20
              <Group type="102" alignment="1" attributes="0">
21
                  <EmptySpace max="-2" attributes="0"/>
22
                  <Component id="javaCompletionExcluderTab" min="-2" pref="298" max="-2" attributes="0"/>
23
                  <EmptySpace max="-2" attributes="0"/>
24
                  <Group type="103" groupAlignment="0" max="-2" attributes="0">
25
                      <Component id="javaCompletionExcluderCloseButton" min="0" pref="0" max="32767" attributes="1"/>
26
                      <Component id="javaCompletionExcluderRemoveButton" alignment="0" max="32767" attributes="1"/>
27
                      <Component id="javaCompletionExcluderAddButton" alignment="0" max="32767" attributes="1"/>
28
                  </Group>
29
                  <EmptySpace pref="10" max="32767" attributes="0"/>
30
              </Group>
31
          </Group>
32
        </DimensionLayout>
33
        <DimensionLayout dim="1">
34
          <Group type="103" groupAlignment="0" attributes="0">
35
              <Group type="102" attributes="0">
36
                  <Group type="103" groupAlignment="0" attributes="0">
37
                      <Group type="102" attributes="0">
38
                          <EmptySpace max="-2" attributes="0"/>
39
                          <Component id="javaCompletionExcluderTab" min="-2" pref="221" max="-2" attributes="0"/>
40
                      </Group>
41
                      <Group type="102" alignment="0" attributes="0">
42
                          <EmptySpace min="-2" pref="59" max="-2" attributes="0"/>
43
                          <Component id="javaCompletionExcluderAddButton" min="-2" max="-2" attributes="0"/>
44
                          <EmptySpace max="-2" attributes="0"/>
45
                          <Component id="javaCompletionExcluderRemoveButton" min="-2" max="-2" attributes="0"/>
46
                          <EmptySpace min="-2" pref="63" max="-2" attributes="0"/>
47
                          <Component id="javaCompletionExcluderCloseButton" min="-2" max="-2" attributes="0"/>
48
                      </Group>
49
                  </Group>
50
                  <EmptySpace max="32767" attributes="0"/>
51
              </Group>
52
          </Group>
53
        </DimensionLayout>
54
      </Layout>
55
      <SubComponents>
56
        <Container class="javax.swing.JTabbedPane" name="javaCompletionExcluderTab">
57
58
          <Layout class="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout"/>
59
          <SubComponents>
60
            <Container class="javax.swing.JScrollPane" name="javaCompletionExcludeScrollPane">
61
              <AuxValues>
62
                <AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
63
              </AuxValues>
64
              <Constraints>
65
                <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription">
66
                  <JTabbedPaneConstraints tabName="Exclude">
67
                    <Property name="tabTitle" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
68
                      <ResourceString bundle="org/netbeans/modules/java/editor/options/Bundle.properties" key="CodeCompletionPanel.javaCompletionExcludeScrollPane.TabConstraints.tabTitle" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
69
                    </Property>
70
                  </JTabbedPaneConstraints>
71
                </Constraint>
72
              </Constraints>
73
74
              <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
75
              <SubComponents>
76
                <Component class="javax.swing.JTable" name="javaCompletionExcludeTable">
77
                  <Properties>
78
                    <Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.editors2.TableModelEditor">
79
                      <Table columnCount="1" rowCount="0">
80
                        <Column editable="true" title="Fully Qualified Name prefix" type="java.lang.String"/>
81
                      </Table>
82
                    </Property>
83
                    <Property name="columnModel" type="javax.swing.table.TableColumnModel" editor="org.netbeans.modules.form.editors2.TableColumnModelEditor">
84
                      <TableColumnModel selectionModel="0">
85
                        <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true">
86
                          <Title editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
87
                            <ResourceString bundle="org/netbeans/modules/java/editor/options/Bundle.properties" key="CodeCompletionPanel.javaCompletionExcludeTable.columnModel.title0" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
88
                          </Title>
89
                          <Editor/>
90
                          <Renderer/>
91
                        </Column>
92
                      </TableColumnModel>
93
                    </Property>
94
                    <Property name="tableHeader" type="javax.swing.table.JTableHeader" editor="org.netbeans.modules.form.editors2.JTableHeaderEditor">
95
                      <TableHeader reorderingAllowed="false" resizingAllowed="true"/>
96
                    </Property>
97
                  </Properties>
98
                </Component>
99
              </SubComponents>
100
            </Container>
101
            <Container class="javax.swing.JScrollPane" name="javaCompletionIncludeScrollPane">
102
              <AuxValues>
103
                <AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
104
              </AuxValues>
105
              <Constraints>
106
                <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription">
107
                  <JTabbedPaneConstraints tabName="Include">
108
                    <Property name="tabTitle" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
109
                      <ResourceString bundle="org/netbeans/modules/java/editor/options/Bundle.properties" key="CodeCompletionPanel.javaCompletionIncludeScrollPane.TabConstraints.tabTitle" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
110
                    </Property>
111
                  </JTabbedPaneConstraints>
112
                </Constraint>
113
              </Constraints>
114
115
              <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
116
              <SubComponents>
117
                <Component class="javax.swing.JTable" name="javaCompletionIncludeTable">
118
                  <Properties>
119
                    <Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.editors2.TableModelEditor">
120
                      <Table columnCount="1" rowCount="0">
121
                        <Column editable="true" title="Fully Qualified Name prefix" type="java.lang.String"/>
122
                      </Table>
123
                    </Property>
124
                    <Property name="columnModel" type="javax.swing.table.TableColumnModel" editor="org.netbeans.modules.form.editors2.TableColumnModelEditor">
125
                      <TableColumnModel selectionModel="0">
126
                        <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true">
127
                          <Title editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
128
                            <ResourceString bundle="org/netbeans/modules/java/editor/options/Bundle.properties" key="CodeCompletionPanel.javaCompletionExcludeTable.columnModel.title0" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
129
                          </Title>
130
                          <Editor/>
131
                          <Renderer/>
132
                        </Column>
133
                      </TableColumnModel>
134
                    </Property>
135
                    <Property name="tableHeader" type="javax.swing.table.JTableHeader" editor="org.netbeans.modules.form.editors2.JTableHeaderEditor">
136
                      <TableHeader reorderingAllowed="false" resizingAllowed="true"/>
137
                    </Property>
138
                  </Properties>
139
                </Component>
140
              </SubComponents>
141
            </Container>
142
          </SubComponents>
143
        </Container>
144
        <Component class="javax.swing.JButton" name="javaCompletionExcluderAddButton">
145
          <Properties>
146
            <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
147
              <ResourceString bundle="org/netbeans/modules/java/editor/options/Bundle.properties" key="CodeCompletionPanel.javaCompletionExcluderAddButton.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
148
            </Property>
149
          </Properties>
150
          <Events>
151
            <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="javaCompletionExcluderAddButtonActionPerformed"/>
152
          </Events>
153
        </Component>
154
        <Component class="javax.swing.JButton" name="javaCompletionExcluderRemoveButton">
155
          <Properties>
156
            <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
157
              <ResourceString bundle="org/netbeans/modules/java/editor/options/Bundle.properties" key="CodeCompletionPanel.javaCompletionExcluderRemoveButton.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
158
            </Property>
159
          </Properties>
160
          <Events>
161
            <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="javaCompletionExcluderRemoveButtonActionPerformed"/>
162
          </Events>
163
        </Component>
164
        <Component class="javax.swing.JButton" name="javaCompletionExcluderCloseButton">
165
          <Properties>
166
            <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
167
              <ResourceString bundle="org/netbeans/modules/java/editor/options/Bundle.properties" key="CodeCompletionPanel.javaCompletionExcluderCloseButton.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
168
            </Property>
169
          </Properties>
170
          <Events>
171
            <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="javaCompletionExcluderCloseButtonActionPerformed"/>
172
          </Events>
173
        </Component>
174
      </SubComponents>
175
    </Container>
176
  </NonVisualComponents>
4
  <Properties>
177
  <Properties>
5
    <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
178
    <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
6
      <Border info="org.netbeans.modules.form.compat2.border.EmptyBorderInfo">
179
      <Border info="org.netbeans.modules.form.compat2.border.EmptyBorderInfo">
Lines 23-155 Link Here
23
  <Layout>
196
  <Layout>
24
    <DimensionLayout dim="0">
197
    <DimensionLayout dim="0">
25
      <Group type="103" groupAlignment="0" attributes="0">
198
      <Group type="103" groupAlignment="0" attributes="0">
26
          <Group type="102" attributes="0">
199
          <Component id="javaCompletionPane" alignment="0" max="32767" attributes="0"/>
27
              <EmptySpace max="-2" attributes="0"/>
28
              <Group type="103" groupAlignment="0" attributes="0">
29
                  <Component id="jSeparator1" alignment="0" pref="362" max="32767" attributes="0"/>
30
                  <Component id="guessMethodArguments" min="-2" max="-2" attributes="0"/>
31
                  <Group type="102" alignment="0" attributes="0">
32
                      <Component id="javaAutoCompletionTriggersLabel" min="-2" max="-2" attributes="1"/>
33
                      <EmptySpace min="-2" pref="34" max="-2" attributes="0"/>
34
                      <Component id="javaAutoCompletionTriggersField" min="-2" pref="86" max="-2" attributes="1"/>
35
                  </Group>
36
                  <Component id="javaAutoPopupOnIdentifierPart" alignment="0" min="-2" max="-2" attributes="1"/>
37
                  <Group type="102" alignment="0" attributes="0">
38
                      <Component id="javaCompletionSelectorsLabel" min="-2" max="-2" attributes="1"/>
39
                      <EmptySpace min="-2" pref="30" max="-2" attributes="0"/>
40
                      <Component id="javaCompletionSelectorsField" min="-2" pref="86" max="-2" attributes="1"/>
41
                  </Group>
42
                  <Group type="102" alignment="0" attributes="0">
43
                      <Component id="javadocAutoCompletionTriggersLabel" min="-2" max="-2" attributes="0"/>
44
                      <EmptySpace max="-2" attributes="0"/>
45
                      <Component id="javadocAutoCompletionTriggersField" min="-2" pref="86" max="-2" attributes="1"/>
46
                  </Group>
47
              </Group>
48
              <EmptySpace max="-2" attributes="0"/>
49
          </Group>
50
      </Group>
200
      </Group>
51
    </DimensionLayout>
201
    </DimensionLayout>
52
    <DimensionLayout dim="1">
202
    <DimensionLayout dim="1">
53
      <Group type="103" groupAlignment="0" attributes="0">
203
      <Group type="103" groupAlignment="0" attributes="0">
54
          <Group type="102" attributes="0">
204
          <Component id="javaCompletionPane" alignment="0" max="32767" attributes="0"/>
55
              <EmptySpace max="-2" attributes="0"/>
56
              <Component id="guessMethodArguments" min="-2" max="-2" attributes="0"/>
57
              <EmptySpace max="-2" attributes="0"/>
58
              <Group type="103" groupAlignment="3" attributes="0">
59
                  <Component id="javaAutoCompletionTriggersLabel" alignment="3" min="-2" max="-2" attributes="0"/>
60
                  <Component id="javaAutoCompletionTriggersField" alignment="3" min="-2" max="-2" attributes="0"/>
61
              </Group>
62
              <EmptySpace max="-2" attributes="0"/>
63
              <Component id="javaAutoPopupOnIdentifierPart" min="-2" max="-2" attributes="0"/>
64
              <EmptySpace max="-2" attributes="0"/>
65
              <Group type="103" groupAlignment="3" attributes="0">
66
                  <Component id="javaCompletionSelectorsLabel" alignment="3" min="-2" max="-2" attributes="0"/>
67
                  <Component id="javaCompletionSelectorsField" alignment="3" min="-2" max="-2" attributes="0"/>
68
              </Group>
69
              <EmptySpace type="separate" max="-2" attributes="0"/>
70
              <Component id="jSeparator1" min="-2" max="-2" attributes="0"/>
71
              <EmptySpace type="separate" max="-2" attributes="0"/>
72
              <Group type="103" groupAlignment="3" attributes="0">
73
                  <Component id="javadocAutoCompletionTriggersLabel" alignment="3" min="-2" max="-2" attributes="0"/>
74
                  <Component id="javadocAutoCompletionTriggersField" alignment="3" min="-2" max="-2" attributes="0"/>
75
              </Group>
76
              <EmptySpace pref="30" max="32767" attributes="0"/>
77
          </Group>
78
      </Group>
205
      </Group>
79
    </DimensionLayout>
206
    </DimensionLayout>
80
  </Layout>
207
  </Layout>
81
  <SubComponents>
208
  <SubComponents>
82
    <Component class="javax.swing.JCheckBox" name="guessMethodArguments">
209
    <Container class="javax.swing.JPanel" name="javaCompletionPane">
83
      <Properties>
210
84
        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
211
      <Layout>
85
          <ResourceString bundle="org/netbeans/modules/java/editor/options/Bundle.properties" key="LBL_GuessMethodArgs" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
212
        <DimensionLayout dim="0">
86
        </Property>
213
          <Group type="103" groupAlignment="0" attributes="0">
87
        <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
214
              <Group type="102" attributes="0">
88
          <Border info="null"/>
215
                  <EmptySpace max="-2" attributes="0"/>
89
        </Property>
216
                  <Group type="103" groupAlignment="0" attributes="0">
90
      </Properties>
217
                      <Component id="jSeparator1" pref="511" max="32767" attributes="0"/>
91
      <Events>
218
                      <Group type="102" alignment="0" attributes="0">
92
        <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="guessMethodArgumentsActionPerformed"/>
219
                          <Component id="javadocAutoCompletionTriggersLabel" min="-2" max="-2" attributes="0"/>
93
      </Events>
220
                          <EmptySpace max="-2" attributes="0"/>
94
    </Component>
221
                          <Component id="javadocAutoCompletionTriggersField" min="-2" pref="86" max="-2" attributes="1"/>
95
    <Component class="javax.swing.JCheckBox" name="javaAutoPopupOnIdentifierPart">
222
                      </Group>
96
      <Properties>
223
                  </Group>
97
        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
224
                  <EmptySpace max="-2" attributes="0"/>
98
          <ResourceString bundle="org/netbeans/modules/java/editor/options/Bundle.properties" key="LBL_AutoPopupOnIdentifierPartBox" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
225
              </Group>
99
        </Property>
226
              <Group type="103" rootIndex="1" groupAlignment="0" attributes="0">
100
        <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
227
                  <Group type="102" alignment="0" attributes="0">
101
          <Border info="null"/>
228
                      <EmptySpace max="-2" attributes="0"/>
102
        </Property>
229
                      <Group type="103" groupAlignment="0" attributes="0">
103
      </Properties>
230
                          <Component id="guessMethodArguments" alignment="0" min="-2" max="-2" attributes="0"/>
104
      <Events>
231
                          <Group type="102" alignment="0" attributes="0">
105
        <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="javaAutoPopupOnIdentifierPartActionPerformed"/>
232
                              <Component id="javaAutoCompletionTriggersLabel" min="-2" max="-2" attributes="1"/>
106
      </Events>
233
                              <EmptySpace min="-2" pref="34" max="-2" attributes="0"/>
107
    </Component>
234
                              <Component id="javaAutoCompletionTriggersField" min="-2" pref="86" max="-2" attributes="1"/>
108
    <Component class="javax.swing.JLabel" name="javaAutoCompletionTriggersLabel">
235
                          </Group>
109
      <Properties>
236
                          <Component id="javaAutoPopupOnIdentifierPart" alignment="0" min="-2" max="-2" attributes="1"/>
110
        <Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor">
237
                          <Group type="102" alignment="0" attributes="0">
111
          <ComponentRef name="javaAutoCompletionTriggersField"/>
238
                              <Group type="103" groupAlignment="1" attributes="0">
112
        </Property>
239
                                  <Component id="javaCompletionExcluderLabel" alignment="1" min="-2" max="-2" attributes="0"/>
113
        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
240
                                  <Component id="javaCompletionSelectorsLabel" alignment="1" min="-2" max="-2" attributes="1"/>
114
          <ResourceString bundle="org/netbeans/modules/java/editor/options/Bundle.properties" key="LBL_JavaAutoCompletionTriggers" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
241
                              </Group>
115
        </Property>
242
                              <Group type="103" groupAlignment="0" attributes="0">
116
      </Properties>
243
                                  <Group type="102" attributes="0">
117
    </Component>
244
                                      <EmptySpace min="-2" pref="30" max="-2" attributes="0"/>
118
    <Component class="javax.swing.JTextField" name="javaAutoCompletionTriggersField">
245
                                      <Component id="javaCompletionSelectorsField" min="-2" pref="86" max="-2" attributes="1"/>
119
      <Properties>
246
                                  </Group>
120
        <Property name="alignmentX" type="float" value="1.0"/>
247
                                  <Group type="102" alignment="1" attributes="0">
121
      </Properties>
248
                                      <EmptySpace min="-2" pref="23" max="-2" attributes="0"/>
122
    </Component>
249
                                      <Component id="javaCompletionExcluderButton" min="-2" pref="93" max="-2" attributes="0"/>
123
    <Component class="javax.swing.JLabel" name="javaCompletionSelectorsLabel">
250
                                  </Group>
124
      <Properties>
251
                              </Group>
125
        <Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor">
252
                          </Group>
126
          <ComponentRef name="javaCompletionSelectorsField"/>
253
                      </Group>
127
        </Property>
254
                      <EmptySpace pref="199" max="32767" attributes="0"/>
128
        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
255
                  </Group>
129
          <ResourceString bundle="org/netbeans/modules/java/editor/options/Bundle.properties" key="LBL_JavaCompletionSelectors" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
256
              </Group>
130
        </Property>
257
          </Group>
131
      </Properties>
258
        </DimensionLayout>
132
    </Component>
259
        <DimensionLayout dim="1">
133
    <Component class="javax.swing.JTextField" name="javaCompletionSelectorsField">
260
          <Group type="103" groupAlignment="0" attributes="0">
134
    </Component>
261
              <Group type="102" alignment="0" attributes="0">
135
    <Component class="javax.swing.JLabel" name="javadocAutoCompletionTriggersLabel">
262
                  <EmptySpace min="-2" pref="171" max="-2" attributes="0"/>
136
      <Properties>
263
                  <Component id="jSeparator1" min="-2" max="-2" attributes="0"/>
137
        <Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor">
264
                  <EmptySpace type="separate" max="-2" attributes="0"/>
138
          <ComponentRef name="javadocAutoCompletionTriggersField"/>
265
                  <Group type="103" groupAlignment="3" attributes="0">
139
        </Property>
266
                      <Component id="javadocAutoCompletionTriggersLabel" alignment="3" min="-2" max="-2" attributes="0"/>
140
        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
267
                      <Component id="javadocAutoCompletionTriggersField" alignment="3" min="-2" max="-2" attributes="0"/>
141
          <ResourceString bundle="org/netbeans/modules/java/editor/options/Bundle.properties" key="LBL_JavadocAutoCompletionTriggers" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
268
                  </Group>
142
        </Property>
269
                  <EmptySpace pref="23" max="32767" attributes="0"/>
143
      </Properties>
270
              </Group>
144
    </Component>
271
              <Group type="103" rootIndex="1" groupAlignment="0" attributes="0">
145
    <Component class="javax.swing.JTextField" name="javadocAutoCompletionTriggersField">
272
                  <Group type="102" alignment="0" attributes="0">
146
      <Properties>
273
                      <EmptySpace max="-2" attributes="0"/>
147
        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
274
                      <Component id="guessMethodArguments" min="-2" pref="23" max="-2" attributes="0"/>
148
          <ResourceString bundle="org/netbeans/modules/java/editor/options/Bundle.properties" key="CodeCompletionPanel.javadocAutoCompletionTriggersField.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
275
                      <EmptySpace max="-2" attributes="0"/>
149
        </Property>
276
                      <Group type="103" groupAlignment="3" attributes="0">
150
      </Properties>
277
                          <Component id="javaAutoCompletionTriggersLabel" alignment="3" min="-2" max="-2" attributes="0"/>
151
    </Component>
278
                          <Component id="javaAutoCompletionTriggersField" alignment="3" min="-2" max="-2" attributes="0"/>
152
    <Component class="javax.swing.JSeparator" name="jSeparator1">
279
                      </Group>
153
    </Component>
280
                      <EmptySpace max="-2" attributes="0"/>
281
                      <Component id="javaAutoPopupOnIdentifierPart" min="-2" max="-2" attributes="0"/>
282
                      <EmptySpace max="-2" attributes="0"/>
283
                      <Group type="103" groupAlignment="3" attributes="0">
284
                          <Component id="javaCompletionSelectorsLabel" alignment="3" min="-2" max="-2" attributes="0"/>
285
                          <Component id="javaCompletionSelectorsField" alignment="3" min="-2" max="-2" attributes="0"/>
286
                      </Group>
287
                      <EmptySpace max="-2" attributes="0"/>
288
                      <Group type="103" groupAlignment="3" attributes="0">
289
                          <Component id="javaCompletionExcluderButton" alignment="3" min="-2" max="-2" attributes="0"/>
290
                          <Component id="javaCompletionExcluderLabel" alignment="3" min="-2" max="-2" attributes="0"/>
291
                      </Group>
292
                      <EmptySpace pref="91" max="32767" attributes="0"/>
293
                  </Group>
294
              </Group>
295
          </Group>
296
        </DimensionLayout>
297
      </Layout>
298
      <SubComponents>
299
        <Component class="javax.swing.JCheckBox" name="guessMethodArguments">
300
          <Properties>
301
            <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
302
              <ResourceString bundle="org/netbeans/modules/java/editor/options/Bundle.properties" key="LBL_GuessMethodArgs" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
303
            </Property>
304
          </Properties>
305
          <Events>
306
            <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="guessMethodArgumentsActionPerformed"/>
307
          </Events>
308
        </Component>
309
        <Component class="javax.swing.JCheckBox" name="javaAutoPopupOnIdentifierPart">
310
          <Properties>
311
            <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
312
              <ResourceString bundle="org/netbeans/modules/java/editor/options/Bundle.properties" key="LBL_AutoPopupOnIdentifierPartBox" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
313
            </Property>
314
          </Properties>
315
          <Events>
316
            <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="javaAutoPopupOnIdentifierPartActionPerformed"/>
317
          </Events>
318
        </Component>
319
        <Component class="javax.swing.JLabel" name="javaAutoCompletionTriggersLabel">
320
          <Properties>
321
            <Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor">
322
              <ComponentRef name="javaAutoCompletionTriggersField"/>
323
            </Property>
324
            <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
325
              <ResourceString bundle="org/netbeans/modules/java/editor/options/Bundle.properties" key="LBL_JavaAutoCompletionTriggers" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
326
            </Property>
327
          </Properties>
328
        </Component>
329
        <Component class="javax.swing.JTextField" name="javaAutoCompletionTriggersField">
330
          <Properties>
331
            <Property name="alignmentX" type="float" value="1.0"/>
332
          </Properties>
333
        </Component>
334
        <Component class="javax.swing.JLabel" name="javaCompletionSelectorsLabel">
335
          <Properties>
336
            <Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor">
337
              <ComponentRef name="javaCompletionSelectorsField"/>
338
            </Property>
339
            <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
340
              <ResourceString bundle="org/netbeans/modules/java/editor/options/Bundle.properties" key="LBL_JavaCompletionSelectors" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
341
            </Property>
342
          </Properties>
343
        </Component>
344
        <Component class="javax.swing.JTextField" name="javaCompletionSelectorsField">
345
        </Component>
346
        <Component class="javax.swing.JLabel" name="javadocAutoCompletionTriggersLabel">
347
          <Properties>
348
            <Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor">
349
              <ComponentRef name="javadocAutoCompletionTriggersField"/>
350
            </Property>
351
            <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
352
              <ResourceString bundle="org/netbeans/modules/java/editor/options/Bundle.properties" key="LBL_JavadocAutoCompletionTriggers" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
353
            </Property>
354
          </Properties>
355
        </Component>
356
        <Component class="javax.swing.JTextField" name="javadocAutoCompletionTriggersField">
357
          <Properties>
358
            <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
359
              <ResourceString bundle="org/netbeans/modules/java/editor/options/Bundle.properties" key="CodeCompletionPanel.javadocAutoCompletionTriggersField.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
360
            </Property>
361
          </Properties>
362
        </Component>
363
        <Component class="javax.swing.JSeparator" name="jSeparator1">
364
        </Component>
365
        <Component class="javax.swing.JLabel" name="javaCompletionExcluderLabel">
366
          <Properties>
367
            <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
368
              <ResourceString bundle="org/netbeans/modules/java/editor/options/Bundle.properties" key="CodeCompletionPanel.javaCompletionExcluderLabel.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
369
            </Property>
370
          </Properties>
371
        </Component>
372
        <Component class="javax.swing.JButton" name="javaCompletionExcluderButton">
373
          <Properties>
374
            <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
375
              <ResourceString bundle="org/netbeans/modules/java/editor/options/Bundle.properties" key="CodeCompletionPanel.javaCompletionExcluderButton.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
376
            </Property>
377
          </Properties>
378
          <Events>
379
            <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="javaCompletionExcluderButtonActionPerformed"/>
380
          </Events>
381
        </Component>
382
      </SubComponents>
383
    </Container>
154
  </SubComponents>
384
  </SubComponents>
155
</Form>
385
</Form>
(-)a/java.editor/src/org/netbeans/modules/java/editor/options/CodeCompletionPanel.java (-39 / +321 lines)
Lines 38-50 Link Here
38
 * Version 2 license, then the option applies only if the new code is
38
 * Version 2 license, then the option applies only if the new code is
39
 * made subject to such option by the copyright holder.
39
 * made subject to such option by the copyright holder.
40
 */
40
 */
41
42
package org.netbeans.modules.java.editor.options;
41
package org.netbeans.modules.java.editor.options;
43
42
43
import java.awt.Component;
44
import java.util.Arrays;
45
import java.util.Collection;
46
import java.util.TreeSet;
47
import java.util.Vector;
44
import java.util.prefs.Preferences;
48
import java.util.prefs.Preferences;
45
import javax.swing.JComponent;
49
import javax.swing.JComponent;
50
import javax.swing.JTable;
46
import javax.swing.event.DocumentEvent;
51
import javax.swing.event.DocumentEvent;
47
import javax.swing.event.DocumentListener;
52
import javax.swing.event.DocumentListener;
53
import javax.swing.event.TableModelEvent;
54
import javax.swing.event.TableModelListener;
55
import javax.swing.table.DefaultTableModel;
48
import org.netbeans.modules.options.editor.spi.PreferencesCustomizer;
56
import org.netbeans.modules.options.editor.spi.PreferencesCustomizer;
49
import org.openide.util.HelpCtx;
57
import org.openide.util.HelpCtx;
50
58
Lines 52-76 Link Here
52
 *
60
 *
53
 * @author Dusan Balek
61
 * @author Dusan Balek
54
 */
62
 */
55
public class CodeCompletionPanel extends javax.swing.JPanel implements DocumentListener {
63
public class CodeCompletionPanel extends javax.swing.JPanel implements DocumentListener, TableModelListener {
56
64
57
    public static final String JAVA_AUTO_POPUP_ON_IDENTIFIER_PART = "javaAutoPopupOnIdentifierPart"; //NOI18N
65
    public static final String JAVA_AUTO_POPUP_ON_IDENTIFIER_PART = "javaAutoPopupOnIdentifierPart"; //NOI18N
66
    public static final boolean JAVA_AUTO_POPUP_ON_IDENTIFIER_PART_DEFAULT = false;
58
    public static final String JAVA_AUTO_COMPLETION_TRIGGERS = "javaAutoCompletionTriggers"; //NOI18N
67
    public static final String JAVA_AUTO_COMPLETION_TRIGGERS = "javaAutoCompletionTriggers"; //NOI18N
68
    public static final String JAVA_AUTO_COMPLETION_TRIGGERS_DEFAULT = "."; //NOI18N
59
    public static final String JAVA_COMPLETION_SELECTORS = "javaCompletionSelectors"; //NOI18N
69
    public static final String JAVA_COMPLETION_SELECTORS = "javaCompletionSelectors"; //NOI18N
70
    public static final String JAVA_COMPLETION_SELECTORS_DEFAULT = ".,;:([+-="; //NOI18N
60
    public static final String JAVADOC_AUTO_COMPLETION_TRIGGERS = "javadocAutoCompletionTriggers"; //NOI18N
71
    public static final String JAVADOC_AUTO_COMPLETION_TRIGGERS = "javadocAutoCompletionTriggers"; //NOI18N
72
    public static final String JAVADOC_AUTO_COMPLETION_TRIGGERS_DEFAULT = ".#@"; //NOI18N
61
    public static final String GUESS_METHOD_ARGUMENTS = "guessMethodArguments"; //NOI18N
73
    public static final String GUESS_METHOD_ARGUMENTS = "guessMethodArguments"; //NOI18N
74
    public static final boolean GUESS_METHOD_ARGUMENTS_DEFAULT = true;
75
    public static final String JAVA_COMPLETION_WHITELIST = "javaCompletionWhitelist"; //NOI18N
76
    public static final String JAVA_COMPLETION_WHITELIST_DEFAULT = ""; //NOI18N
77
    public static final String JAVA_COMPLETION_BLACKLIST = "javaCompletionBlacklist"; //NOI18N
78
    public static final String JAVA_COMPLETION_BLACKLIST_DEFAULT = ""; //NOI18N
62
79
63
    private Preferences preferences;
80
    private final Preferences preferences;
81
82
    private void initExcluderTable(JTable table, String pref) {
83
        String[] entries = pref.split(","); //NOI18N
84
        DefaultTableModel model = (DefaultTableModel) table.getModel();
85
        for (String entry : entries) {
86
            if (entry.length() > 0) {
87
                model.addRow(new String[]{entry});
88
            }
89
        }
90
        model.addTableModelListener(this);
91
    }
64
92
65
    /** Creates new form FmtTabsIndents */
93
    /** Creates new form FmtTabsIndents */
66
    public CodeCompletionPanel(Preferences p) {
94
    public CodeCompletionPanel(Preferences p) {
67
        initComponents();
95
        initComponents();
68
        preferences = p;
96
        preferences = p;
69
        guessMethodArguments.setSelected(preferences.getBoolean(GUESS_METHOD_ARGUMENTS, true));
97
        guessMethodArguments.setSelected(preferences.getBoolean(GUESS_METHOD_ARGUMENTS, GUESS_METHOD_ARGUMENTS_DEFAULT));
70
        javaAutoPopupOnIdentifierPart.setSelected(preferences.getBoolean(JAVA_AUTO_POPUP_ON_IDENTIFIER_PART, false));
98
        javaAutoPopupOnIdentifierPart.setSelected(preferences.getBoolean(JAVA_AUTO_POPUP_ON_IDENTIFIER_PART, JAVA_AUTO_POPUP_ON_IDENTIFIER_PART_DEFAULT));
71
        javaAutoCompletionTriggersField.setText(preferences.get(JAVA_AUTO_COMPLETION_TRIGGERS, ".")); //NOI18N
99
        javaAutoCompletionTriggersField.setText(preferences.get(JAVA_AUTO_COMPLETION_TRIGGERS, JAVA_AUTO_COMPLETION_TRIGGERS_DEFAULT));
72
        javaCompletionSelectorsField.setText(preferences.get(JAVA_COMPLETION_SELECTORS, ".,;:([+-=")); //NOI18N
100
        javaCompletionSelectorsField.setText(preferences.get(JAVA_COMPLETION_SELECTORS, JAVA_COMPLETION_SELECTORS_DEFAULT));
73
        javadocAutoCompletionTriggersField.setText(preferences.get(JAVADOC_AUTO_COMPLETION_TRIGGERS, ".#@")); //NOI18N
101
        javadocAutoCompletionTriggersField.setText(preferences.get(JAVADOC_AUTO_COMPLETION_TRIGGERS, JAVADOC_AUTO_COMPLETION_TRIGGERS_DEFAULT));
102
        String blacklist = preferences.get(JAVA_COMPLETION_BLACKLIST, JAVA_COMPLETION_BLACKLIST_DEFAULT);
103
        initExcluderTable(javaCompletionExcludeTable, blacklist);
104
        String whitelist = preferences.get(JAVA_COMPLETION_WHITELIST, JAVA_COMPLETION_WHITELIST_DEFAULT);
105
        initExcluderTable(javaCompletionIncludeTable, whitelist);
74
        javaAutoCompletionTriggersField.getDocument().addDocumentListener(this);
106
        javaAutoCompletionTriggersField.getDocument().addDocumentListener(this);
75
        javaCompletionSelectorsField.getDocument().addDocumentListener(this);
107
        javaCompletionSelectorsField.getDocument().addDocumentListener(this);
76
        javadocAutoCompletionTriggersField.getDocument().addDocumentListener(this);
108
        javadocAutoCompletionTriggersField.getDocument().addDocumentListener(this);
Lines 97-102 Link Here
97
        update(e);
129
        update(e);
98
    }
130
    }
99
131
132
    // allows common excluder buttons to know which table to act on
133
    private JTable getSelectedExcluderTable() {
134
        Component selected = javaCompletionExcluderTab.getSelectedComponent();
135
        if (selected == javaCompletionExcludeScrollPane) {
136
            return javaCompletionExcludeTable;
137
        } else if (selected == javaCompletionIncludeScrollPane) {
138
            return javaCompletionIncludeTable;
139
        } else {
140
            throw new RuntimeException(selected.getName());
141
        }
142
    }
143
144
    // listen to changes in the excluder lists, and do sanity checking on input
145
    public void tableChanged(TableModelEvent e) {
146
        DefaultTableModel model = (DefaultTableModel) e.getSource();
147
        String pref;
148
        if (model == javaCompletionExcludeTable.getModel()) {
149
            pref = JAVA_COMPLETION_BLACKLIST;
150
        } else if (model == javaCompletionIncludeTable.getModel()) {
151
            pref = JAVA_COMPLETION_WHITELIST;
152
        } else {
153
            throw new RuntimeException();
154
        }
155
        @SuppressWarnings("unchecked")
156
        Vector<Vector<String>> data = model.getDataVector();
157
        Collection<String> entries = new TreeSet<String>();
158
        for (Vector<String> row : data) {
159
            String entry = row.elementAt(0);
160
            if (entry == null) {
161
                continue;
162
            }
163
            // users can enter wildcards, which is the same as the raw prefix
164
            if (entry.contains("*"))
165
                entry = entry.replaceAll("\\*", "");
166
            entry = entry.trim();
167
            if (entry.length() == 0) {
168
                continue;
169
            }
170
            // this could be checked by a custom editor on input
171
            if (!entry.matches("[$\\w._]*")) { //NOI18N
172
                continue;
173
            }
174
            entries.add(entry);
175
        }
176
        StringBuilder builder = new StringBuilder();
177
        for (String entry : entries) {
178
            if (builder.length() > 0) {
179
                builder.append(","); //NOI18N
180
            }
181
            builder.append(entry);
182
        }
183
        preferences.put(pref, builder.toString());
184
    }
185
100
    /** This method is called from within the constructor to
186
    /** This method is called from within the constructor to
101
     * initialize the form.
187
     * initialize the form.
102
     * WARNING: Do NOT modify this code. The content of this method is
188
     * WARNING: Do NOT modify this code. The content of this method is
Lines 105-110 Link Here
105
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
191
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
106
    private void initComponents() {
192
    private void initComponents() {
107
193
194
        javaCompletionExcluderFrame = new javax.swing.JFrame();
195
        javaCompletionExcluderTab = new javax.swing.JTabbedPane();
196
        javaCompletionExcludeScrollPane = new javax.swing.JScrollPane();
197
        javaCompletionExcludeTable = new javax.swing.JTable();
198
        javaCompletionIncludeScrollPane = new javax.swing.JScrollPane();
199
        javaCompletionIncludeTable = new javax.swing.JTable();
200
        javaCompletionExcluderAddButton = new javax.swing.JButton();
201
        javaCompletionExcluderRemoveButton = new javax.swing.JButton();
202
        javaCompletionExcluderCloseButton = new javax.swing.JButton();
203
        javaCompletionPane = new javax.swing.JPanel();
108
        guessMethodArguments = new javax.swing.JCheckBox();
204
        guessMethodArguments = new javax.swing.JCheckBox();
109
        javaAutoPopupOnIdentifierPart = new javax.swing.JCheckBox();
205
        javaAutoPopupOnIdentifierPart = new javax.swing.JCheckBox();
110
        javaAutoCompletionTriggersLabel = new javax.swing.JLabel();
206
        javaAutoCompletionTriggersLabel = new javax.swing.JLabel();
Lines 114-124 Link Here
114
        javadocAutoCompletionTriggersLabel = new javax.swing.JLabel();
210
        javadocAutoCompletionTriggersLabel = new javax.swing.JLabel();
115
        javadocAutoCompletionTriggersField = new javax.swing.JTextField();
211
        javadocAutoCompletionTriggersField = new javax.swing.JTextField();
116
        jSeparator1 = new javax.swing.JSeparator();
212
        jSeparator1 = new javax.swing.JSeparator();
213
        javaCompletionExcluderLabel = new javax.swing.JLabel();
214
        javaCompletionExcluderButton = new javax.swing.JButton();
215
216
        javaCompletionExcluderFrame.setTitle(org.openide.util.NbBundle.getMessage(CodeCompletionPanel.class, "CodeCompletionPanel.javaCompletionExcluderFrame.title")); // NOI18N
217
        javaCompletionExcluderFrame.setAlwaysOnTop(true);
218
        javaCompletionExcluderFrame.setMinimumSize(new java.awt.Dimension(409, 233));
219
        javaCompletionExcluderFrame.setUndecorated(true);
220
221
        javaCompletionExcludeTable.setModel(new javax.swing.table.DefaultTableModel(
222
            new Object [][] {
223
224
            },
225
            new String [] {
226
                "Fully Qualified Name prefix"
227
            }
228
        ) {
229
            Class[] types = new Class [] {
230
                java.lang.String.class
231
            };
232
233
            public Class getColumnClass(int columnIndex) {
234
                return types [columnIndex];
235
            }
236
        });
237
        javaCompletionExcludeTable.getTableHeader().setReorderingAllowed(false);
238
        javaCompletionExcludeScrollPane.setViewportView(javaCompletionExcludeTable);
239
        javaCompletionExcludeTable.getColumnModel().getColumn(0).setHeaderValue(org.openide.util.NbBundle.getMessage(CodeCompletionPanel.class, "CodeCompletionPanel.javaCompletionExcludeTable.columnModel.title0")); // NOI18N
240
241
        javaCompletionExcluderTab.addTab(org.openide.util.NbBundle.getMessage(CodeCompletionPanel.class, "CodeCompletionPanel.javaCompletionExcludeScrollPane.TabConstraints.tabTitle"), javaCompletionExcludeScrollPane); // NOI18N
242
243
        javaCompletionIncludeTable.setModel(new javax.swing.table.DefaultTableModel(
244
            new Object [][] {
245
246
            },
247
            new String [] {
248
                "Fully Qualified Name prefix"
249
            }
250
        ) {
251
            Class[] types = new Class [] {
252
                java.lang.String.class
253
            };
254
255
            public Class getColumnClass(int columnIndex) {
256
                return types [columnIndex];
257
            }
258
        });
259
        javaCompletionIncludeTable.getTableHeader().setReorderingAllowed(false);
260
        javaCompletionIncludeScrollPane.setViewportView(javaCompletionIncludeTable);
261
        javaCompletionIncludeTable.getColumnModel().getColumn(0).setHeaderValue(org.openide.util.NbBundle.getMessage(CodeCompletionPanel.class, "CodeCompletionPanel.javaCompletionExcludeTable.columnModel.title0")); // NOI18N
262
263
        javaCompletionExcluderTab.addTab(org.openide.util.NbBundle.getMessage(CodeCompletionPanel.class, "CodeCompletionPanel.javaCompletionIncludeScrollPane.TabConstraints.tabTitle"), javaCompletionIncludeScrollPane); // NOI18N
264
265
        org.openide.awt.Mnemonics.setLocalizedText(javaCompletionExcluderAddButton, org.openide.util.NbBundle.getMessage(CodeCompletionPanel.class, "CodeCompletionPanel.javaCompletionExcluderAddButton.text")); // NOI18N
266
        javaCompletionExcluderAddButton.addActionListener(new java.awt.event.ActionListener() {
267
            public void actionPerformed(java.awt.event.ActionEvent evt) {
268
                javaCompletionExcluderAddButtonActionPerformed(evt);
269
            }
270
        });
271
272
        org.openide.awt.Mnemonics.setLocalizedText(javaCompletionExcluderRemoveButton, org.openide.util.NbBundle.getMessage(CodeCompletionPanel.class, "CodeCompletionPanel.javaCompletionExcluderRemoveButton.text")); // NOI18N
273
        javaCompletionExcluderRemoveButton.addActionListener(new java.awt.event.ActionListener() {
274
            public void actionPerformed(java.awt.event.ActionEvent evt) {
275
                javaCompletionExcluderRemoveButtonActionPerformed(evt);
276
            }
277
        });
278
279
        org.openide.awt.Mnemonics.setLocalizedText(javaCompletionExcluderCloseButton, org.openide.util.NbBundle.getMessage(CodeCompletionPanel.class, "CodeCompletionPanel.javaCompletionExcluderCloseButton.text")); // NOI18N
280
        javaCompletionExcluderCloseButton.addActionListener(new java.awt.event.ActionListener() {
281
            public void actionPerformed(java.awt.event.ActionEvent evt) {
282
                javaCompletionExcluderCloseButtonActionPerformed(evt);
283
            }
284
        });
285
286
        org.jdesktop.layout.GroupLayout javaCompletionExcluderFrameLayout = new org.jdesktop.layout.GroupLayout(javaCompletionExcluderFrame.getContentPane());
287
        javaCompletionExcluderFrame.getContentPane().setLayout(javaCompletionExcluderFrameLayout);
288
        javaCompletionExcluderFrameLayout.setHorizontalGroup(
289
            javaCompletionExcluderFrameLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
290
            .add(org.jdesktop.layout.GroupLayout.TRAILING, javaCompletionExcluderFrameLayout.createSequentialGroup()
291
                .addContainerGap()
292
                .add(javaCompletionExcluderTab, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 298, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
293
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
294
                .add(javaCompletionExcluderFrameLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
295
                    .add(javaCompletionExcluderCloseButton, 0, 0, Short.MAX_VALUE)
296
                    .add(javaCompletionExcluderRemoveButton, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
297
                    .add(javaCompletionExcluderAddButton, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
298
                .addContainerGap(10, Short.MAX_VALUE))
299
        );
300
        javaCompletionExcluderFrameLayout.setVerticalGroup(
301
            javaCompletionExcluderFrameLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
302
            .add(javaCompletionExcluderFrameLayout.createSequentialGroup()
303
                .add(javaCompletionExcluderFrameLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
304
                    .add(javaCompletionExcluderFrameLayout.createSequentialGroup()
305
                        .addContainerGap()
306
                        .add(javaCompletionExcluderTab, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 221, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
307
                    .add(javaCompletionExcluderFrameLayout.createSequentialGroup()
308
                        .add(59, 59, 59)
309
                        .add(javaCompletionExcluderAddButton)
310
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
311
                        .add(javaCompletionExcluderRemoveButton)
312
                        .add(63, 63, 63)
313
                        .add(javaCompletionExcluderCloseButton)))
314
                .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
315
        );
117
316
118
        setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
317
        setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
119
318
120
        org.openide.awt.Mnemonics.setLocalizedText(guessMethodArguments, org.openide.util.NbBundle.getMessage(CodeCompletionPanel.class, "LBL_GuessMethodArgs")); // NOI18N
319
        org.openide.awt.Mnemonics.setLocalizedText(guessMethodArguments, org.openide.util.NbBundle.getMessage(CodeCompletionPanel.class, "LBL_GuessMethodArgs")); // NOI18N
121
        guessMethodArguments.setBorder(null);
122
        guessMethodArguments.addActionListener(new java.awt.event.ActionListener() {
320
        guessMethodArguments.addActionListener(new java.awt.event.ActionListener() {
123
            public void actionPerformed(java.awt.event.ActionEvent evt) {
321
            public void actionPerformed(java.awt.event.ActionEvent evt) {
124
                guessMethodArgumentsActionPerformed(evt);
322
                guessMethodArgumentsActionPerformed(evt);
Lines 126-132 Link Here
126
        });
324
        });
127
325
128
        org.openide.awt.Mnemonics.setLocalizedText(javaAutoPopupOnIdentifierPart, org.openide.util.NbBundle.getMessage(CodeCompletionPanel.class, "LBL_AutoPopupOnIdentifierPartBox")); // NOI18N
326
        org.openide.awt.Mnemonics.setLocalizedText(javaAutoPopupOnIdentifierPart, org.openide.util.NbBundle.getMessage(CodeCompletionPanel.class, "LBL_AutoPopupOnIdentifierPartBox")); // NOI18N
129
        javaAutoPopupOnIdentifierPart.setBorder(null);
130
        javaAutoPopupOnIdentifierPart.addActionListener(new java.awt.event.ActionListener() {
327
        javaAutoPopupOnIdentifierPart.addActionListener(new java.awt.event.ActionListener() {
131
            public void actionPerformed(java.awt.event.ActionEvent evt) {
328
            public void actionPerformed(java.awt.event.ActionEvent evt) {
132
                javaAutoPopupOnIdentifierPartActionPerformed(evt);
329
                javaAutoPopupOnIdentifierPartActionPerformed(evt);
Lines 146-197 Link Here
146
343
147
        javadocAutoCompletionTriggersField.setText(org.openide.util.NbBundle.getMessage(CodeCompletionPanel.class, "CodeCompletionPanel.javadocAutoCompletionTriggersField.text")); // NOI18N
344
        javadocAutoCompletionTriggersField.setText(org.openide.util.NbBundle.getMessage(CodeCompletionPanel.class, "CodeCompletionPanel.javadocAutoCompletionTriggersField.text")); // NOI18N
148
345
149
        org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this);
346
        org.openide.awt.Mnemonics.setLocalizedText(javaCompletionExcluderLabel, org.openide.util.NbBundle.getMessage(CodeCompletionPanel.class, "CodeCompletionPanel.javaCompletionExcluderLabel.text")); // NOI18N
150
        this.setLayout(layout);
347
151
        layout.setHorizontalGroup(
348
        org.openide.awt.Mnemonics.setLocalizedText(javaCompletionExcluderButton, org.openide.util.NbBundle.getMessage(CodeCompletionPanel.class, "CodeCompletionPanel.javaCompletionExcluderButton.text")); // NOI18N
152
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
349
        javaCompletionExcluderButton.addActionListener(new java.awt.event.ActionListener() {
153
            .add(layout.createSequentialGroup()
350
            public void actionPerformed(java.awt.event.ActionEvent evt) {
351
                javaCompletionExcluderButtonActionPerformed(evt);
352
            }
353
        });
354
355
        org.jdesktop.layout.GroupLayout javaCompletionPaneLayout = new org.jdesktop.layout.GroupLayout(javaCompletionPane);
356
        javaCompletionPane.setLayout(javaCompletionPaneLayout);
357
        javaCompletionPaneLayout.setHorizontalGroup(
358
            javaCompletionPaneLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
359
            .add(javaCompletionPaneLayout.createSequentialGroup()
154
                .addContainerGap()
360
                .addContainerGap()
155
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
361
                .add(javaCompletionPaneLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
156
                    .add(jSeparator1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 362, Short.MAX_VALUE)
362
                    .add(jSeparator1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 337, Short.MAX_VALUE)
363
                    .add(javaCompletionPaneLayout.createSequentialGroup()
364
                        .add(javadocAutoCompletionTriggersLabel)
365
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
366
                        .add(javadocAutoCompletionTriggersField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 86, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
367
                .addContainerGap())
368
            .add(javaCompletionPaneLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
369
                .add(javaCompletionPaneLayout.createSequentialGroup()
370
                    .addContainerGap()
371
                    .add(javaCompletionPaneLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
157
                    .add(guessMethodArguments)
372
                    .add(guessMethodArguments)
158
                    .add(layout.createSequentialGroup()
373
                        .add(javaCompletionPaneLayout.createSequentialGroup()
159
                        .add(javaAutoCompletionTriggersLabel)
374
                        .add(javaAutoCompletionTriggersLabel)
160
                        .add(34, 34, 34)
375
                        .add(34, 34, 34)
161
                        .add(javaAutoCompletionTriggersField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 86, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
376
                        .add(javaAutoCompletionTriggersField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 86, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
162
                    .add(javaAutoPopupOnIdentifierPart)
377
                    .add(javaAutoPopupOnIdentifierPart)
163
                    .add(layout.createSequentialGroup()
378
                        .add(javaCompletionPaneLayout.createSequentialGroup()
164
                        .add(javaCompletionSelectorsLabel)
379
                            .add(javaCompletionPaneLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
380
                                .add(javaCompletionExcluderLabel)
381
                                .add(javaCompletionSelectorsLabel))
382
                            .add(javaCompletionPaneLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
383
                                .add(javaCompletionPaneLayout.createSequentialGroup()
165
                        .add(30, 30, 30)
384
                        .add(30, 30, 30)
166
                        .add(javaCompletionSelectorsField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 86, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
385
                        .add(javaCompletionSelectorsField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 86, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
167
                    .add(layout.createSequentialGroup()
386
                                .add(org.jdesktop.layout.GroupLayout.TRAILING, javaCompletionPaneLayout.createSequentialGroup()
168
                        .add(javadocAutoCompletionTriggersLabel)
387
                                    .add(23, 23, 23)
169
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
388
                                    .add(javaCompletionExcluderButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 93, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))))
170
                        .add(javadocAutoCompletionTriggersField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 86, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
389
                    .addContainerGap(25, Short.MAX_VALUE)))
171
                .addContainerGap())
172
        );
390
        );
173
        layout.setVerticalGroup(
391
        javaCompletionPaneLayout.setVerticalGroup(
174
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
392
            javaCompletionPaneLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
175
            .add(layout.createSequentialGroup()
393
            .add(javaCompletionPaneLayout.createSequentialGroup()
394
                .add(171, 171, 171)
395
                .add(jSeparator1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
396
                .add(18, 18, 18)
397
                .add(javaCompletionPaneLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
398
                    .add(javadocAutoCompletionTriggersLabel)
399
                    .add(javadocAutoCompletionTriggersField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
400
                .addContainerGap(23, Short.MAX_VALUE))
401
            .add(javaCompletionPaneLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
402
                .add(javaCompletionPaneLayout.createSequentialGroup()
176
                .addContainerGap()
403
                .addContainerGap()
177
                .add(guessMethodArguments)
404
                    .add(guessMethodArguments, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 23, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
178
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
405
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
179
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
406
                    .add(javaCompletionPaneLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
180
                    .add(javaAutoCompletionTriggersLabel)
407
                    .add(javaAutoCompletionTriggersLabel)
181
                    .add(javaAutoCompletionTriggersField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
408
                    .add(javaAutoCompletionTriggersField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
182
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
409
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
183
                .add(javaAutoPopupOnIdentifierPart)
410
                .add(javaAutoPopupOnIdentifierPart)
184
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
411
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
185
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
412
                    .add(javaCompletionPaneLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
186
                    .add(javaCompletionSelectorsLabel)
413
                    .add(javaCompletionSelectorsLabel)
187
                    .add(javaCompletionSelectorsField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
414
                    .add(javaCompletionSelectorsField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
188
                .add(18, 18, 18)
415
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
189
                .add(jSeparator1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
416
                    .add(javaCompletionPaneLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
190
                .add(18, 18, 18)
417
                        .add(javaCompletionExcluderButton)
191
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
418
                        .add(javaCompletionExcluderLabel))
192
                    .add(javadocAutoCompletionTriggersLabel)
419
                    .addContainerGap(91, Short.MAX_VALUE)))
193
                    .add(javadocAutoCompletionTriggersField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
420
        );
194
                .addContainerGap(30, Short.MAX_VALUE))
421
422
        org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this);
423
        this.setLayout(layout);
424
        layout.setHorizontalGroup(
425
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
426
            .add(javaCompletionPane, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
427
        );
428
        layout.setVerticalGroup(
429
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
430
            .add(javaCompletionPane, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
195
        );
431
        );
196
    }// </editor-fold>//GEN-END:initComponents
432
    }// </editor-fold>//GEN-END:initComponents
197
433
Lines 202-207 Link Here
202
    private void guessMethodArgumentsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_guessMethodArgumentsActionPerformed
438
    private void guessMethodArgumentsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_guessMethodArgumentsActionPerformed
203
        preferences.putBoolean(GUESS_METHOD_ARGUMENTS, guessMethodArguments.isSelected());
439
        preferences.putBoolean(GUESS_METHOD_ARGUMENTS, guessMethodArguments.isSelected());
204
}//GEN-LAST:event_guessMethodArgumentsActionPerformed
440
}//GEN-LAST:event_guessMethodArgumentsActionPerformed
441
442
	private void javaCompletionExcluderButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_javaCompletionExcluderButtonActionPerformed
443
        if (javaCompletionExcluderFrame.isVisible())
444
            return;
445
        javaCompletionExcluderFrame.pack();
446
        javaCompletionExcluderFrame.setLocationRelativeTo(this);
447
        javaCompletionExcluderFrame.setVisible(true);
448
}//GEN-LAST:event_javaCompletionExcluderButtonActionPerformed
449
450
	private void javaCompletionExcluderAddButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_javaCompletionExcluderAddButtonActionPerformed
451
        JTable table = getSelectedExcluderTable();
452
        DefaultTableModel model = (DefaultTableModel) table.getModel();
453
        int rows = model.getRowCount();
454
        model.setRowCount(rows + 1);
455
        table.editCellAt(rows, 0);
456
        table.requestFocus();
457
}//GEN-LAST:event_javaCompletionExcluderAddButtonActionPerformed
458
459
    private void javaCompletionExcluderRemoveButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_javaCompletionExcluderRemoveButtonActionPerformed
460
        JTable table = getSelectedExcluderTable();
461
        int[] rows = table.getSelectedRows();
462
        if (rows.length == 0)
463
            return;
464
        // remove rows in descending order: row numbers change when a row is removed
465
        Arrays.sort(rows);
466
        DefaultTableModel model = (DefaultTableModel) table.getModel();
467
        for (int row = rows.length - 1; row >= 0; row--) {
468
            model.removeRow(rows[row]);
469
        }
470
}//GEN-LAST:event_javaCompletionExcluderRemoveButtonActionPerformed
471
472
    private void javaCompletionExcluderCloseButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_javaCompletionExcluderCloseButtonActionPerformed
473
        javaCompletionExcluderFrame.setVisible(false);
474
    }//GEN-LAST:event_javaCompletionExcluderCloseButtonActionPerformed
205
475
206
    private void update(DocumentEvent e) {
476
    private void update(DocumentEvent e) {
207
        if (e.getDocument() == javaAutoCompletionTriggersField.getDocument())
477
        if (e.getDocument() == javaAutoCompletionTriggersField.getDocument())
Lines 218-223 Link Here
218
    private javax.swing.JTextField javaAutoCompletionTriggersField;
488
    private javax.swing.JTextField javaAutoCompletionTriggersField;
219
    private javax.swing.JLabel javaAutoCompletionTriggersLabel;
489
    private javax.swing.JLabel javaAutoCompletionTriggersLabel;
220
    private javax.swing.JCheckBox javaAutoPopupOnIdentifierPart;
490
    private javax.swing.JCheckBox javaAutoPopupOnIdentifierPart;
491
    private javax.swing.JScrollPane javaCompletionExcludeScrollPane;
492
    private javax.swing.JTable javaCompletionExcludeTable;
493
    private javax.swing.JButton javaCompletionExcluderAddButton;
494
    private javax.swing.JButton javaCompletionExcluderButton;
495
    private javax.swing.JButton javaCompletionExcluderCloseButton;
496
    private javax.swing.JFrame javaCompletionExcluderFrame;
497
    private javax.swing.JLabel javaCompletionExcluderLabel;
498
    private javax.swing.JButton javaCompletionExcluderRemoveButton;
499
    private javax.swing.JTabbedPane javaCompletionExcluderTab;
500
    private javax.swing.JScrollPane javaCompletionIncludeScrollPane;
501
    private javax.swing.JTable javaCompletionIncludeTable;
502
    private javax.swing.JPanel javaCompletionPane;
221
    private javax.swing.JTextField javaCompletionSelectorsField;
503
    private javax.swing.JTextField javaCompletionSelectorsField;
222
    private javax.swing.JLabel javaCompletionSelectorsLabel;
504
    private javax.swing.JLabel javaCompletionSelectorsLabel;
223
    private javax.swing.JTextField javadocAutoCompletionTriggersField;
505
    private javax.swing.JTextField javadocAutoCompletionTriggersField;
Lines 226-232 Link Here
226
    
508
    
227
    private static class CodeCompletionPreferencesCusromizer implements PreferencesCustomizer {
509
    private static class CodeCompletionPreferencesCusromizer implements PreferencesCustomizer {
228
510
229
        private Preferences preferences;
511
        private final Preferences preferences;
230
512
231
        private CodeCompletionPreferencesCusromizer(Preferences p) {
513
        private CodeCompletionPreferencesCusromizer(Preferences p) {
232
            preferences = p;
514
            preferences = p;

Return to bug 125060