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 104409
Collapse All | Expand All

(-)apichanges.xml (+18 lines)
Lines 82-87 Link Here
82
    <!-- ACTUAL CHANGES BEGIN HERE: -->
82
    <!-- ACTUAL CHANGES BEGIN HERE: -->
83
83
84
    <changes>
84
    <changes>
85
        <change id="CompletionResultSet.hasAdditionalItems">
86
            <api name="completion"/>
87
            <summary>Addition of CompletionResultSet.hasAdditionalItems()</summary>
88
            <version major="1" minor="9"/>
89
            <date day="20" month="6" year="2007"/>
90
            <author login="dbalek"/>
91
            <compatibility addition="yes"/>
92
            <description>
93
            <p>
94
                <code>void CompletionResultSet.hasAdditionalItems(boolean value)</code> was added
95
                to indicate that some items could exist that will likely need a long time to be computed
96
		and added to the result set. It is preferred to add them on the special 'all' code
97
		completion invocation only.
98
            </p>
99
            </description>
100
            <issue number="104409"/>
101
        </change>
102
85
        <change id="ui.gestures.collector">
103
        <change id="ui.gestures.collector">
86
            <api name="completion"/>
104
            <api name="completion"/>
87
            <summary>Support for UI Gestures Collector</summary>
105
            <summary>Support for UI Gestures Collector</summary>
(-)manifest.mf (-1 / +1 lines)
Lines 2-5 Link Here
2
OpenIDE-Module: org.netbeans.modules.editor.completion/1
2
OpenIDE-Module: org.netbeans.modules.editor.completion/1
3
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/editor/completion/Bundle.properties
3
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/editor/completion/Bundle.properties
4
OpenIDE-Module-Install: org/netbeans/modules/editor/completion/CompletionModule.class
4
OpenIDE-Module-Install: org/netbeans/modules/editor/completion/CompletionModule.class
5
OpenIDE-Module-Specification-Version: 1.8
5
OpenIDE-Module-Specification-Version: 1.9
(-)src/org/netbeans/modules/editor/completion/CompletionImpl.java (-2 / +5 lines)
Lines 713-718 Link Here
713
        final List<CompletionItem> sortedResultItems = new ArrayList<CompletionItem>(sortedResultsSize);
713
        final List<CompletionItem> sortedResultItems = new ArrayList<CompletionItem>(sortedResultsSize);
714
        String title = null;
714
        String title = null;
715
        int anchorOffset = -1;
715
        int anchorOffset = -1;
716
        boolean additionalItems = false;
716
        int cnt = 0;
717
        int cnt = 0;
717
        for (int i = 0; i < completionResultSets.size(); i++) {
718
        for (int i = 0; i < completionResultSets.size(); i++) {
718
            CompletionResultSetImpl resultSet = (CompletionResultSetImpl)completionResultSets.get(i);
719
            CompletionResultSetImpl resultSet = (CompletionResultSetImpl)completionResultSets.get(i);
Lines 732-737 Link Here
732
                }
733
                }
733
                if (title == null)
734
                if (title == null)
734
                    title = resultSet.getTitle();
735
                    title = resultSet.getTitle();
736
                if (!additionalItems)
737
                    additionalItems = resultSet.hasAdditionalItems();
735
                if (anchorOffset == -1)
738
                if (anchorOffset == -1)
736
                    anchorOffset = resultSet.getAnchorOffset();
739
                    anchorOffset = resultSet.getAnchorOffset();
737
            }
740
            }
Lines 748-754 Link Here
748
        // Request displaying of the completion pane in AWT thread
751
        // Request displaying of the completion pane in AWT thread
749
        final String displayTitle = title;
752
        final String displayTitle = title;
750
        final int displayAnchorOffset = anchorOffset;
753
        final int displayAnchorOffset = anchorOffset;
751
        final int queryType = qType;
754
        final boolean displayAdditionalItems = additionalItems;
752
        Runnable requestShowRunnable = new Runnable() {
755
        Runnable requestShowRunnable = new Runnable() {
753
            public void run() {
756
            public void run() {
754
                int caretOffset = getActiveComponent().getSelectionStart();
757
                int caretOffset = getActiveComponent().getSelectionStart();
Lines 769-775 Link Here
769
                }
772
                }
770
                
773
                
771
                int selectedIndex = getCompletionPreSelectionIndex(sortedResultItems);
774
                int selectedIndex = getCompletionPreSelectionIndex(sortedResultItems);
772
                layout.showCompletion(noSuggestions ? Collections.singletonList(NO_SUGGESTIONS) : sortedResultItems, displayTitle, displayAnchorOffset, CompletionImpl.this, queryType == CompletionProvider.COMPLETION_QUERY_TYPE ? completionShortcut : null, selectedIndex);
775
                layout.showCompletion(noSuggestions ? Collections.singletonList(NO_SUGGESTIONS) : sortedResultItems, displayTitle, displayAnchorOffset, CompletionImpl.this, displayAdditionalItems ? completionShortcut : null, selectedIndex);
773
                pleaseWaitDisplayed = false;
776
                pleaseWaitDisplayed = false;
774
777
775
                // Show documentation as well if set by default
778
                // Show documentation as well if set by default
(-)src/org/netbeans/modules/editor/completion/CompletionResultSetImpl.java (+15 lines)
Lines 69-74 Link Here
69
    
69
    
70
    private List<CompletionItem> items;
70
    private List<CompletionItem> items;
71
    
71
    
72
    private boolean hasAdditionalItems;
73
    
72
    private boolean finished;
74
    private boolean finished;
73
    
75
    
74
    private CompletionDocumentation documentation;
76
    private CompletionDocumentation documentation;
Lines 180-185 Link Here
180
        assert isFinished() : "Adding not finished";
182
        assert isFinished() : "Adding not finished";
181
        return (items != null) ? items : Collections.<CompletionItem>emptyList();
183
        return (items != null) ? items : Collections.<CompletionItem>emptyList();
182
    }
184
    }
185
    
186
    
187
    public synchronized void hasAdditionalItems(boolean value) {
188
        checkNotFinished();
189
        if (queryType != CompletionProvider.COMPLETION_QUERY_TYPE) {
190
            return;
191
        }
192
        this.hasAdditionalItems = value;
193
    }
194
195
    public synchronized boolean hasAdditionalItems() {
196
        return hasAdditionalItems;
197
    }    
183
    
198
    
184
    public synchronized void setDocumentation(CompletionDocumentation documentation) {
199
    public synchronized void setDocumentation(CompletionDocumentation documentation) {
185
        checkNotFinished();
200
        checkNotFinished();
(-)src/org/netbeans/spi/editor/completion/CompletionResultSet.java (+15 lines)
Lines 157-162 Link Here
157
        impl.estimateItems(estimatedItemCount, estimatedItemWidth);
157
        impl.estimateItems(estimatedItemCount, estimatedItemWidth);
158
    }
158
    }
159
    
159
    
160
    
161
    /**
162
     * Indicate that additional items could be added to this result set. However,
163
     * adding of these items will likely need a long time to complete so it is
164
     * preferred to add them only on the special code completion invocation
165
     * denoted by {@link CompletionProvider#COMPLETION_ALL_QUERY_TYPE}.
166
     * <br>
167
     * Calling this method is relevant only for tasks
168
     * created by {@link CompletionProvider#createTask(int, javax.swing.text.JTextComponent)}
169
     * with {@link CompletionProvider#COMPLETION_QUERY_TYPE}.
170
     */
171
    public void hasAdditionalItems(boolean value) {
172
        impl.hasAdditionalItems(value);
173
    }
174
    
160
    /**
175
    /**
161
     * Set the documentation to this result set.
176
     * Set the documentation to this result set.
162
     * <br>
177
     * <br>

Return to bug 104409