use of org.talend.sqlbuilder.erdiagram.ui.editor.ErdiagramDiagramEditor in project tdi-studio-se by Talend.
the class ErDiagramComposite method addErDiagramEditor.
/**
* admin Comment method "addErDiagramEditor".
*/
//$NON-NLS-1$
@SuppressWarnings("unchecked")
private void addErDiagramEditor(boolean isShowDesignerPage) {
GridData gridData = new GridData(GridData.FILL_BOTH);
this.setLayoutData(gridData);
GridLayout layout = new GridLayout();
layout.verticalSpacing = 0;
layout.marginLeft = 0;
layout.marginRight = 0;
layout.marginBottom = 0;
layout.marginTop = 0;
layout.marginHeight = 0;
layout.marginWidth = 0;
layout.numColumns = 1;
this.setLayout(layout);
editor = new ErdiagramDiagramEditor();
editor.createPartControl(this);
editor.getViewer().setContents(createErDiagram(isShowDesignerPage));
Control control = editor.getGraphicalControl();
if (control != null) {
control.setParent(this);
control.setLayoutData(gridData);
}
layout = new GridLayout();
layout.marginLeft = 0;
layout.marginRight = 0;
layout.marginBottom = 0;
layout.marginTop = 0;
layout.marginHeight = 0;
layout.marginWidth = 0;
gridData = new GridData(GridData.FILL_HORIZONTAL);
gridData.heightHint = 30;
int textstyle = SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL;
sqlText = new ColorStyledText(this, textstyle, CorePlugin.getDefault().getPreferenceStore(), language);
sqlText.setLayoutData(gridData);
//$NON-NLS-1$
sqlText.setText("");
sqlText.setBackground(getBackground());
sqlText.addModifyListener(new ModifyListener() {
/*
* (non-Javadoc)
*
* @see org.eclipse.swt.events.ModifyListener#modifyText(org.eclipse.swt.events.ModifyEvent)
*/
public void modifyText(ModifyEvent e) {
sqlString = sqlText.getText();
}
});
}
use of org.talend.sqlbuilder.erdiagram.ui.editor.ErdiagramDiagramEditor 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