use of com.cubrid.cubridquery.ui.common.action.QuitAction in project cubrid-manager by CUBRID.
the class ActionAdvisor method init.
private void init() {
IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
if (window != null) {
// standard actions provided by the workbench
closeAction = ActionFactory.CLOSE.create(window);
closeAction.setText(Messages.closeActionName);
// register(closeAction);
closeAllAction = ActionFactory.CLOSE_ALL.create(window);
closeAllAction.setText(Messages.closeAllActionName);
// register(closeAllAction);
saveAction = ActionFactory.SAVE.create(window);
saveAction.setText(Messages.saveActionName);
// register(saveAction);
saveasAction = ActionFactory.SAVE_AS.create(window);
saveasAction.setText(Messages.saveAsActionName);
// register(saveasAction);
saveAllAction = ActionFactory.SAVE_ALL.create(window);
saveAllAction.setText(Messages.saveAllActionName);
// register(saveAllAction);
// retarget actions provided by the workbench
undoRetargetAction = ActionFactory.UNDO.create(window);
undoRetargetAction.setText(com.cubrid.common.ui.spi.Messages.undoActionName);
// register(undoRetargetAction);
redoRetargetAction = ActionFactory.REDO.create(window);
redoRetargetAction.setText(com.cubrid.common.ui.spi.Messages.redoActionName);
// register(redoRetargetAction);
copyRetargetAction = ActionFactory.COPY.create(window);
copyRetargetAction.setText(com.cubrid.common.ui.spi.Messages.copyActionName);
// register(copyRetargetAction);
cutRetargetAction = ActionFactory.CUT.create(window);
cutRetargetAction.setText(com.cubrid.common.ui.spi.Messages.cutActionName);
// register(cutRetargetAction);
pasteRetargetAction = ActionFactory.PASTE.create(window);
pasteRetargetAction.setText(com.cubrid.common.ui.spi.Messages.pasteActionName);
// register(pasteRetargetAction);
findRetargetAction = ActionFactory.FIND.create(window);
findRetargetAction.setText(com.cubrid.common.ui.spi.Messages.findReplaceActionName);
// register(findRetargetAction);
// customized actions for CUBRID Manager
// common action
preferenceAction = new OpenPreferenceAction(window.getShell(), Messages.openPreferenceActionName, null);
// register(preferenceAction);
// It must be needed to use a
preferenceAction.setId("preferences");
// Preferences Menu of an
// Application Menu on Mac.
ActionManager.getInstance().registerAction(preferenceAction);
quitAction = new QuitAction(Messages.exitActionName);
reportBugAction = (ReportBugAction) ActionManager.getInstance().getAction(ReportBugAction.ID);
reportBugAction.setCurrentVersion(Version.buildVersionId);
// Add proxy action for toolbar
ProxyAction newConnectionAction = new ProxyAction(NewQueryConnAction.ID, com.cubrid.cubridquery.ui.spi.Messages.createConnActionNameBig, Activator.getImageDescriptor("icons/toolbar/qb_new_database_on.png"), Activator.getImageDescriptor("icons/toolbar/qb_new_database_off.png"));
ActionManager.getInstance().registerAction(newConnectionAction);
ProxyAction newQueryAction = new ProxyAction(QueryNewAction.ID, com.cubrid.common.ui.spi.Messages.queryNewActionNameBig, Activator.getImageDescriptor("icons/toolbar/qb_new_query_on.png"), Activator.getImageDescriptor("icons/toolbar/qb_new_query_off.png"));
ActionManager.getInstance().registerAction(newQueryAction);
ProxyAction newCustomQueryAction = new ProxyAction(QueryNewCustomAction.ID, com.cubrid.common.ui.spi.Messages.queryNewCustomActionName.replaceAll("\\.", ""), Activator.getImageDescriptor("icons/toolbar/qb_new_query_on.png"), Activator.getImageDescriptor("icons/toolbar/qb_new_query_off.png"));
ActionManager.getInstance().registerAction(newCustomQueryAction);
ProxyAction newTableAction = new ProxyAction(NewTableAction.ID, com.cubrid.common.ui.spi.Messages.tableNewActionName.replaceAll("\\.", ""), Activator.getImageDescriptor("icons/toolbar/qb_new_table_on.png"), Activator.getImageDescriptor("icons/toolbar/qb_new_table_off.png"));
ActionManager.getInstance().registerAction(newTableAction);
ProxyAction newViewAction = new ProxyAction(CreateViewAction.ID, com.cubrid.common.ui.spi.Messages.createViewActionName.replaceAll("\\.", ""), Activator.getImageDescriptor("icons/toolbar/qb_new_view_on.png"), Activator.getImageDescriptor("icons/toolbar/qb_new_view_off.png"));
ActionManager.getInstance().registerAction(newViewAction);
ProxyAction newSerialAction = new ProxyAction(CreateSerialAction.ID, com.cubrid.common.ui.spi.Messages.createSerialActionName.replaceAll("\\.", ""), Activator.getImageDescriptor("icons/toolbar/qb_new_serial_on.png"), Activator.getImageDescriptor("icons/toolbar/qb_new_serial_off.png"));
ActionManager.getInstance().registerAction(newSerialAction);
ProxyAction newTriggerAction = new ProxyAction(NewTriggerAction.ID, com.cubrid.common.ui.spi.Messages.newTriggerActionName.replaceAll("\\.", ""), Activator.getImageDescriptor("icons/toolbar/qb_new_trigger_on.png"), Activator.getImageDescriptor("icons/toolbar/qb_new_trigger_off.png"));
ActionManager.getInstance().registerAction(newTriggerAction);
ProxyAction importAction = new ProxyAction(ImportWizardAction.ID, com.cubrid.common.ui.spi.Messages.tableImportActionName.replaceAll("\\.", ""), Activator.getImageDescriptor("icons/toolbar/qb_import_on.png"), Activator.getImageDescriptor("icons/toolbar/qb_import_off.png"));
ActionManager.getInstance().registerAction(importAction);
ProxyAction exportAction = new ProxyAction(ExportWizardAction.ID, com.cubrid.common.ui.spi.Messages.tableExportActionName.replaceAll("\\.", ""), Activator.getImageDescriptor("icons/toolbar/qb_export_on.png"), Activator.getImageDescriptor("icons/toolbar/qb_export_off.png"));
ActionManager.getInstance().registerAction(exportAction);
ProxyAction openSchemaEditorAction = new ProxyAction(OpenSchemaEditorAction.ID, com.cubrid.common.ui.spi.Messages.schemaDesignerActionName, CommonUIPlugin.getImageDescriptor("icons/action/schema_edit_on.png"), CommonUIPlugin.getImageDescriptor("icons/action/schema_edit_off.png"));
ActionManager.getInstance().registerAction(openSchemaEditorAction);
ProxyAction refreshAction = new ProxyAction(RefreshAction.ID, com.cubrid.cubridquery.ui.spi.Messages.refreshActionName, Activator.getImageDescriptor("icons/toolbar/refresh_32.png"), Activator.getImageDescriptor("icons/toolbar/refresh_32_disabled.png"));
ActionManager.getInstance().registerAction(refreshAction);
ProxyAction reportBugProxyAction = new ProxyAction(ReportBugAction.ID, Messages.reportBugProxyAction, Activator.getImageDescriptor("icons/toolbar/qb_new_bug.png"), null);
ActionManager.getInstance().registerAction(reportBugProxyAction);
}
}
Aggregations