Customizing XtextAnnotation [message #1842969] |
Thu, 08 July 2021 09:29  |
Ryana Karaki Messages: 19 Registered: May 2021 |
Junior Member |
|
|
Hello,
I am a beginner in Xtext. I want to add markers programmatically to my editor, and I've done it thanks to the following method :
private void createInformativeMarker(IAnnotationModelExtension extension, XtextEditor editor) {
Issue.IssueImpl issue = new Issue.IssueImpl();
INode node = NodeModelUtils.findActualNodeFor(associatedObject);
int start = node.getOffset();
int length = node.getLength();
int line = node.getStartLine();
issue.setSyntaxError(false);
issue.setSeverity(Severity.INFO);
issue.setLineNumber(line);
issue.setMessage(markerInformation());
String type = "org.eclipse.xtext.ui.editor.info";
XtextAnnotation rangeIndicator = new XtextAnnotation(type, true, editor.getDocument(),issue, false);
this.annotation = rangeIndicator;
extension.modifyAnnotationPosition(rangeIndicator, new Position(start, length));
}
The type I provided seems to be the information icon. I wanted to know if it was possible to provide my own icons to this marker ? Simply giving the image path does not seem to do the trick.
Thanks !
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02506 seconds