use of org.eclipse.xtext.ui.editor.findrefs.ReferenceSearchResult in project dsl-devkit by dsldevkit.
the class FastReferenceSearchResultContentProvider method inputChanged.
@Override
public void inputChanged(final Viewer v, final Object oldInput, final Object newInput) {
synchronized (v) {
rootNodes.clear();
if (oldInput instanceof ReferenceSearchResult) {
((ReferenceSearchResult) oldInput).removeListener(this);
}
if (newInput instanceof ReferenceSearchResult && v instanceof TreeViewer) {
((ReferenceSearchResult) newInput).addListener(this);
this.viewer = (TreeViewer) v;
for (IReferenceDescription referenceDescription : ((ReferenceSearchResult) newInput).getMatchingReferences()) {
addReference(referenceDescription);
}
}
}
}
Aggregations