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

(-)a/editor.completion/src/org/netbeans/modules/editor/completion/CompletionImpl.java (-5 / +5 lines)
Lines 395-401 Link Here
395
                            CompletionSettings.getInstance(getActiveComponent()).completionAutoPopup()) {
395
                            CompletionSettings.getInstance(getActiveComponent()).completionAutoPopup()) {
396
                        autoModEndOffset = modEndOffset;
396
                        autoModEndOffset = modEndOffset;
397
                        if (completionResultNull)
397
                        if (completionResultNull)
398
                            showCompletion(false, false, true, CompletionProvider.COMPLETION_QUERY_TYPE);
398
                            showCompletion(false, false, true, type & (CompletionProvider.COMPLETION_QUERY_MASK | CompletionProvider.USER_QUERY_MASK));
399
                    }
399
                    }
400
400
401
                    boolean tooltipResultNull;
401
                    boolean tooltipResultNull;
Lines 1068-1078 Link Here
1068
1068
1069
        final boolean noSuggestions = sortedResultItems.size() == 0;
1069
        final boolean noSuggestions = sortedResultItems.size() == 0;
1070
        if (noSuggestions) {
1070
        if (noSuggestions) {
1071
            if (hasAdditionalItems && qType == CompletionProvider.COMPLETION_QUERY_TYPE) {
1071
            if (hasAdditionalItems && (qType & CompletionProvider.COMPLETION_ALL_QUERY_TYPE) != CompletionProvider.COMPLETION_ALL_QUERY_TYPE) {
1072
                showCompletion(this.explicitQuery, this.refreshedQuery, false, CompletionProvider.COMPLETION_ALL_QUERY_TYPE);
1072
                showCompletion(this.explicitQuery, this.refreshedQuery, false, CompletionProvider.COMPLETION_ALL_QUERY_TYPE);
1073
                return;
1073
                return;
1074
            }
1074
            }
1075
            if (!explicitQuery) {                
1075
            if (!explicitQuery) {
1076
                hideCompletion(false);
1076
                hideCompletion(false);
1077
                return;
1077
                return;
1078
            }
1078
            }
Lines 1523-1529 Link Here
1523
    void finishNotify(CompletionResultSetImpl finishedResult) {
1523
    void finishNotify(CompletionResultSetImpl finishedResult) {
1524
        Result localResult;
1524
        Result localResult;
1525
        boolean finished = false;
1525
        boolean finished = false;
1526
        switch (finishedResult.getQueryType()) {
1526
        switch (finishedResult.getQueryType() & CompletionProvider.RESERVED_QUERY_MASK) {
1527
            case CompletionProvider.COMPLETION_QUERY_TYPE:
1527
            case CompletionProvider.COMPLETION_QUERY_TYPE:
1528
            case CompletionProvider.COMPLETION_ALL_QUERY_TYPE:
1528
            case CompletionProvider.COMPLETION_ALL_QUERY_TYPE:
1529
                synchronized (this) {
1529
                synchronized (this) {
Lines 1589-1595 Link Here
1589
    private static CompletionResultSetImpl findFirstValidResult(List<CompletionResultSetImpl> resultSets) {
1589
    private static CompletionResultSetImpl findFirstValidResult(List<CompletionResultSetImpl> resultSets) {
1590
        for (int i = 0; i < resultSets.size(); i++) {
1590
        for (int i = 0; i < resultSets.size(); i++) {
1591
            CompletionResultSetImpl result = resultSets.get(i);
1591
            CompletionResultSetImpl result = resultSets.get(i);
1592
            switch (result.getQueryType()) {
1592
            switch (result.getQueryType() & CompletionProvider.RESERVED_QUERY_MASK) {
1593
                case CompletionProvider.DOCUMENTATION_QUERY_TYPE:
1593
                case CompletionProvider.DOCUMENTATION_QUERY_TYPE:
1594
                    if (result.getDocumentation() != null) {
1594
                    if (result.getDocumentation() != null) {
1595
                        return result;
1595
                        return result;
(-)a/editor.completion/src/org/netbeans/modules/editor/completion/CompletionResultSetImpl.java (-4 / +4 lines)
Lines 213-219 Link Here
213
    
213
    
214
    public synchronized void setHasAdditionalItems(boolean value) {
214
    public synchronized void setHasAdditionalItems(boolean value) {
215
        checkNotFinished();
215
        checkNotFinished();
216
        if (queryType != CompletionProvider.COMPLETION_QUERY_TYPE) {
216
        if ((queryType & CompletionProvider.COMPLETION_ALL_QUERY_TYPE) == CompletionProvider.COMPLETION_ALL_QUERY_TYPE) {
217
            return;
217
            return;
218
        }
218
        }
219
        this.hasAdditionalItems = value;
219
        this.hasAdditionalItems = value;
Lines 225-231 Link Here
225
    
225
    
226
    public synchronized void setHasAdditionalItemsText(String text) {
226
    public synchronized void setHasAdditionalItemsText(String text) {
227
        checkNotFinished();
227
        checkNotFinished();
228
        if (queryType != CompletionProvider.COMPLETION_QUERY_TYPE) {
228
        if ((queryType & CompletionProvider.COMPLETION_ALL_QUERY_TYPE) == CompletionProvider.COMPLETION_ALL_QUERY_TYPE) {
229
            return;
229
            return;
230
        }
230
        }
231
        this.hasAdditionalItemsText = text;
231
        this.hasAdditionalItemsText = text;
Lines 237-243 Link Here
237
237
238
    public synchronized void setDocumentation(CompletionDocumentation documentation) {
238
    public synchronized void setDocumentation(CompletionDocumentation documentation) {
239
        checkNotFinished();
239
        checkNotFinished();
240
        if (!active || queryType != CompletionProvider.DOCUMENTATION_QUERY_TYPE) {
240
        if (!active || (queryType & CompletionProvider.DOCUMENTATION_QUERY_TYPE) != CompletionProvider.DOCUMENTATION_QUERY_TYPE) {
241
            return;
241
            return;
242
        }
242
        }
243
        this.documentation = documentation;
243
        this.documentation = documentation;
Lines 253-259 Link Here
253
    
253
    
254
    public synchronized void setToolTip(JToolTip toolTip) {
254
    public synchronized void setToolTip(JToolTip toolTip) {
255
        checkNotFinished();
255
        checkNotFinished();
256
        if (!active || queryType != CompletionProvider.TOOLTIP_QUERY_TYPE) {
256
        if (!active || (queryType & CompletionProvider.TOOLTIP_QUERY_TYPE) != CompletionProvider.TOOLTIP_QUERY_TYPE) {
257
            return;
257
            return;
258
        }
258
        }
259
        this.toolTip = toolTip;
259
        this.toolTip = toolTip;
(-)a/editor.completion/src/org/netbeans/spi/editor/completion/CompletionProvider.java (-4 / +19 lines)
Lines 67-88 Link Here
67
    /**
67
    /**
68
     * The <code>int</code> value representing the query for a code completion.
68
     * The <code>int</code> value representing the query for a code completion.
69
     */
69
     */
70
    public static final int COMPLETION_QUERY_TYPE = 1;
70
    public static final int COMPLETION_QUERY_TYPE = 0x01;
71
71
72
    /**
72
    /**
73
     * The <code>int</code> value representing the query for a documentation.
73
     * The <code>int</code> value representing the query for a documentation.
74
     */    
74
     */    
75
    public static final int DOCUMENTATION_QUERY_TYPE = 2;
75
    public static final int DOCUMENTATION_QUERY_TYPE = 0x02;
76
    
76
    
77
    /**
77
    /**
78
     * The <code>int</code> value representing the query for a tooltip hint.
78
     * The <code>int</code> value representing the query for a tooltip hint.
79
     */    
79
     */    
80
    public static final int TOOLTIP_QUERY_TYPE = 4;
80
    public static final int TOOLTIP_QUERY_TYPE = 0x04;
81
81
82
    /**
82
    /**
83
     * The <code>int</code> value representing the query for an all code completion.
83
     * The <code>int</code> value representing the query for an all code completion.
84
     */
84
     */
85
    public static final int COMPLETION_ALL_QUERY_TYPE = 9;
85
    public static final int COMPLETION_ALL_QUERY_TYPE = 0x11;
86
87
    /**
88
     * The <code>int</code> mask representing the bits used for a completion query type.
89
     */
90
    public static final int COMPLETION_QUERY_MASK = COMPLETION_QUERY_TYPE | COMPLETION_ALL_QUERY_TYPE;
91
92
    /**
93
     * The <code>int</code> mask of bits a user can specify to customize the query type.
94
     */
95
    public static final int USER_QUERY_MASK = 0xFFFF0000;
96
97
    /**
98
     * The <code>int</code> mask of bits used by the API to specify the query type.
99
     */
100
    public static final int RESERVED_QUERY_MASK = ~USER_QUERY_MASK;
86
101
87
    /**
102
    /**
88
     * Creates a task that performs a query of the given type on the given component.
103
     * Creates a task that performs a query of the given type on the given component.

Return to bug 204867