See: Description
Package | Description |
---|---|
org.netbeans.spi.editor.hints |
.
|
org.netbeans.spi.editor.hints.settings |
EditorHintsSPI allows to show errors in the editor, with possible fixes.
Added FileHintPreferences.openFilePreferences that opens hints settings.
For custom type of annotations will dynamically register this annotation type as fixable, so Fix action (click on the icon) will work for it
Added support for multiple ranges for error/warning. New field added to ErrorDescription as well as corresponding getter method and new constructor in order to be able to provide multiple ranges support for highlight particular hint. Added new factory method to ErrorDescriptionFactory which uses new ErrorDescription constructor.
Added customType field to ErrorDescription as well as corresponding getter method and new constructor in order to be able to provide custom annotation type for particular hint. Added new factory method to ErrorDescriptionFactory which uses new ErrorDescription constructor.
XXX
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 Apache Git repositories or in the GitHub repositories.
Normal module dependencies are used for this module.
Read more about the implementation in the answers to architecture questions.