Search in sources :

Example 1 with PartFactory

use of com.cubrid.common.ui.er.part.PartFactory in project cubrid-manager by CUBRID.

the class ERSchemaEditor method createGraphicalViewer.

private ScrollingGraphicalViewer createGraphicalViewer(IEditorSite editorSite, Composite parent) {
    StatusLineValidationMessageHandler messageHandler = new StatusLineValidationMessageHandler(editorSite);
    ScrollingGraphicalViewer viewer = new ValidationGraphicalViewer(messageHandler);
    viewer.createControl(parent);
    viewer.getControl().setBackground(ColorConstants.white);
    viewer.setRootEditPart(new ERScalableFreeformRootEditPart());
    viewer.setEditPartFactory(new PartFactory());
    viewer.setKeyHandler(new GraphicalViewerKeyHandler(viewer));
    viewer.setProperty(SnapToGrid.PROPERTY_GRID_VISIBLE, true);
    viewer.setProperty(SnapToGrid.PROPERTY_GRID_ENABLED, true);
    viewer.setProperty(SnapToGrid.PROPERTY_GRID_SPACING, new Dimension(10, 10));
    viewer.setProperty(SnapToGrid.PROPERTY_GRID_ORIGIN, new Point(5, 5));
    return viewer;
}
Also used : ScrollingGraphicalViewer(org.eclipse.gef.ui.parts.ScrollingGraphicalViewer) ValidationGraphicalViewer(com.cubrid.common.ui.er.ValidationGraphicalViewer) StatusLineValidationMessageHandler(com.cubrid.common.ui.er.directedit.StatusLineValidationMessageHandler) PartFactory(com.cubrid.common.ui.er.part.PartFactory) GraphicalViewerKeyHandler(org.eclipse.gef.ui.parts.GraphicalViewerKeyHandler) Dimension(org.eclipse.draw2d.geometry.Dimension) Point(org.eclipse.draw2d.geometry.Point)

Aggregations

ValidationGraphicalViewer (com.cubrid.common.ui.er.ValidationGraphicalViewer)1 StatusLineValidationMessageHandler (com.cubrid.common.ui.er.directedit.StatusLineValidationMessageHandler)1 PartFactory (com.cubrid.common.ui.er.part.PartFactory)1 Dimension (org.eclipse.draw2d.geometry.Dimension)1 Point (org.eclipse.draw2d.geometry.Point)1 GraphicalViewerKeyHandler (org.eclipse.gef.ui.parts.GraphicalViewerKeyHandler)1 ScrollingGraphicalViewer (org.eclipse.gef.ui.parts.ScrollingGraphicalViewer)1