notify();
}
private void highlightCurrentNodeUsagesInText()
{
ISourceViewer view = getSourceViewer();
CodeFile hFile = currentFile;
IFile activeFile = hFile.getRealFile();
HaxeProject project = Activator.getProjectManager().getCurrentHaxeProject();
CodeFile currFile = project.getFile(activeFile);
String currPack = currFile.getPackage();
TextPresentation presentation = new TextPresentation();
for (NodeLink info : usagesList.get(currPack))
{
HaxeTree node = info.getNode();
int offset = node.getMostLeftPosition();
int end = node.getMostRightPosition();
Display display = Display.getDefault();
StyleRange styleRange = new StyleRange(
offset, end - offset + 1,
display.getSystemColor(SWT.COLOR_WHITE),
display.getSystemColor(SWT.COLOR_BLUE),
SWT.NORMAL);
// Negative (possibly 0) length style ranges will cause an
// IllegalArgumentException in changeTextPresentation(..)
if (styleRange.length > 0 )
{
presentation.addStyleRange(styleRange);
}
}
if (!presentation.isEmpty() && view.isEditable())
{
view.changeTextPresentation(presentation, true);
}
}