use of com.cubrid.common.ui.spi.action.ActionManager in project cubrid-manager by CUBRID.
the class ActionAdvisor method showMenu.
public void showMenu(IMenuManager menuManager) {
ActionManager manager = ActionManager.getInstance();
MenuManager fileMenu = new MenuManager(Messages.mnu_fileMenuName, IActionConstants.MENU_FILE);
MenuManager editMenu = new MenuManager(Messages.mnu_editMenuName, IActionConstants.MENU_EDIT);
MenuManager toolsMenu = new MenuManager(Messages.mnu_toolsMenuName, IActionConstants.MENU_TOOLS);
MenuManager actionMenu = new MenuManager(Messages.mnu_actionMenuName, IActionConstants.MENU_ACTION);
// MenuManager helpMenu = new MenuManager(Messages.mnu_helpMneuName,
// IWorkbenchActionConstants.M_HELP);
// fill in file menu
fileMenu.add(manager.getAction(ConnectHostAction.ID));
fileMenu.add(manager.getAction(DisConnectHostAction.ID));
fileMenu.add(new Separator());
fileMenu.add(manager.getAction(AddHostAction.ID));
fileMenu.add(manager.getAction(EditHostAction.ID));
fileMenu.add(manager.getAction(DeleteHostAction.ID));
fileMenu.add(new Separator());
fileMenu.add(manager.getAction(CubridServerImportAction.ID));
fileMenu.add(manager.getAction(CubridServerExportAction.ID));
fileMenu.add(new Separator());
fileMenu.add(closeAction);
fileMenu.add(closeAllAction);
fileMenu.add(new Separator());
fileMenu.add(manager.getAction(OpenQueryAction.ID));
fileMenu.add(saveAction);
fileMenu.add(saveasAction);
fileMenu.add(saveAllAction);
fileMenu.add(new Separator());
// fileMenu.add(manager.getAction(OpenSchemaEditorAction.ID));
// fileMenu.add(new Separator());
fileMenu.add(manager.getAction(RestoreQueryEditorAction.ID));
fileMenu.add(new Separator());
fileMenu.add(manager.getAction(ImportHostsAction.ID));
fileMenu.add(SelectWorkspaceDialog.getWorkspaceMenu(ApplicationType.CUBRID_MANAGER.getShortName(), Version.buildVersionId));
fileMenu.add(new Separator());
ActionContributionItem preferencesActionItem = new ActionContributionItem(preferenceAction);
fileMenu.add(preferencesActionItem);
if (Util.isMac()) {
preferencesActionItem.setVisible(false);
}
fileMenu.add(manager.getAction(RefreshAction.ID));
fileMenu.add(new Separator());
fileMenu.add(quitAction);
fileMenu.add(new Separator());
// fill in edit menu
editMenu.add(undoRetargetAction);
editMenu.add(redoRetargetAction);
editMenu.add(new Separator());
editMenu.add(copyRetargetAction);
editMenu.add(cutRetargetAction);
editMenu.add(pasteRetargetAction);
editMenu.add(new Separator());
editMenu.add(findRetargetAction);
editMenu.add(manager.getAction(GotoLineAction.ID));
// fill in the run menu
toolsMenu.add(manager.getAction(QueryNewAction.ID));
toolsMenu.add(manager.getAction(QueryNewCustomAction.ID));
toolsMenu.add(new Separator());
toolsMenu.add(manager.getAction(StartServiceAction.ID));
toolsMenu.add(manager.getAction(StopServiceAction.ID));
toolsMenu.add(new Separator());
toolsMenu.add(manager.getAction(StartDatabaseAction.ID));
toolsMenu.add(manager.getAction(StopDatabaseAction.ID));
toolsMenu.add(new Separator());
toolsMenu.add(manager.getAction(StartBrokerEnvAction.ID));
toolsMenu.add(manager.getAction(StopBrokerEnvAction.ID));
toolsMenu.add(new Separator());
toolsMenu.add(manager.getAction(ChangeManagerPasswordAction.ID));
toolsMenu.add(manager.getAction(UserManagementAction.ID));
toolsMenu.add(new Separator());
toolsMenu.add(manager.getAction(BrokerLogParserAction.ID));
toolsMenu.add(manager.getAction(BrokerLogTopMergeAction.ID));
toolsMenu.add(new Separator());
toolsMenu.add(manager.getAction(SchemaCommentInstallAction.ID));
toolsMenu.add(manager.getAction(ServiceDashboardAction.ID));
menuManager.insertBefore(getMenuInsertPoint(menuManager), fileMenu);
menuManager.insertBefore(getMenuInsertPoint(menuManager), editMenu);
menuManager.insertBefore(getMenuInsertPoint(menuManager), toolsMenu);
menuManager.insertBefore(getMenuInsertPoint(menuManager), actionMenu);
menuManager.update(true);
}
use of com.cubrid.common.ui.spi.action.ActionManager in project cubrid-manager by CUBRID.
the class CubridStatusLineContrItem method updateStatusLineForRestoreQueryEditor.
private void updateStatusLineForRestoreQueryEditor() {
final int countOfRestorableQueryEditors = ApplicationPersistUtil.getInstance().countOfRestorableQueryEditorsAtLastSession();
if (countOfRestorableQueryEditors <= 0) {
return;
}
IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
StatusLineManager statusLineManager = null;
if (window instanceof WorkbenchWindow) {
statusLineManager = ((WorkbenchWindow) window).getStatusLineManager();
}
if (statusLineManager == null) {
return;
}
IContributionItem scaleItem = new ControlContribution(RESTORE_QUERY_EDITORS_CONTR_ID) {
protected Control createControl(Composite parent) {
Button btn = new Button(parent, SWT.None);
String buttonTitle = Messages.bind(com.cubrid.common.ui.common.Messages.restoreQueryEditorTitle, countOfRestorableQueryEditors);
btn.setText(buttonTitle);
btn.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
ActionManager manager = ActionManager.getInstance();
IAction action = manager.getAction(RestoreQueryEditorAction.ID);
if (action != null && action instanceof RestoreQueryEditorAction) {
action.run();
}
}
});
return btn;
}
;
};
statusLineManager.add(scaleItem);
}
use of com.cubrid.common.ui.spi.action.ActionManager in project cubrid-manager by CUBRID.
the class ApplicationActionBarAdvisor method fillMenuBar.
/**
* Fills the menu bar with the main menus for the window.
*
* @param menuBar the menu bar manager
*/
protected void fillMenuBar(IMenuManager menuManager) {
ActionManager manager = ActionManager.getInstance();
MenuManager helpMenu = new MenuManager(Messages.mnu_helpMneuName, IWorkbenchActionConstants.M_HELP);
helpMenu.add(manager.getAction(HelpDocumentAction.ID));
// fill in help menu
if ("ko".equals(Messages.language)) {
helpMenu.add(newFeatureAction);
}
helpMenu.add(new Separator());
helpMenu.add(reportBugAction);
helpMenu.add(new Separator());
helpMenu.add(cubridOnlineForumAction);
helpMenu.add(cubridProjectSiteAction);
helpMenu.add(new Separator());
helpMenu.add(new GroupMarker("updates"));
helpMenu.add(new Separator());
helpMenu.add(manager.getAction(ViewServerVersionAction.ID));
helpMenu.add(new Separator());
ActionContributionItem aboutActionItem = new ActionContributionItem(aboutAction);
helpMenu.add(aboutActionItem);
if (Util.isMac()) {
aboutActionItem.setVisible(false);
}
menuManager.add(helpMenu);
}
use of com.cubrid.common.ui.spi.action.ActionManager in project cubrid-manager by CUBRID.
the class ApplicationActionBarAdvisor method makeActions.
/**
* Instantiates the actions used in the fill methods.
*
* @see org.eclipse.ui.application.ActionBarAdvisor#makeActions(org.eclipse
* .ui.IWorkbenchWindow)
*
* @param window the window containing the action bars
*/
protected void makeActions(IWorkbenchWindow window) {
ActionManager manager = ActionManager.getInstance();
CubridActionBuilder.init();
serviceDashboardAction = (ServiceDashboardAction) manager.getAction(ServiceDashboardAction.ID);
if (serviceDashboardAction != null) {
serviceDashboardAction.setText(com.cubrid.common.ui.spi.Messages.serviceDashboardActionName);
register(serviceDashboardAction);
}
// customized actions for CUBRID Manager
//common action
preferenceAction = new OpenPreferenceAction(window.getShell(), Messages.openPreferenceActionName, null);
register(preferenceAction);
// It must be needed to use a Preferences Menu of an Application Menu on Mac.
preferenceAction.setId("preferences");
manager.registerAction(preferenceAction);
quitAction = new QuitAction(Messages.exitActionName);
cubridOnlineForumAction = new CubridOnlineForumAction(Messages.cubridOnlineForumActionName);
cubridProjectSiteAction = new CubridProjectSiteAction(Messages.cubridProjectSiteActionName);
aboutAction = new AboutAction(Messages.aboutActionName, Version.productName, Version.buildVersionId, CubridManagerAppPlugin.getImageDescriptor("icons/cubridmanager16.gif"), CubridManagerAppPlugin.getImageDescriptor("icons/about.gif"));
// It must be needed to use a About Menu of an Application Menu on Mac.
aboutAction.setId("about");
clientVersionAction = new AboutAction(Messages.clientVersionActionName, Version.productName, Version.buildVersionId, CubridManagerAppPlugin.getImageDescriptor("icons/cubridmanager16.gif"), CubridManagerAppPlugin.getImageDescriptor("icons/about.gif"));
newFeatureAction = new NewFeaturesAction(com.cubrid.common.ui.common.Messages.msgNewFeatures);
reportBugAction = (ReportBugAction) manager.getAction(ReportBugAction.ID);
reportBugAction.setCurrentVersion(Version.buildVersionId);
}
Aggregations