Search in sources :

Example 11 with ERDEditorPart

use of org.jkiss.dbeaver.ext.erd.editor.ERDEditorPart in project dbeaver by dbeaver.

the class FlyoutChangeLayoutAction method run.

@Override
public void run() {
    if (editor instanceof ERDEditorPart) {
        ERDEditorPart erdEditor = (ERDEditorPart) editor;
        EntityDiagram entityDiagram = erdEditor.getDiagram();
        boolean isManual = entityDiagram.isLayoutManualDesired();
        entityDiagram.setLayoutManualDesired(!isManual);
        erdEditor.getDiagramPart().changeLayout();
        checked = !isManual;
        setChecked(checked);
    }
}
Also used : EntityDiagram(org.jkiss.dbeaver.ext.erd.model.EntityDiagram) ERDEditorPart(org.jkiss.dbeaver.ext.erd.editor.ERDEditorPart)

Example 12 with ERDEditorPart

use of org.jkiss.dbeaver.ext.erd.editor.ERDEditorPart in project dbeaver by dbeaver.

the class FlyoutChangeLayoutAction method isChecked.

/**
 * @see org.eclipse.jface.action.IAction#isChecked()
 */
public boolean isChecked(IEditorPart editor) {
    if (editor instanceof ERDEditorPart) {
        ERDEditorPart schemaEditor = (ERDEditorPart) editor;
        EntityDiagram entityDiagram = schemaEditor.getDiagram();
        boolean checkTrue = entityDiagram.isLayoutManualDesired();
        return (!checkTrue);
    } else {
        return false;
    }
}
Also used : EntityDiagram(org.jkiss.dbeaver.ext.erd.model.EntityDiagram) ERDEditorPart(org.jkiss.dbeaver.ext.erd.editor.ERDEditorPart)

Aggregations

ERDEditorPart (org.jkiss.dbeaver.ext.erd.editor.ERDEditorPart)12 Control (org.eclipse.swt.widgets.Control)6 DeleteAction (org.eclipse.gef.ui.actions.DeleteAction)4 EntityDiagram (org.jkiss.dbeaver.ext.erd.model.EntityDiagram)4 Point (org.eclipse.draw2d.geometry.Point)2 SelectAllAction (org.eclipse.gef.ui.actions.SelectAllAction)2 EntityAddCommand (org.jkiss.dbeaver.ext.erd.command.EntityAddCommand)2 ERDEntity (org.jkiss.dbeaver.ext.erd.model.ERDEntity)2 DBPNamedObject (org.jkiss.dbeaver.model.DBPNamedObject)2