Search in sources :

Example 1 with ICoolBarManager

use of org.eclipse.jface.action.ICoolBarManager 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);
    }
}
Also used : WorkbenchWindow(org.eclipse.ui.internal.WorkbenchWindow) IMenuManager(org.eclipse.jface.action.IMenuManager) ICoolBarManager(org.eclipse.jface.action.ICoolBarManager)

Example 2 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;
        }
        if (item instanceof MenuManager) {
            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)

Example 3 with ICoolBarManager

use of org.eclipse.jface.action.ICoolBarManager 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 cubridNavigatorView = CubridNavigatorView.findNavigationView();
    if (cubridNavigatorView != null) {
        cubridNavigatorView.setFocus();
    }
}
Also used : WorkbenchWindow(org.eclipse.ui.internal.WorkbenchWindow) CubridNavigatorView(com.cubrid.common.ui.common.navigator.CubridNavigatorView) IMenuManager(org.eclipse.jface.action.IMenuManager) ICoolBarManager(org.eclipse.jface.action.ICoolBarManager)

Example 4 with ICoolBarManager

use of org.eclipse.jface.action.ICoolBarManager 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);
    }
}
Also used : WorkbenchWindow(org.eclipse.ui.internal.WorkbenchWindow) IMenuManager(org.eclipse.jface.action.IMenuManager) ICoolBarManager(org.eclipse.jface.action.ICoolBarManager)

Example 5 with ICoolBarManager

use of org.eclipse.jface.action.ICoolBarManager 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);
        }
    }
}
Also used : WorkbenchWindow(org.eclipse.ui.internal.WorkbenchWindow) CubridNavigatorView(com.cubrid.common.ui.common.navigator.CubridNavigatorView) IMenuManager(org.eclipse.jface.action.IMenuManager) 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