Search in sources :

Example 1 with SQLBuilderDesignerComposite

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

the class MultiPageSqlBuilderEditor method createPages.

/*
     * (non-Java)
     * 
     * @see org.eclipse.ui.part.MultiPageEditorPart#createPages()
     */
@Override
protected void createPages() {
    try {
        sqlEdit = new SQLBuilderEditorComposite(this.getContainer(), tabItem, isDefaultEditor, connParam, rootNode, dialog, readOnly);
        sqlEdit.setEditorContent(connParam);
        sqlEdit.setRepositoryNode(rootNode);
        sqlEdit.setQueryObject(dialog.getConnParameters().getQueryObject());
        sqlEdit.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
        sqlEdit.setMultiPageEditor(this);
        int index = addPage(sqlEdit);
        //$NON-NLS-1$
        setPageText(index, Messages.getString("MultiPageSqlBuilderEditor.EditTab.Text"));
        EMFRepositoryNodeManager.getInstance().setPrompt(false);
        sqlDesigner = new SQLBuilderDesignerComposite(this.getContainer(), tabItem, isDefaultEditor, connParam, rootNode, dialog, nodes, readOnly);
        sqlDesigner.setSqlText(sqlEdit.getSQLToBeExecuted());
        sqlDesigner.setEditorContent(connParam);
        // sqlDesigner.setQueryObject(dialog.getConnParameters().getQueryObject());
        sqlDesigner.setMaxResult(sqlEdit.getMaxResult());
        sqlDesigner.setIfLimit(sqlEdit.getIfLimit());
        sqlDesigner.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
        sqlDesigner.setMultiPageEditor(this);
        EMFRepositoryNodeManager.getInstance().setPrompt(true);
        erDiagramComposite = sqlDesigner.getErDiagramComposite();
        index = addPage(sqlDesigner);
        //$NON-NLS-1$
        setPageText(index, Messages.getString("MultiPageSqlBuilderEditor.DesignerTab.Text"));
        attachListeners();
        // reset the sql to avoid 007813
        sqlEdit.setEditorContent(connParam);
    } catch (Exception e) {
        //$NON-NLS-1$
        MessageDialog.openError(//$NON-NLS-1$
        getContainer().getShell(), //$NON-NLS-1$
        Messages.getString("MultiPageSqlBuilderEditor.ErrorTitle"), //$NON-NLS-1$
        Messages.getString("MultiPageSqlBuilderEditor.ErrorInfo") + e.getMessage());
    }
}
Also used : SQLBuilderDesignerComposite(org.talend.sqlbuilder.ui.SQLBuilderDesignerComposite) SQLBuilderEditorComposite(org.talend.sqlbuilder.ui.SQLBuilderEditorComposite) GridData(org.eclipse.swt.layout.GridData)

Aggregations

GridData (org.eclipse.swt.layout.GridData)1 SQLBuilderDesignerComposite (org.talend.sqlbuilder.ui.SQLBuilderDesignerComposite)1 SQLBuilderEditorComposite (org.talend.sqlbuilder.ui.SQLBuilderEditorComposite)1