Search in sources :

Example 11 with ERDEditorPart

use of org.jkiss.dbeaver.erd.ui.editor.ERDEditorPart in project dbeaver by serge-rider.

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.erd.ui.model.EntityDiagram) ERDEditorPart(org.jkiss.dbeaver.erd.ui.editor.ERDEditorPart)

Example 12 with ERDEditorPart

use of org.jkiss.dbeaver.erd.ui.editor.ERDEditorPart in project dbeaver by serge-rider.

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.erd.ui.model.EntityDiagram) ERDEditorPart(org.jkiss.dbeaver.erd.ui.editor.ERDEditorPart)

Aggregations

ERDEditorPart (org.jkiss.dbeaver.erd.ui.editor.ERDEditorPart)12 Control (org.eclipse.swt.widgets.Control)6 DeleteAction (org.eclipse.gef.ui.actions.DeleteAction)4 EntityDiagram (org.jkiss.dbeaver.erd.ui.model.EntityDiagram)4 InvocationTargetException (java.lang.reflect.InvocationTargetException)2 Point (org.eclipse.draw2d.geometry.Point)2 Command (org.eclipse.gef.commands.Command)2 SelectAllAction (org.eclipse.gef.ui.actions.SelectAllAction)2 ERDEntity (org.jkiss.dbeaver.erd.model.ERDEntity)2 DiagramCollectSettingsDefault (org.jkiss.dbeaver.erd.ui.model.DiagramCollectSettingsDefault)2 DBPNamedObject (org.jkiss.dbeaver.model.DBPNamedObject)2