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);
}
}
Aggregations