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));
}
}
Aggregations