Lines 51-57
Link Here
|
51 |
import java.awt.Container; |
51 |
import java.awt.Container; |
52 |
import java.awt.Cursor; |
52 |
import java.awt.Cursor; |
53 |
import java.awt.Dimension; |
53 |
import java.awt.Dimension; |
54 |
import java.awt.GraphicsConfiguration; |
|
|
55 |
import java.awt.GraphicsDevice; |
54 |
import java.awt.GraphicsDevice; |
56 |
import java.awt.GraphicsEnvironment; |
55 |
import java.awt.GraphicsEnvironment; |
57 |
import java.awt.HeadlessException; |
56 |
import java.awt.HeadlessException; |
Lines 124-129
Link Here
|
124 |
import org.netbeans.spi.editor.hints.ErrorDescription; |
123 |
import org.netbeans.spi.editor.hints.ErrorDescription; |
125 |
import org.netbeans.spi.editor.hints.ErrorDescriptionFactory; |
124 |
import org.netbeans.spi.editor.hints.ErrorDescriptionFactory; |
126 |
import org.netbeans.spi.editor.hints.Fix; |
125 |
import org.netbeans.spi.editor.hints.Fix; |
|
|
126 |
import org.netbeans.spi.editor.hints.FixableAnnotationProvider; |
127 |
import org.netbeans.spi.editor.hints.PositionRefresher; |
127 |
import org.netbeans.spi.editor.hints.PositionRefresher; |
128 |
import org.openide.ErrorManager; |
128 |
import org.openide.ErrorManager; |
129 |
import org.openide.awt.StatusDisplayer; |
129 |
import org.openide.awt.StatusDisplayer; |
Lines 155-174
Link Here
|
155 |
//-J-Dorg.netbeans.modules.editor.hints.HintsUI.always.show.error=true |
155 |
//-J-Dorg.netbeans.modules.editor.hints.HintsUI.always.show.error=true |
156 |
private static final boolean ALWAYS_SHOW_ERROR_MESSAGE = Boolean.getBoolean(HintsUI.class.getName() + ".always.show.error"); |
156 |
private static final boolean ALWAYS_SHOW_ERROR_MESSAGE = Boolean.getBoolean(HintsUI.class.getName() + ".always.show.error"); |
157 |
private static HintsUI INSTANCE; |
157 |
private static HintsUI INSTANCE; |
158 |
private static final Set<String> fixableAnnotations; |
|
|
159 |
private static final String POPUP_NAME = "hintsPopup"; // NOI18N |
158 |
private static final String POPUP_NAME = "hintsPopup"; // NOI18N |
160 |
private static final String SUB_POPUP_NAME = "subHintsPopup"; // NOI18N |
159 |
private static final String SUB_POPUP_NAME = "subHintsPopup"; // NOI18N |
161 |
private static final int POPUP_VERTICAL_OFFSET = 5; |
160 |
private static final int POPUP_VERTICAL_OFFSET = 5; |
162 |
private static final RequestProcessor WORKER = new RequestProcessor(HintsUI.class.getName(), 1, false, false); |
161 |
private static final RequestProcessor WORKER = new RequestProcessor(HintsUI.class.getName(), 1, false, false); |
163 |
|
162 |
|
164 |
static { |
|
|
165 |
fixableAnnotations = new HashSet<String>(3); |
166 |
|
167 |
fixableAnnotations.add("org-netbeans-spi-editor-hints-parser_annotation_err_fixable"); // NOI18N |
168 |
fixableAnnotations.add("org-netbeans-spi-editor-hints-parser_annotation_hint_fixable"); // NOI18N |
169 |
fixableAnnotations.add("org-netbeans-spi-editor-hints-parser_annotation_verifier_fixable"); // NOI18N |
170 |
fixableAnnotations.add("org-netbeans-spi-editor-hints-parser_annotation_warn_fixable"); // NOI18N |
171 |
} |
172 |
|
163 |
|
173 |
public static synchronized HintsUI getDefault() { |
164 |
public static synchronized HintsUI getDefault() { |
174 |
if (INSTANCE == null) |
165 |
if (INSTANCE == null) |
Lines 681-689
Link Here
|
681 |
return false; |
672 |
return false; |
682 |
} |
673 |
} |
683 |
String type = activeAnnotation.getAnnotationType(); |
674 |
String type = activeAnnotation.getAnnotationType(); |
684 |
if (!fixableAnnotations.contains(type) && onlyActive) { |
675 |
if (!FixableAnnotations.getFixableAnnotationTypes().contains(type) && onlyActive) { |
685 |
return false; |
676 |
return false; |
686 |
} |
677 |
} |
687 |
if (onlyActive) { |
678 |
if (onlyActive) { |
688 |
refresh(doc, comp.getCaretPosition()); |
679 |
refresh(doc, comp.getCaretPosition()); |
689 |
} |
680 |
} |