Search in sources :

Example 6 with FreeformGraphicalRootEditPart

use of org.eclipse.gef.editparts.FreeformGraphicalRootEditPart in project dbeaver by serge-rider.

the class LockGraphicalView method createPartControl.

@Override
public void createPartControl(Composite parent) {
    setEditDomain(new DefaultEditDomain(null));
    setGraphicalViewer(new ScrollingGraphicalViewer());
    getGraphicalViewer().createControl(parent);
    getGraphicalViewer().setRootEditPart(new FreeformGraphicalRootEditPart());
    getGraphicalViewer().setEditPartFactory(new LockGraphEditPartFactory());
    getGraphicalViewer().setContextMenu(new ContextMenuProvider(graphicalViewer) {

        @Override
        public void buildContextMenu(IMenuManager menu) {
            menu.add(viewer.getKillAction());
        }
    });
}
Also used : ScrollingGraphicalViewer(org.eclipse.gef.ui.parts.ScrollingGraphicalViewer) FreeformGraphicalRootEditPart(org.eclipse.gef.editparts.FreeformGraphicalRootEditPart) IMenuManager(org.eclipse.jface.action.IMenuManager) DefaultEditDomain(org.eclipse.gef.DefaultEditDomain) ContextMenuProvider(org.eclipse.gef.ContextMenuProvider)

Aggregations

FreeformGraphicalRootEditPart (org.eclipse.gef.editparts.FreeformGraphicalRootEditPart)6 GraphicalViewerImpl (org.eclipse.gef.ui.parts.GraphicalViewerImpl)3 ArchimateDiagramEditPartFactory (com.archimatetool.editor.diagram.editparts.ArchimateDiagramEditPartFactory)2 SketchEditPartFactory (com.archimatetool.editor.diagram.sketch.editparts.SketchEditPartFactory)2 IArchimateDiagramModel (com.archimatetool.model.IArchimateDiagramModel)2 IDiagramModel (com.archimatetool.model.IDiagramModel)2 ISketchModel (com.archimatetool.model.ISketchModel)2 ContextMenuProvider (org.eclipse.gef.ContextMenuProvider)2 DefaultEditDomain (org.eclipse.gef.DefaultEditDomain)2 ScrollingGraphicalViewer (org.eclipse.gef.ui.parts.ScrollingGraphicalViewer)2 IMenuManager (org.eclipse.jface.action.IMenuManager)2 Shell (org.eclipse.swt.widgets.Shell)2 Test (org.junit.Test)2 IDiagramEditorFactory (com.archimatetool.editor.diagram.IDiagramEditorFactory)1 SchemaDiagramPart (com.cubrid.common.ui.er.part.SchemaDiagramPart)1 Point (org.eclipse.draw2d.geometry.Point)1 EditPart (org.eclipse.gef.EditPart)1 EditPartFactory (org.eclipse.gef.EditPartFactory)1 RootEditPart (org.eclipse.gef.RootEditPart)1