Example usage for org.eclipse.jface.internal.provisional.action ICoolBarManager2 refresh

List of usage examples for org.eclipse.jface.internal.provisional.action ICoolBarManager2 refresh

Introduction

In this page you can find the example usage for org.eclipse.jface.internal.provisional.action ICoolBarManager2 refresh.

Prototype

public void refresh();

Source Link

Document

Synchronizes the visual order of the cool items in the control with this manager's internal data structures.

Usage

From source file:org.eclipse.ui.internal.EditorManager.java

License:Open Source License

void disposeEditorActionBars(EditorActionBars actionBars) {
    actionBars.removeRef();// w  ww  .j a  va2  s.  co m
    if (actionBars.getRef() <= 0) {
        String type = actionBars.getEditorType();
        actionCache.remove(type);
        // refresh the cool bar manager before disposing of a cool item
        ICoolBarManager2 coolBar = (ICoolBarManager2) window.getCoolBarManager2();
        if (coolBar != null) {
            coolBar.refresh();
        }
        actionBars.dispose();
    }
}

From source file:org.eclipse.ui.internal.EditorReference.java

License:Open Source License

public static void disposeEditorActionBars(EditorActionBars actionBars) {
    actionBars.removeRef();//from  w ww. j ava 2  s .c o  m
    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();
    }
}

From source file:org.eclipse.ui.internal.WorkbenchWindow.java

License:Open Source License

/**
 * Update the visible action sets. This method is typically called from a
 * page when the user changes the visible action sets within the
 * prespective./*from  w ww.jav a 2 s . c om*/
 */
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
}