Search in sources :

Example 1 with ReferenceSearchResult

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);
            }
        }
    }
}
Also used : TreeViewer(org.eclipse.jface.viewers.TreeViewer) ReferenceSearchResult(org.eclipse.xtext.ui.editor.findrefs.ReferenceSearchResult) IReferenceDescription(org.eclipse.xtext.resource.IReferenceDescription)

Aggregations

TreeViewer (org.eclipse.jface.viewers.TreeViewer)1 IReferenceDescription (org.eclipse.xtext.resource.IReferenceDescription)1 ReferenceSearchResult (org.eclipse.xtext.ui.editor.findrefs.ReferenceSearchResult)1