use of org.osate.ba.utils.AadlBaLocationReference in project osate2 by osate.
the class AadlBaTextPositionResolver method resolveBehaviorAnnexCrossReferencedElementAt.
private TextPositionInfo resolveBehaviorAnnexCrossReferencedElementAt(int offset) {
Element e = this.getLinkedElement(offset);
if (e == null)
return new TextPositionInfo(null, offset, 0);
AadlBaLocationReference loc = this.getSourceOffsetElement(offset);
TextPositionInfo positionInfo;
if (e instanceof ElementHolder) {
ElementHolder beh = (ElementHolder) e;
positionInfo = new TextPositionInfo(beh.getElement(), loc.getOffset(), loc.getLength());
} else {
positionInfo = new TextPositionInfo(e, loc.getOffset(), loc.getLength());
}
return positionInfo;
}
use of org.osate.ba.utils.AadlBaLocationReference in project osate2 by osate.
the class XtextAadlBaHighlighter method addToHighlighting.
@Override
public void addToHighlighting(int annexOffset, Token token, String id) {
int offset = ((CommonToken) token).getStartIndex();
int length = token.getText().length();
int column = token.getCharPositionInLine();
_elementToHighlight.add(new AadlBaLocationReference(annexOffset, offset, length, column, id));
}
Aggregations