Search in sources :

Example 1 with ErDiagramComposite

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();
    }
}
Also used : ErDiagramComposite(org.talend.sqlbuilder.erdiagram.ui.ErDiagramComposite)

Example 2 with ErDiagramComposite

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 });
}
Also used : ErDiagramComposite(org.talend.sqlbuilder.erdiagram.ui.ErDiagramComposite) ErDiagramComposite(org.talend.sqlbuilder.erdiagram.ui.ErDiagramComposite) Composite(org.eclipse.swt.widgets.Composite) GridData(org.eclipse.swt.layout.GridData)

Example 3 with ErDiagramComposite

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

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