Search in sources :

Example 1 with StatusLineValidationMessageHandler

use of org.jkiss.dbeaver.ext.erd.directedit.StatusLineValidationMessageHandler 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)

Aggregations

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