Search in sources :

Example 1 with NodeDropTargetListener

use of org.jkiss.dbeaver.ext.erd.dnd.NodeDropTargetListener in project dbeaver by serge-rider.

the class ERDEditorPart method createViewer.

private GraphicalViewer createViewer(Composite parent) {
    StatusLineValidationMessageHandler validationMessageHandler = new StatusLineValidationMessageHandler(getEditorSite());
    GraphicalViewer viewer = new ERDGraphicalViewer(this, validationMessageHandler);
    viewer.createControl(parent);
    // configure the viewer
    viewer.getControl().setBackground(ColorConstants.white);
    rootPart = new ScalableFreeformRootEditPart();
    viewer.setRootEditPart(rootPart);
    viewer.setKeyHandler(new GraphicalViewerKeyHandler(viewer));
    viewer.addDropTargetListener(new DataEditDropTargetListener(viewer));
    viewer.addDropTargetListener(new NodeDropTargetListener(viewer));
    // initialize the viewer with input
    viewer.setEditPartFactory(new ERDEditPartFactory());
    return viewer;
}
Also used : DataEditDropTargetListener(org.jkiss.dbeaver.ext.erd.dnd.DataEditDropTargetListener) StatusLineValidationMessageHandler(org.jkiss.dbeaver.ext.erd.directedit.StatusLineValidationMessageHandler) NodeDropTargetListener(org.jkiss.dbeaver.ext.erd.dnd.NodeDropTargetListener) ScalableFreeformRootEditPart(org.eclipse.gef.editparts.ScalableFreeformRootEditPart) GraphicalViewerKeyHandler(org.eclipse.gef.ui.parts.GraphicalViewerKeyHandler)

Example 2 with NodeDropTargetListener

use of org.jkiss.dbeaver.ext.erd.dnd.NodeDropTargetListener in project dbeaver by dbeaver.

the class ERDEditorPart method createViewer.

private GraphicalViewer createViewer(Composite parent) {
    StatusLineValidationMessageHandler validationMessageHandler = new StatusLineValidationMessageHandler(getEditorSite());
    GraphicalViewer viewer = new ERDGraphicalViewer(this, validationMessageHandler);
    viewer.createControl(parent);
    // configure the viewer
    viewer.getControl().setBackground(UIUtils.getColorRegistry().get(ERDConstants.COLOR_ERD_DIAGRAM_BACKGROUND));
    rootPart = new ScalableFreeformRootEditPart();
    viewer.setRootEditPart(rootPart);
    viewer.setKeyHandler(new GraphicalViewerKeyHandler(viewer));
    viewer.addDropTargetListener(new DataEditDropTargetListener(viewer));
    viewer.addDropTargetListener(new NodeDropTargetListener(viewer));
    // initialize the viewer with input
    viewer.setEditPartFactory(new ERDEditPartFactory());
    return viewer;
}
Also used : DataEditDropTargetListener(org.jkiss.dbeaver.ext.erd.dnd.DataEditDropTargetListener) StatusLineValidationMessageHandler(org.jkiss.dbeaver.ext.erd.directedit.StatusLineValidationMessageHandler) NodeDropTargetListener(org.jkiss.dbeaver.ext.erd.dnd.NodeDropTargetListener) ScalableFreeformRootEditPart(org.eclipse.gef.editparts.ScalableFreeformRootEditPart) GraphicalViewerKeyHandler(org.eclipse.gef.ui.parts.GraphicalViewerKeyHandler)

Aggregations

ScalableFreeformRootEditPart (org.eclipse.gef.editparts.ScalableFreeformRootEditPart)2 GraphicalViewerKeyHandler (org.eclipse.gef.ui.parts.GraphicalViewerKeyHandler)2 StatusLineValidationMessageHandler (org.jkiss.dbeaver.ext.erd.directedit.StatusLineValidationMessageHandler)2 DataEditDropTargetListener (org.jkiss.dbeaver.ext.erd.dnd.DataEditDropTargetListener)2 NodeDropTargetListener (org.jkiss.dbeaver.ext.erd.dnd.NodeDropTargetListener)2