use of org.eclipse.jface.action.CoolBarManager 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);
}
Aggregations