Example usage for org.eclipse.jface.action CoolBarManager refresh

List of usage examples for org.eclipse.jface.action CoolBarManager refresh

Introduction

In this page you can find the example usage for org.eclipse.jface.action CoolBarManager 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:com.nokia.tools.ui.ide.ToolbarHider.java

License:Open Source License

protected void hideExternToolBar() {
    setVisibleForListedIds(false);/* w ww  . j av a2  s.c  om*/
    CoolBar coolBar = getMainCoolBar();
    if (null == coolBar)
        return;
    for (CoolItem item : ((CoolBar) coolBar).getItems()) {
        // check disposed, can happen when reset perspective
        if (!item.isDisposed() && item.getData() instanceof ToolBarContributionItem) {
            ToolBarContributionItem toolbaritem = ((ToolBarContributionItem) item.getData());

            if (shouldRemoveGroup(toolbaritem)) {
                CoolBarManager mngr = (CoolBarManager) toolbaritem.getParent();
                if (null == mngr) {

                    mngr = ((ApplicationWindow) PlatformUI.getWorkbench().getActiveWorkbenchWindow())
                            .getCoolBarManager();
                    toolbaritem.setParent(mngr);
                    mngr.refresh();

                }
                IContributionItem remitem = mngr.remove(toolbaritem);
                if (null != remitem)
                    removedItems.add(remitem);
                mngr.update(true);
            }

        }
    }
}