use of org.eclipse.jface.action.IMenuManager in project cubrid-manager by CUBRID.
the class PerspectiveChangedListener method hidePerspectiveHide.
public void hidePerspectiveHide(PerspectiveChangeEvent event) {
WorkbenchWindow window = (WorkbenchWindow) PlatformUI.getWorkbench().getActiveWorkbenchWindow();
if (window != null) {
ICoolBarManager coolBarManager = window.getCoolBarManager2();
IMenuManager menuManager = window.getMenuBarManager();
ActionAdvisor.getInstance().hideToolbar(coolBarManager);
ActionAdvisor.getInstance().hideMenu(menuManager);
}
}
use of org.eclipse.jface.action.IMenuManager in project cubrid-manager by CUBRID.
the class TextEditorContributor method contributeToMenu.
/**
* Contributes to the given menu.
*
* @param menuManager the manager that controls the menu
*/
public void contributeToMenu(IMenuManager menuManager) {
super.contributeToMenu(menuManager);
MenuManager drawMenu = new MenuManager("&Edit", IWorkbenchActionConstants.M_EDIT);
menuManager.add(drawMenu);
drawMenu.add(getAction(ActionFactory.UNDO.getId()));
drawMenu.add(getAction(ActionFactory.REDO.getId()));
drawMenu.add(new Separator());
drawMenu.add(getAction(ActionFactory.COPY.getId()));
drawMenu.add(getAction(ActionFactory.CUT.getId()));
drawMenu.add(getAction(ActionFactory.PASTE.getId()));
drawMenu.add(new Separator());
drawMenu.add(getAction(ActionFactory.FIND.getId()));
IAction action = getAction(ActionConstants.ACTION_FORMAT);
if (action != null) {
drawMenu.add(new Separator());
drawMenu.add(getAction(ActionConstants.ACTION_FORMAT));
}
}
use of org.eclipse.jface.action.IMenuManager 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);
// fill in file menu
fileMenu.add(manager.getAction(OpenQueryConnAction.ID));
fileMenu.add(manager.getAction(CloseQueryConnAction.ID));
fileMenu.add(new Separator());
fileMenu.add(manager.getAction(NewQueryConnAction.ID));
fileMenu.add(manager.getAction(EditQueryConnAction.ID));
fileMenu.add(manager.getAction(DeleteQueryConnAction.ID));
fileMenu.add(new Separator());
fileMenu.add(manager.getAction(ConnectionUrlImportAction.ID));
fileMenu.add(manager.getAction(ConnectionUrlExportAction.ID));
fileMenu.add(new Separator());
fileMenu.add(manager.getAction(ConnectionImportAction.ID));
fileMenu.add(manager.getAction(ConnectionExportAction.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(RestoreQueryEditorAction.ID));
fileMenu.add(new Separator());
fileMenu.add(manager.getAction(ImportConnsAction.ID));
fileMenu.add(SelectWorkspaceDialog.getWorkspaceMenu(ApplicationType.CUBRID_QUERY_BROWSER.getShortName(), Version.buildVersionId));
fileMenu.add(new Separator());
ActionContributionItem preferencesActionItem = new ActionContributionItem(preferenceAction);
fileMenu.add(preferencesActionItem);
if (Util.isMac()) {
}
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 tools menu
toolsMenu.add(manager.getAction(QueryNewAction.ID));
toolsMenu.add(manager.getAction(QueryNewCustomAction.ID));
toolsMenu.add(new Separator());
toolsMenu.add(manager.getAction(OIDNavigatorAction.ID));
toolsMenu.add(new Separator());
toolsMenu.add(manager.getAction(NewTableAction.ID));
toolsMenu.add(manager.getAction(CreateViewAction.ID));
toolsMenu.add(new Separator());
toolsMenu.add(manager.getAction(CreateSerialAction.ID));
toolsMenu.add(new Separator());
toolsMenu.add(manager.getAction(NewTriggerAction.ID));
toolsMenu.add(new Separator());
toolsMenu.add(manager.getAction(AddFunctionAction.ID));
toolsMenu.add(manager.getAction(AddProcedureAction.ID));
toolsMenu.add(new Separator());
toolsMenu.add(manager.getAction(ExportWizardAction.ID));
toolsMenu.add(manager.getAction(ImportWizardAction.ID));
// toolsMenu.add(new Separator());
// fileMenu.add(manager.getAction(OpenSchemaEditorAction.ID));
fileMenu.add(new Separator());
IMenuManager perparedMenu = new MenuManager(com.cubrid.common.ui.spi.Messages.preparedTableDataMenuName);
toolsMenu.add(perparedMenu);
perparedMenu.add(manager.getAction(PstmtOneDataAction.ID));
perparedMenu.add(manager.getAction(PstmtMultiDataAction.ID));
toolsMenu.add(new Separator());
toolsMenu.add(manager.getAction(BrokerLogParserAction.ID));
toolsMenu.add(manager.getAction(BrokerLogTopMergeAction.ID));
toolsMenu.add(manager.getAction(BrokerConfOpenFileAction.ID));
toolsMenu.add(new Separator());
toolsMenu.add(manager.getAction(SchemaCommentInstallAction.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 org.eclipse.jface.action.IMenuManager in project cubrid-manager by CUBRID.
the class PerspectiveChangedListener method showPerspective.
public void showPerspective(PerspectiveChangeEvent event) {
WorkbenchWindow window = (WorkbenchWindow) PlatformUI.getWorkbench().getActiveWorkbenchWindow();
if (window != null) {
ICoolBarManager coolBarManager = window.getCoolBarManager2();
IMenuManager menuManager = window.getMenuBarManager();
ActionAdvisor.getInstance().showToolbar(coolBarManager);
ActionAdvisor.getInstance().showMenu(menuManager);
}
ActionManager.getInstance().setMenuProvider(menuProvider);
LayoutManager.getInstance().setStatusLineContrItem(cubridStatusLineContrItem);
LayoutManager.getInstance().setTitleLineContrItem(cubridTitleLineContrItem);
cubridTitleLineContrItem.changeTitleForNavigator(null);
LayoutManager.getInstance().setWorkbenchContrItem(cubridWorkbenchContrItem);
CubridNavigatorView navigatorView = CubridNavigatorView.findNavigationView();
if (navigatorView != null) {
navigatorView.setFocus();
if (navigatorView.getViewer() != null) {
navigatorView.getViewer().refresh(true);
}
}
}
use of org.eclipse.jface.action.IMenuManager in project cubrid-manager by CUBRID.
the class ApplicationWorkbenchWindowAdvisor method removePlatformDependencyActions.
private void removePlatformDependencyActions() {
// remove some menu items
IMenuManager mm = getWindowConfigurer().getActionBarConfigurer().getMenuManager();
for (IContributionItem item : mm.getItems()) {
if (item == null) {
continue;
}
MenuManager sm = (MenuManager) item;
for (IContributionItem sitem : sm.getItems()) {
if (sitem == null || sitem.getId() == null) {
continue;
}
if (sitem.getId().equals("org.eclipse.ui.actions.showKeyAssistHandler") || sitem.getId().equals("com.cubrid.common.update.p2.menu.install") || sitem.getId().equals("converstLineDelimitersTo") || sitem.getId().equals("save.ext") || sitem.getId().equals("org.eclipse.ui.openLocalFile") || sitem.getId().equals("new.ext")) {
sm.remove(sitem.getId());
sm.update(true);
mm.update(true);
}
}
}
// remove some tool bar items
ICoolBarManager cm = getWindowConfigurer().getActionBarConfigurer().getCoolBarManager();
for (IContributionItem item : cm.getItems()) {
if (item == null || item.getId() == null) {
continue;
}
if (item.getId().equals("org.eclipse.ui.edit.text.actionSet.annotationNavigation") || item.getId().equals("org.eclipse.ui.edit.text.actionSet.navigation")) {
cm.remove(item.getId());
cm.update(true);
}
}
// remove some preference items
PreferenceManager pm = getWindowConfigurer().getWindow().getWorkbench().getPreferenceManager();
for (IPreferenceNode item : pm.getRootSubNodes()) {
if (item.getId().equals("org.eclipse.help.ui.browsersPreferencePage") || item.getId().equals("org.eclipse.ui.preferencePages.Workbench")) {
pm.remove(item.getId());
}
}
}
Aggregations