Search in sources :

Example 1 with SaveSQLAction

use of org.talend.sqlbuilder.actions.SaveSQLAction in project tdi-studio-se by Talend.

the class AbstractSQLEditorComposite method createToolBar.

/**
     * qzhang Comment method "createToolBar".
     */
protected void createToolBar() {
    // create coolbar
    coolBar = new CoolBar(this, SWT.NONE);
    coolBarMgr = new CoolBarManager(coolBar);
    GridData gid = new GridData();
    gid.horizontalAlignment = GridData.FILL;
    coolBar.setLayoutData(gid);
    // initialize default actions
    defaultToolBarMgr = new ToolBarManager(SWT.NONE);
    execSQLAction = new ExecSQLAction(SQLResultComposite.getInstance(), this);
    openFileAction = new OpenFileAction();
    openFileAction.setEditor(this);
    saveSQLAction = new SaveSQLAction(getRepositoryNode(), connParam);
    saveSQLAction.setEditor(this);
    saveAsSQLAction = new SaveAsSQLAction(getRepositoryNode(), connParam);
    saveAsSQLAction.setEditor(this);
    exportAction = new SaveFileAsAction();
    exportAction.setEditor(this);
    clearTextAction = new ClearTextAction();
    clearTextAction.setEditor(this);
    guiModificationQueryAction = new GUIModificationQueryAction(getRepositoryNode(), connParam, dialog);
    guiModificationQueryAction.setEditor(this);
    // initialize hyWang's ACTION
    contextModeAction = new ContextModeAction(getRepositoryNode(), connParam);
    addDefaultActions();
    // initialize session actions
    sessionToolBarMgr = new ToolBarManager(SWT.NONE);
    sessionSwitcher = new SQLEditorSessionSwitcher(this);
    sessionToolBarMgr.add(sessionSwitcher);
    // initialize hyWang's BUTTON and TOOLBAR
    contextToolBarMgr = new ToolBarManager(SWT.NONE);
    contextmode = new ContextModeSessionSwitcher(this, contextModeAction);
    contextToolBarMgr.add(contextmode);
    // add all toolbars to parent coolbar
    coolBar.setLocked(true);
    coolBarMgr.add(new ToolBarContributionItem(defaultToolBarMgr));
    coolBarMgr.add(new ToolBarContributionItem(sessionToolBarMgr));
    // add hyWang's toolbar to coolbar
    coolBarMgr.add(new ToolBarContributionItem(contextToolBarMgr));
    coolBarMgr.update(true);
}
Also used : CoolBarManager(org.eclipse.jface.action.CoolBarManager) SaveAsSQLAction(org.talend.sqlbuilder.actions.SaveAsSQLAction) SaveFileAsAction(org.talend.sqlbuilder.actions.SaveFileAsAction) ExecSQLAction(org.talend.sqlbuilder.actions.ExecSQLAction) SaveSQLAction(org.talend.sqlbuilder.actions.SaveSQLAction) SQLEditorSessionSwitcher(org.talend.sqlbuilder.actions.SQLEditorSessionSwitcher) ContextModeSessionSwitcher(org.talend.sqlbuilder.actions.ContextModeSessionSwitcher) ToolBarManager(org.eclipse.jface.action.ToolBarManager) ToolBarContributionItem(org.eclipse.jface.action.ToolBarContributionItem) OpenFileAction(org.talend.sqlbuilder.actions.OpenFileAction) CoolBar(org.eclipse.swt.widgets.CoolBar) ClearTextAction(org.talend.sqlbuilder.actions.ClearTextAction) GridData(org.eclipse.swt.layout.GridData) ContextModeAction(org.talend.sqlbuilder.actions.ContextModeAction) GUIModificationQueryAction(org.talend.sqlbuilder.actions.GUIModificationQueryAction)

Aggregations

CoolBarManager (org.eclipse.jface.action.CoolBarManager)1 ToolBarContributionItem (org.eclipse.jface.action.ToolBarContributionItem)1 ToolBarManager (org.eclipse.jface.action.ToolBarManager)1 GridData (org.eclipse.swt.layout.GridData)1 CoolBar (org.eclipse.swt.widgets.CoolBar)1 ClearTextAction (org.talend.sqlbuilder.actions.ClearTextAction)1 ContextModeAction (org.talend.sqlbuilder.actions.ContextModeAction)1 ContextModeSessionSwitcher (org.talend.sqlbuilder.actions.ContextModeSessionSwitcher)1 ExecSQLAction (org.talend.sqlbuilder.actions.ExecSQLAction)1 GUIModificationQueryAction (org.talend.sqlbuilder.actions.GUIModificationQueryAction)1 OpenFileAction (org.talend.sqlbuilder.actions.OpenFileAction)1 SQLEditorSessionSwitcher (org.talend.sqlbuilder.actions.SQLEditorSessionSwitcher)1 SaveAsSQLAction (org.talend.sqlbuilder.actions.SaveAsSQLAction)1 SaveFileAsAction (org.talend.sqlbuilder.actions.SaveFileAsAction)1 SaveSQLAction (org.talend.sqlbuilder.actions.SaveSQLAction)1