Search in sources :

Example 6 with ICoolBarManager

use of org.eclipse.jface.action.ICoolBarManager 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());
        }
    }
}
Also used : IContributionItem(org.eclipse.jface.action.IContributionItem) MenuManager(org.eclipse.jface.action.MenuManager) IMenuManager(org.eclipse.jface.action.IMenuManager) IMenuManager(org.eclipse.jface.action.IMenuManager) IPreferenceNode(org.eclipse.jface.preference.IPreferenceNode) PreferenceManager(org.eclipse.jface.preference.PreferenceManager) ICoolBarManager(org.eclipse.jface.action.ICoolBarManager)

Aggregations

ICoolBarManager (org.eclipse.jface.action.ICoolBarManager)6 IMenuManager (org.eclipse.jface.action.IMenuManager)6 WorkbenchWindow (org.eclipse.ui.internal.WorkbenchWindow)4 CubridNavigatorView (com.cubrid.common.ui.common.navigator.CubridNavigatorView)2 IContributionItem (org.eclipse.jface.action.IContributionItem)2 MenuManager (org.eclipse.jface.action.MenuManager)2 IPreferenceNode (org.eclipse.jface.preference.IPreferenceNode)2 PreferenceManager (org.eclipse.jface.preference.PreferenceManager)2