Search in sources :

Example 1 with AddTablesDialog

use of org.talend.sqlbuilder.erdiagram.ui.AddTablesDialog in project tdi-studio-se by Talend.

the class TableAddAction method run.

/*
     * (non-Java)
     * 
     * @see org.eclipse.jface.action.Action#run()
     */
//$NON-NLS-1$
@SuppressWarnings("unchecked")
@Override
public void run() {
    ErdiagramDiagramEditor erdiagramDiagramEditor = (ErdiagramDiagramEditor) part;
    Control control = erdiagramDiagramEditor.getGraphicalControl();
    AddTablesDialog dialog = new AddTablesDialog(new Shell(control.getShell()));
    if (control.getParent() instanceof ErDiagramComposite) {
        if (EMFRepositoryNodeManager.getInstance().getRoot() == null) {
            return;
        }
        dialog.setRootNode(EMFRepositoryNodeManager.getInstance().getRoot());
    }
    if (Window.OK == dialog.open()) {
        List tables1 = dialog.getTables();
        this.execute(createCreateCommand((ErDiagram) erdiagramDiagramEditor.getViewer().getContents().getModel(), tables1));
    }
}
Also used : ErdiagramDiagramEditor(org.talend.sqlbuilder.erdiagram.ui.editor.ErdiagramDiagramEditor) ErDiagramComposite(org.talend.sqlbuilder.erdiagram.ui.ErDiagramComposite) Control(org.eclipse.swt.widgets.Control) Shell(org.eclipse.swt.widgets.Shell) ErDiagram(org.talend.sqlbuilder.erdiagram.ui.nodes.ErDiagram) AddTablesDialog(org.talend.sqlbuilder.erdiagram.ui.AddTablesDialog) List(java.util.List)

Aggregations

List (java.util.List)1 Control (org.eclipse.swt.widgets.Control)1 Shell (org.eclipse.swt.widgets.Shell)1 AddTablesDialog (org.talend.sqlbuilder.erdiagram.ui.AddTablesDialog)1 ErDiagramComposite (org.talend.sqlbuilder.erdiagram.ui.ErDiagramComposite)1 ErdiagramDiagramEditor (org.talend.sqlbuilder.erdiagram.ui.editor.ErdiagramDiagramEditor)1 ErDiagram (org.talend.sqlbuilder.erdiagram.ui.nodes.ErDiagram)1