use of org.eclipse.wst.xsd.ui.internal.adt.design.editparts.RootEditPart 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.RootEditPart in project webtools.sourceediting by eclipse.
the class CommonMultiPageEditor method configureGraphicalViewer.
protected void configureGraphicalViewer() {
graphicalViewer.getControl().setBackground(ColorConstants.listBackground);
// Set the root edit part
// ScalableFreeformRootEditPart root = new ScalableFreeformRootEditPart();
RootEditPart root = new RootEditPart();
ZoomManager zoomManager = root.getZoomManager();
List zoomLevelContributions = new ArrayList(3);
zoomLevelContributions.add(ZoomManager.FIT_ALL);
zoomLevelContributions.add(ZoomManager.FIT_WIDTH);
zoomLevelContributions.add(ZoomManager.FIT_HEIGHT);
zoomManager.setZoomLevelContributions(zoomLevelContributions);
double[] zoomLevels = { .10, .25, .5, .75, 1.0, 1.25, 1.5, 2.0, 2.5, 3, 4, 5 };
zoomManager.setZoomLevels(zoomLevels);
IAction zoomIn = new ZoomInAction(zoomManager);
IAction zoomOut = new ZoomOutAction(zoomManager);
getActionRegistry().registerAction(zoomIn);
getActionRegistry().registerAction(zoomOut);
getSite().getKeyBindingService().registerAction(zoomIn);
getSite().getKeyBindingService().registerAction(zoomOut);
// ConnectionLayer connectionLayer = (ConnectionLayer) root.getLayer(LayerConstants.CONNECTION_LAYER);
// connectionLayer.setConnectionRouter(new BendpointConnectionRouter());
// connectionLayer.setConnectionRouter(new ShortestPathConnectionRouter(connectionLayer));
// connectionLayer.setVisible(false);
// Zoom
zoomManager.setZoom(1.0);
// Scroll-wheel Zoom
graphicalViewer.setProperty(MouseWheelHandler.KeyGenerator.getKey(SWT.CTRL), MouseWheelZoomHandler.SINGLETON);
graphicalViewer.setRootEditPart(root);
graphicalViewer.setEditPartFactory(getEditPartFactory());
}
Aggregations