use of org.talend.sqlbuilder.erdiagram.ui.ErDiagramComposite in project tdi-studio-se by Talend.
the class ErdiagramDiagramEditor method updateSqlText.
public void updateSqlText() {
if (rulerComp.getParent() instanceof ErDiagramComposite) {
ErDiagramComposite erComposite = (ErDiagramComposite) rulerComp.getParent();
erComposite.updateSql();
}
}
use of org.talend.sqlbuilder.erdiagram.ui.ErDiagramComposite in project tdi-studio-se by Talend.
the class SQLBuilderDesignerComposite method createDesignerArea.
/**
* qzhang Comment method "createDesignerArea".
*
* @param composite
*/
private void createDesignerArea(SQLBuilderDesignerComposite composite, List<IRepositoryNode> nodes) {
// create divider line
Composite div1 = new Composite(composite, SWT.NONE);
GridData lgid = new GridData();
lgid.grabExcessHorizontalSpace = true;
lgid.horizontalAlignment = GridData.FILL;
lgid.heightHint = 1;
lgid.verticalIndent = 1;
div1.setLayoutData(lgid);
div1.setBackground(composite.getShell().getDisplay().getSystemColor(SWT.COLOR_WIDGET_NORMAL_SHADOW));
erDiagramComposite = new ErDiagramComposite(composite, SWT.VERTICAL);
erDiagramComposite.setDialog(dialog);
erDiagramComposite.setRootNode(repositoryNode);
erDiagramComposite.setNodes(nodes, connParam.isShowDesignerPage());
erDiagramComposite.setWeights(new int[] { 12, 3 });
}
use of org.talend.sqlbuilder.erdiagram.ui.ErDiagramComposite 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