Search in sources :

Example 1 with MultiPageEditorTextSelectionNavigationLocation

use of org.eclipse.wst.xsd.ui.internal.navigation.MultiPageEditorTextSelectionNavigationLocation in project webtools.sourceediting by eclipse.

the class InternalXSDMultiPageEditor method createNavigationLocation.

public INavigationLocation createNavigationLocation() {
    if (getActivePage() == DESIGN_PAGE_INDEX) {
        try {
            RootEditPart rootEditPart = graphicalViewer.getRootEditPart();
            EditPart editPart = rootEditPart.getContents();
            if (editPart instanceof RootContentEditPart) {
                RootContentEditPart rootContentEditPart = (RootContentEditPart) editPart;
                Object input = rootContentEditPart.getInput();
                if (input instanceof Adapter) {
                    XSDConcreteComponent concreteComponent = (XSDConcreteComponent) ((Adapter) input).getTarget();
                    Object object = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor().getAdapter(ProductCustomizationProvider.class);
                    if (object instanceof ProductCustomizationProvider) {
                        ProductCustomizationProvider productCustomizationProvider = (ProductCustomizationProvider) object;
                        if (productCustomizationProvider != null) {
                            return productCustomizationProvider.getNavigationLocation(this, concreteComponent, rootContentEditPart);
                        }
                    }
                    return new DesignViewNavigationLocation(this, concreteComponent);
                }
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    } else {
        return new MultiPageEditorTextSelectionNavigationLocation(getTextEditor(), true);
    }
}
Also used : XSDConcreteComponent(org.eclipse.xsd.XSDConcreteComponent) DesignViewNavigationLocation(org.eclipse.wst.xsd.ui.internal.navigation.DesignViewNavigationLocation) RootEditPart(org.eclipse.gef.RootEditPart) GraphicalEditPart(org.eclipse.gef.GraphicalEditPart) EditPart(org.eclipse.gef.EditPart) RootContentEditPart(org.eclipse.wst.xsd.ui.internal.adt.design.editparts.RootContentEditPart) EObject(org.eclipse.emf.ecore.EObject) IADTObject(org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObject) XSDRedefineAdapter(org.eclipse.wst.xsd.ui.internal.adapters.XSDRedefineAdapter) INodeAdapter(org.eclipse.wst.sse.core.internal.provisional.INodeAdapter) Adapter(org.eclipse.emf.common.notify.Adapter) CategoryAdapter(org.eclipse.wst.xsd.ui.internal.adapters.CategoryAdapter) XSDModelAdapter(org.eclipse.wst.xsd.ui.internal.text.XSDModelAdapter) XSDBaseAdapter(org.eclipse.wst.xsd.ui.internal.adapters.XSDBaseAdapter) RedefineCategoryAdapter(org.eclipse.wst.xsd.ui.internal.adapters.RedefineCategoryAdapter) RootContentEditPart(org.eclipse.wst.xsd.ui.internal.adt.design.editparts.RootContentEditPart) ProductCustomizationProvider(org.eclipse.wst.xsd.ui.internal.adt.editor.ProductCustomizationProvider) MultiPageEditorTextSelectionNavigationLocation(org.eclipse.wst.xsd.ui.internal.navigation.MultiPageEditorTextSelectionNavigationLocation) RootEditPart(org.eclipse.gef.RootEditPart)

Aggregations

Adapter (org.eclipse.emf.common.notify.Adapter)1 EObject (org.eclipse.emf.ecore.EObject)1 EditPart (org.eclipse.gef.EditPart)1 GraphicalEditPart (org.eclipse.gef.GraphicalEditPart)1 RootEditPart (org.eclipse.gef.RootEditPart)1 INodeAdapter (org.eclipse.wst.sse.core.internal.provisional.INodeAdapter)1 CategoryAdapter (org.eclipse.wst.xsd.ui.internal.adapters.CategoryAdapter)1 RedefineCategoryAdapter (org.eclipse.wst.xsd.ui.internal.adapters.RedefineCategoryAdapter)1 XSDBaseAdapter (org.eclipse.wst.xsd.ui.internal.adapters.XSDBaseAdapter)1 XSDRedefineAdapter (org.eclipse.wst.xsd.ui.internal.adapters.XSDRedefineAdapter)1 RootContentEditPart (org.eclipse.wst.xsd.ui.internal.adt.design.editparts.RootContentEditPart)1 ProductCustomizationProvider (org.eclipse.wst.xsd.ui.internal.adt.editor.ProductCustomizationProvider)1 IADTObject (org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObject)1 DesignViewNavigationLocation (org.eclipse.wst.xsd.ui.internal.navigation.DesignViewNavigationLocation)1 MultiPageEditorTextSelectionNavigationLocation (org.eclipse.wst.xsd.ui.internal.navigation.MultiPageEditorTextSelectionNavigationLocation)1 XSDModelAdapter (org.eclipse.wst.xsd.ui.internal.text.XSDModelAdapter)1 XSDConcreteComponent (org.eclipse.xsd.XSDConcreteComponent)1