Example usage for org.eclipse.jface.action IMenuManager markDirty

List of usage examples for org.eclipse.jface.action IMenuManager markDirty

Introduction

In this page you can find the example usage for org.eclipse.jface.action IMenuManager markDirty.

Prototype

void markDirty();

Source Link

Document

Marks this contribution manager as dirty.

Usage

From source file:com.nokia.tools.variant.carbidev.BetterReopenEditorMenu.java

License:Open Source License

public BetterReopenEditorMenu(IWorkbenchWindow window, String id, boolean showSeparator) {
    super(id);/*from  ww w .java2  s.co  m*/
    dirty = true;
    menuListener = new IMenuListener() {

        public void menuAboutToShow(IMenuManager manager) {
            OpenCpfAction.clearHistoryTable();
            manager.markDirty();
            dirty = true;
        }

    };
    this.window = window;
    this.showSeparator = showSeparator;
    history = ((Workbench) window.getWorkbench()).getEditorHistory();
}

From source file:com.nokia.tools.variant.editor.editors.CPFEditor.java

License:Open Source License

protected void contextMenuAboutToShow(IMenuManager menu, Control parent) {

    menu.add(selectAll);//from w ww.  ja  va  2s.c o m
    menu.add(deselectAll);
    menu.add(new Separator());
    menu.add(clearSettingAction);
    menu.add(resetToDefaults);
    menu.add(new Separator());
    menu.add(hideFromView);
    menu.add(removeSequenceItemsAction);

    menu.add(new Separator());
    menu.add(cutAction);
    menu.add(copyAction);
    menu.add(pasteAction);
    menu.add(deleteAction);
    menu.add(new Separator());

    if (dirty) {
        menu.markDirty();
    }
    updateEditActionState(getSelection());
}

From source file:de.loskutov.bco.views.BytecodeOutlineView.java

License:Open Source License

protected void toggleVerifyMode(final IMenuManager mmanager, boolean showAnalyzer) {
    setMode(BCOConstants.F_SHOW_ANALYZER, showAnalyzer);
    if (modes.get(BCOConstants.F_SHOW_ANALYZER)) {
        ((StackLayout) stackComposite.getLayout()).topControl = verifyControl;
        viewSelectionProvider.setCurrentSelectionProvider(tableControlViewer);
    } else {//from   w ww  .  ja v  a  2 s. c o m
        ((StackLayout) stackComposite.getLayout()).topControl = textControl;
        viewSelectionProvider.setCurrentSelectionProvider(textViewer);
    }
    stackComposite.layout();

    for (int i = 0; i < toggleOrientationActions.length; ++i) {
        toggleOrientationActions[i].setEnabled(showAnalyzer);
    }
    mmanager.markDirty();
    mmanager.update();
}

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

License:Open Source License

/**
 * Mark the menu manager as dirty, and process all the children. Actual
 * updates of the widgets are deferred until menus are actually shown.
 * /*from w w w.j  ava 2  s .c o m*/
 * @param menuManager
 *            the manager to process.
 */
private void allowUpdates(IMenuManager menuManager) {
    menuManager.markDirty();
    final IContributionItem[] items = menuManager.getItems();
    for (int i = 0; i < items.length; i++) {
        if (items[i] instanceof IMenuManager) {
            allowUpdates((IMenuManager) items[i]);
        } else if (items[i] instanceof SubContributionItem) {
            final IContributionItem innerItem = ((SubContributionItem) items[i]).getInnerItem();
            if (innerItem instanceof IMenuManager) {
                allowUpdates((IMenuManager) innerItem);
            }
        }
    }
}

From source file:org.whole.lang.e4.ui.actions.AbstractCompositeContributionItem.java

License:Open Source License

public AbstractCompositeContributionItem(IContextProvider contextProvider) {
    this.contextProvider = contextProvider;
    this.comparator = new Comparator<IAction>() {
        public int compare(IAction left, IAction right) {
            return left.getText().compareTo(right.getText());
        }//from  www.  j  a v a2  s.c o  m
    };
    this.items = null;
    this.listener = new IMenuListener() {
        public void menuAboutToShow(IMenuManager manager) {
            manager.markDirty();
        }
    };
}