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

(-)a/java.hints.ui/src/org/netbeans/modules/java/hints/spiimpl/options/HintsPanel.java (-1 / +12 lines)
Lines 137-142 Link Here
137
    private final AtomicBoolean initialized = new AtomicBoolean(false);
137
    private final AtomicBoolean initialized = new AtomicBoolean(false);
138
    private final ClassPathBasedHintWrapper cpBased;
138
    private final ClassPathBasedHintWrapper cpBased;
139
    private final QueryStatus queryStatus;
139
    private final QueryStatus queryStatus;
140
    private final boolean showHeavyInspections;
141
    
140
    //AWT only:
142
    //AWT only:
141
    private HintMetadata toSelect = null;
143
    private HintMetadata toSelect = null;
142
    
144
    
Lines 148-153 Link Here
148
    HintsPanel(@NullAllowed final OptionsFilter filter) {
150
    HintsPanel(@NullAllowed final OptionsFilter filter) {
149
        this.cpBased = null;
151
        this.cpBased = null;
150
        this.queryStatus = QueryStatus.SHOW_QUERIES;
152
        this.queryStatus = QueryStatus.SHOW_QUERIES;
153
        this.showHeavyInspections = false;
151
        WORKER.post(new Runnable() {
154
        WORKER.post(new Runnable() {
152
155
153
            @Override
156
            @Override
Lines 174-185 Link Here
174
    public HintsPanel(Configuration preselected, ClassPathBasedHintWrapper cpBased) {
177
    public HintsPanel(Configuration preselected, ClassPathBasedHintWrapper cpBased) {
175
        this.cpBased = cpBased;
178
        this.cpBased = cpBased;
176
        this.queryStatus = QueryStatus.ONLY_ENABLED;
179
        this.queryStatus = QueryStatus.ONLY_ENABLED;
180
        this.showHeavyInspections = true;
177
        init(null, false, true, true, true);
181
        init(null, false, true, true, true);
178
        configCombo.setSelectedItem(preselected);
182
        configCombo.setSelectedItem(preselected);
179
    }
183
    }
180
    public HintsPanel(HintMetadata preselected, @NullAllowed final CustomizerContext<?, ?> cc, ClassPathBasedHintWrapper cpBased) {
184
    public HintsPanel(HintMetadata preselected, @NullAllowed final CustomizerContext<?, ?> cc, ClassPathBasedHintWrapper cpBased) {
181
        this.cpBased = cpBased;
185
        this.cpBased = cpBased;
182
        this.queryStatus = cc == null ? QueryStatus.NEVER : QueryStatus.SHOW_QUERIES;
186
        this.queryStatus = cc == null ? QueryStatus.NEVER : QueryStatus.SHOW_QUERIES;
187
        this.showHeavyInspections = true;
183
        init(null, false, false, cc == null, false);
188
        init(null, false, false, cc == null, false);
184
        select(preselected);
189
        select(preselected);
185
        configurationsPanel.setVisible(false);
190
        configurationsPanel.setVisible(false);
Lines 200-205 Link Here
200
    public HintsPanel(Preferences configurations, ClassPathBasedHintWrapper cpBased) {
205
    public HintsPanel(Preferences configurations, ClassPathBasedHintWrapper cpBased) {
201
        this.cpBased = cpBased;
206
        this.cpBased = cpBased;
202
        this.queryStatus = QueryStatus.SHOW_QUERIES;
207
        this.queryStatus = QueryStatus.SHOW_QUERIES;
208
        this.showHeavyInspections = true;
203
        init(null, false, false, false, true);
209
        init(null, false, false, false, true);
204
        setOverlayPreferences(configurations);
210
        setOverlayPreferences(configurations);
205
        configurationsPanel.setVisible(false);
211
        configurationsPanel.setVisible(false);
Lines 1144-1149 Link Here
1144
1150
1145
        for (HintMetadata m : metadata) {
1151
        for (HintMetadata m : metadata) {
1146
            if (m.options.contains(Options.NON_GUI)) continue;
1152
            if (m.options.contains(Options.NON_GUI)) continue;
1153
            if (m.options.contains(Options.HEAVY)) {
1154
                if (!showHeavyInspections) {
1155
                    continue;
1156
                }
1157
            }
1147
            if (   m.options.contains(Options.QUERY)
1158
            if (   m.options.contains(Options.QUERY)
1148
                && !HintCategory.CUSTOM_CATEGORY.equals(m.category)) {
1159
                && !HintCategory.CUSTOM_CATEGORY.equals(m.category)) {
1149
                if (queryStatus == QueryStatus.NEVER) {
1160
                if (queryStatus == QueryStatus.NEVER) {
Lines 1152-1158 Link Here
1152
                if (queryStatus == QueryStatus.ONLY_ENABLED && logic != null && !logic.isEnabled(m)) {
1163
                if (queryStatus == QueryStatus.ONLY_ENABLED && logic != null && !logic.isEnabled(m)) {
1153
                    continue;
1164
                    continue;
1154
                }
1165
                }
1155
            }
1166
            } 
1156
1167
1157
            HintCategory cat = cat2CatDesc.get(m.category);
1168
            HintCategory cat = cat2CatDesc.get(m.category);
1158
1169
(-)a/spi.java.hints/src/org/netbeans/modules/java/hints/providers/spi/HintMetadata.java (-1 / +2 lines)
Lines 208-214 Link Here
208
    public enum Options {
208
    public enum Options {
209
        NON_GUI,
209
        NON_GUI,
210
        QUERY,
210
        QUERY,
211
        NO_BATCH;
211
        NO_BATCH,
212
        HEAVY;
212
213
213
        public static Set<Options> fromHintOptions(Hint.Options... options) {
214
        public static Set<Options> fromHintOptions(Hint.Options... options) {
214
            Set<Options> result = new HashSet<Options>();
215
            Set<Options> result = new HashSet<Options>();
(-)a/spi.java.hints/src/org/netbeans/spi/java/hints/Hint.java (-1 / +6 lines)
Lines 117-123 Link Here
117
        QUERY,
117
        QUERY,
118
        /**The hint cannot be run inside the Inspect&Refactor dialog.
118
        /**The hint cannot be run inside the Inspect&Refactor dialog.
119
         */
119
         */
120
        NO_BATCH;
120
        NO_BATCH,
121
        /**
122
         * The hint requires heavyweight processing so it should be run explicitly only by Inspect, Refactor (or similar) 
123
         * features
124
         */
125
        HEAVY;
121
    }
126
    }
122
127
123
}
128
}

Return to bug 227959