use of org.eclipse.wst.xsd.ui.internal.adt.design.editparts.RootContentEditPart in project webtools.sourceediting by eclipse.
the class InternalXSDMultiPageEditor method initializeGraphicalViewer.
protected void initializeGraphicalViewer() {
RootContentEditPart root = new RootContentEditPart();
if (!(getEditorInput() instanceof IADTEditorInput)) {
root.setModel(model);
}
graphicalViewer.setContents(root);
}
use of org.eclipse.wst.xsd.ui.internal.adt.design.editparts.RootContentEditPart in project webtools.sourceediting by eclipse.
the class XSDGraphViewerDialog method createDialogArea.
protected Control createDialogArea(Composite parent) {
viewer = new ScrollingGraphicalViewer();
Composite c = (Composite) super.createDialogArea(parent);
if (isHighContrast) {
c.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
} else {
c.setBackground(ColorConstants.white);
}
c.setLayout(new FillLayout());
RootEditPart root = new RootEditPart();
viewer.setRootEditPart(root);
viewer.createControl(c);
// The graphical viewer tool tip processing creates an extra shell which
// interferes with the PopupDialog's deactivation logic.
removeMouseListeners(viewer.getControl());
if (isHighContrast) {
viewer.getControl().setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
} else {
viewer.getControl().setBackground(ColorConstants.white);
}
EditPartFactory editPartFactory = new XSDEditPartFactory(new TypeVizFigureFactory());
viewer.setEditPartFactory(editPartFactory);
RootContentEditPart rootContentEditPart = new RootContentEditPart();
rootContentEditPart.setModel(model);
viewer.setContents(rootContentEditPart);
getShell().addControlListener(moveListener);
return c;
}
use of org.eclipse.wst.xsd.ui.internal.adt.design.editparts.RootContentEditPart in project webtools.sourceediting by eclipse.
the class TopLevelComponentEditPart method performDrillDownAction.
protected void performDrillDownAction() {
Runnable runnable = new Runnable() {
public void run() {
EditPart editPart = ((AbstractEditPartViewer) getViewer()).getRootEditPart().getContents();
if (editPart instanceof RootContentEditPart) {
IEditorPart editorPart = getEditorPart();
// ActionRegistry registry = (ActionRegistry) editorPart.getAdapter(ActionRegistry.class);
// IAction action = registry.getAction(SetInputToGraphView.ID);
// action.run();
ActionRegistry registry = (ActionRegistry) editorPart.getAdapter(ActionRegistry.class);
if (registry != null) {
IAction action = registry.getAction(OpenInNewEditor.ID);
if (action != null)
action.run();
return;
}
}
}
};
Display.getCurrent().asyncExec(runnable);
}
use of org.eclipse.wst.xsd.ui.internal.adt.design.editparts.RootContentEditPart 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);
}
}
use of org.eclipse.wst.xsd.ui.internal.adt.design.editparts.RootContentEditPart in project webtools.sourceediting by eclipse.
the class DesignViewGraphicalViewer method setInput.
public void setInput(IADTObject object) {
RootContentEditPart rootContentEditPart = (RootContentEditPart) getRootEditPart().getContents();
rootContentEditPart.setModel(object);
rootContentEditPart.refresh();
if (object != null) {
inputChangeManager.setSelection(new StructuredSelection(object));
}
// Select the editpart when it is set as input
EditPart editPart = getEditPart(rootContentEditPart, object);
if (editPart != null)
select(editPart);
}
Aggregations