|
org.netbeans.spi.editor.hints/0 1.21.0 7 | |||||||||
| PREV NEXT | FRAMES NO FRAMES | |||||||||
See:
Description
| Editor Hints | |
|---|---|
| org.netbeans.spi.editor.hints | . |
EditorHintsSPI allows to show errors in the editor, with possible fixes.
Added a new method ErrorDescriptionFactory.attachSubfixes that allows to attach sub-fixes to given fix.
Added new interface and context class in order to be able to provide up-to-date hints on current line.
Document doc = ...;
ArrayList<ErrorDescription> errors = new ArrayList<ErrorDescription>();
for (<all errors from the parser that have parsed the doc>) {
errors.add(
ErrorDescriptionFactory.createErrorDescription(
Severity.ERROR,
d.getMessage(Locale.getDefault()),
doc,
doc.createPosition(start),
doc.createPosition(end)
)
);
}
HintsController.setErrors(doc, "myerrors", errors);
static final class FixImpl implements Fix {
...
}
...
Document doc = ...;
List<Fix> fixes = Arrays.<Fix>asList(new FixImpl(...));
ArrayList<ErrorDescription> warnings = new ArrayList<ErrorDescription>();
for (<all places where the warning should be displayed>) {
warnings.add(
ErrorDescriptionFactory.createErrorDescription(
Severity.WARNING,
displayName,
fixes,
doc,
doc.createPosition(start),
doc.createPosition(end)
)
);
}
HintsController.setErrors(doc, "mywarnings", warnings);
|
The sources for the module are in the NetBeans Mercurial repositories.
Normal module dependencies are used for this module.
Read more about the implementation in the answers to architecture questions.
|
org.netbeans.spi.editor.hints/0 1.21.0 7 | |||||||||
| PREV NEXT | FRAMES NO FRAMES | |||||||||