Search in sources :

Example 1 with ICoolBarManager2

use of org.eclipse.jface.internal.provisional.action.ICoolBarManager2 in project eclipse.platform.ui by eclipse-platform.

the class WorkbenchPage method resetToolBarLayout.

/**
 */
public void resetToolBarLayout() {
    ICoolBarManager2 mgr = (ICoolBarManager2) legacyWindow.getCoolBarManager2();
    mgr.resetItemOrder();
}
Also used : ICoolBarManager2(org.eclipse.jface.internal.provisional.action.ICoolBarManager2)

Example 2 with ICoolBarManager2

use of org.eclipse.jface.internal.provisional.action.ICoolBarManager2 in project eclipse.platform.ui by eclipse-platform.

the class EditorReference method disposeEditorActionBars.

public static void disposeEditorActionBars(EditorActionBars actionBars) {
    actionBars.removeRef();
    if (actionBars.getRef() <= 0) {
        String type = actionBars.getEditorType();
        Set<EditorActionBars> set = actionCache.get(type);
        if (set != null) {
            set.remove(actionBars);
        }
        // refresh the cool bar manager before disposing of a cool item
        ICoolBarManager2 coolBar = (ICoolBarManager2) ((WorkbenchWindow) actionBars.getPage().getWorkbenchWindow()).getCoolBarManager2();
        if (coolBar != null) {
            coolBar.refresh();
        }
        actionBars.dispose();
    }
}
Also used : ICoolBarManager2(org.eclipse.jface.internal.provisional.action.ICoolBarManager2)

Example 3 with ICoolBarManager2

use of org.eclipse.jface.internal.provisional.action.ICoolBarManager2 in project eclipse.platform.ui by eclipse-platform.

the class WorkbenchWindow method updateActionSets.

/**
 * Update the visible action sets. This method is typically called from a page
 * when the user changes the visible action sets within the prespective.
 */
public void updateActionSets() {
    if (updateDisabled) {
        return;
    }
    WorkbenchPage currentPage = (WorkbenchPage) getActivePage();
    if (currentPage == null) {
        getActionPresentation().clearActionSets();
    } else {
        ICoolBarManager2 coolBarManager = (ICoolBarManager2) getCoolBarManager2();
        if (coolBarManager != null) {
            coolBarManager.refresh();
        }
        getActionPresentation().setActionSets(currentPage.getActionSets());
    }
    fireActionSetsChanged();
    updateActionBars();
    // hide the launch menu if it is empty
    String path = IWorkbenchActionConstants.M_WINDOW + IWorkbenchActionConstants.SEP + IWorkbenchActionConstants.M_LAUNCH;
    IMenuManager manager = getMenuBarManager().findMenuUsingPath(path);
    IContributionItem item = getMenuBarManager().findUsingPath(path);
    if (manager == null || item == null) {
        return;
    }
    item.setVisible(manager.getItems().length >= 2);
// there is a separator for the additions group thus >= 2
}
Also used : ICoolBarManager2(org.eclipse.jface.internal.provisional.action.ICoolBarManager2) IWorkbenchPage(org.eclipse.ui.IWorkbenchPage) IContributionItem(org.eclipse.jface.action.IContributionItem) IMenuManager(org.eclipse.jface.action.IMenuManager)

Aggregations

ICoolBarManager2 (org.eclipse.jface.internal.provisional.action.ICoolBarManager2)3 IContributionItem (org.eclipse.jface.action.IContributionItem)1 IMenuManager (org.eclipse.jface.action.IMenuManager)1 IWorkbenchPage (org.eclipse.ui.IWorkbenchPage)1