use of org.eclipse.linuxtools.rpm.ui.editor.parser.SpecfileElement in project linuxtools by eclipse.
the class SpecfileContentOutlinePage method selectionChanged.
/*
* Change in selection
*/
@Override
public void selectionChanged(SelectionChangedEvent event) {
super.selectionChanged(event);
// find out which item in tree viewer we have selected, and set
// highlight range accordingly
IStructuredSelection selection = event.getStructuredSelection();
if (selection.isEmpty()) {
editor.resetHighlightRange();
} else {
SpecfileElement element = (SpecfileElement) selection.getFirstElement();
int start = element.getLineStartPosition();
try {
editor.setHighlightRange(start, 1, true);
} catch (IllegalArgumentException e) {
editor.resetHighlightRange();
}
}
}
Aggregations