Search in sources :

Example 1 with INavigatable

use of org.eclipse.xtext.ide.editor.navigation.INavigatable in project xtext-eclipse by eclipse.

the class NavigationService method open.

public void open(INavigatable navigatable, boolean select) {
    if (navigatable != null) {
        Object navigatableElement = navigatable.getNavigationElement();
        if (navigatableElement instanceof IReferenceDescription) {
            IReferenceDescription referenceDescription = (IReferenceDescription) navigatableElement;
            // 
            uriEditorOpener.open(// 
            referenceDescription.getSourceEObjectUri(), // 
            referenceDescription.getEReference(), // 
            referenceDescription.getIndexInList(), select);
        } else if (navigatableElement instanceof IEObjectDescription) {
            uriEditorOpener.open(((IEObjectDescription) navigatableElement).getEObjectURI(), select);
        } else if (navigatableElement instanceof IResourceDescription) {
            uriEditorOpener.open(((IResourceDescription) navigatableElement).getURI(), select);
        } else if (navigatableElement instanceof INavigatable) {
            open((INavigatable) navigatableElement, select);
        }
    }
}
Also used : IResourceDescription(org.eclipse.xtext.resource.IResourceDescription) INavigatable(org.eclipse.xtext.ide.editor.navigation.INavigatable) IReferenceDescription(org.eclipse.xtext.resource.IReferenceDescription) IEObjectDescription(org.eclipse.xtext.resource.IEObjectDescription)

Aggregations

INavigatable (org.eclipse.xtext.ide.editor.navigation.INavigatable)1 IEObjectDescription (org.eclipse.xtext.resource.IEObjectDescription)1 IReferenceDescription (org.eclipse.xtext.resource.IReferenceDescription)1 IResourceDescription (org.eclipse.xtext.resource.IResourceDescription)1