Example usage for org.eclipse.jface.action IStatusLineManager remove

List of usage examples for org.eclipse.jface.action IStatusLineManager remove

Introduction

In this page you can find the example usage for org.eclipse.jface.action IStatusLineManager remove.

Prototype

IContributionItem remove(String id);

Source Link

Document

Removes and returns the contribution item with the given id from this manager.

Usage

From source file:com.aptana.editor.common.CommonTextEditorActionContributor.java

License:Open Source License

@Override
public void contributeToStatusLine(IStatusLineManager statusLineManager) {
    commandsMenuContributionItem = new CommandsMenuContributionItem();
    statusLineManager.add(commandsMenuContributionItem);
    super.contributeToStatusLine(statusLineManager);

    inputPositionStatsContributionItem = new StatusLineContributionItem(
            ITextEditorActionConstants.STATUS_CATEGORY_INPUT_POSITION, true, 24);
    IContributionItem[] contributionItems = statusLineManager.getItems();
    for (IContributionItem contributionItem : contributionItems) {
        String id = contributionItem.getId();

        if (ITextEditorActionConstants.STATUS_CATEGORY_INPUT_POSITION.equals(id)) {
            statusLineManager.remove(contributionItem);
            statusLineManager.add(inputPositionStatsContributionItem);
        }/*from   w  ww. j  a va2  s .c om*/
    }
}

From source file:com.sonatype.buildserver.eclipse.ui.StatusNotification.java

License:Open Source License

public void remove() {
    IStatusLineManager manager = notificationAffordance.getStatusLineManager();
    if (manager != null) {
        manager.remove(notificationAffordance);

    }/*from   w  w  w. ja  va 2s.  c  om*/
}

From source file:com.xored.glance.internal.ui.panels.SearchStatusLine.java

License:Open Source License

@Override
public void closePanel() {
    if (item != null) {
        fireClose();/* ww  w  . j a va  2  s.  com*/
        IStatusLineManager manager = getManager();
        if (manager != null) {
            manager.remove(item);
            manager.update(false);
        }
        item = null;
    }
}

From source file:com.xored.glance.internal.ui.panels.SearchStatusLine.java

License:Open Source License

private void init() {
    item = new SearchItem();
    IStatusLineManager manager = getManager();
    if (manager != null) {
        manager.remove(item);
        manager.appendToGroup(StatusLineManager.BEGIN_GROUP, item);
        manager.update(true);//from www  .ja v a  2 s  .co m
    }
}

From source file:net.refractions.udig.project.ui.internal.tool.display.ToolManager.java

License:Open Source License

/**
 * This method goes through the steps of deactivating the current tool option contribution and 
 * activating the new tool option contribution.
 * //from w  w  w.  j a  v  a  2s  .  c om
 * @param statusLine
 * @param modalToolProxy
 */
private void initToolOptionsContribution(IStatusLineManager statusLine, ToolProxy modalToolProxy) {
    if (statusLine != null) {

        if (preferencesShortcutToolOptions == null || preferencesShortcutToolOptions.isDisposed()) {
            preferencesShortcutToolOptions = new PreferencesShortcutToolOptionsContributionItem();
            statusLine.appendToGroup(StatusLineManager.BEGIN_GROUP, preferencesShortcutToolOptions);
            preferencesShortcutToolOptions.setVisible(true);
        }
        preferencesShortcutToolOptions.update(modalToolProxy);

        //TODO, cache contributions instead of destroying them and recreating them

        //remove old tool contribution
        for (ContributionItem contribution : optionsContribution) {
            statusLine.remove(contribution.getId());
        }

        //get the new contributions
        optionsContribution = modalToolProxy.getOptionsContribution();

        //set all new contributions
        for (ContributionItem contribution : optionsContribution) {
            statusLine.appendToGroup(StatusLineManager.BEGIN_GROUP, contribution);
            contribution.setVisible(true);
        }

        statusLine.update(true);
    }
}

From source file:org.eclipse.equinox.internal.p2.ui.sdk.scheduler.AutomaticUpdater.java

License:Open Source License

void clearUpdateAffordances() {
    if (updateAffordance != null) {
        IStatusLineManager manager = getStatusLineManager();
        if (manager != null) {
            manager.remove(updateAffordance);
            manager.update(true);//from  w  ww  . j a v a 2s. c om
        }
        updateAffordance.dispose();
        updateAffordance = null;
    }
    if (popup != null) {
        popup.close(false);
        popup = null;
    }
}

From source file:org.eclipse.gmf.runtime.diagram.ui.resources.editor.parts.DiagramDocumentEditor.java

License:Open Source License

/**
 * Remove the status line contributions from this editor.
 * //from w w w .  j a va  2  s .  co  m
 * @since 1.2
 */
protected void removeStatusLineContributions() {
    if (statusLineContributions == null || statusLineContributions.isEmpty()) {
        return;
    }
    IStatusLineManager statusLineManager = getEditorSite().getActionBars().getStatusLineManager();
    for (IContributionItem contrItem : statusLineContributions) {
        IContributionItem removedItem = statusLineManager.remove(contrItem);
        if (removedItem != null) {
            removedItem.dispose();
        }
    }
    statusLineContributions.removeAll(statusLineContributions);
    statusLineLabelProvider = null;

    updateStatusLineMessageContribution(null, null);
    getEditorSite().getActionBars().getStatusLineManager().update(true);
}

From source file:org.eclipse.pde.internal.ui.shared.target.TargetStatus.java

License:Open Source License

/**
 * Adds or removes the target status contribution from the status line manager depending on the
 * value of preference {@link IPreferenceConstants#SHOW_TARGET_STATUS}.
 * <p>/* w ww.j  a v  a2s  . c o m*/
 * Must be called from the UI Thread.
 * </p>
 */
public static void refreshTargetStatus() {
    PDEPreferencesManager prefs = PDEPlugin.getDefault().getPreferenceManager();
    boolean showStatus = prefs.getBoolean(IPreferenceConstants.SHOW_TARGET_STATUS);

    IWorkbenchWindow[] windows = PlatformUI.getWorkbench().getWorkbenchWindows();
    for (int i = 0; i < windows.length; i++) {
        IStatusLineManager manager = getStatusLineManager(windows[i]);
        if (manager != null) {
            if (showStatus) {
                manager.remove(TARGET_STATUS_ID);
                manager.appendToGroup(StatusLineManager.BEGIN_GROUP, getContributionItem());
            } else {
                manager.remove(TARGET_STATUS_ID);
            }
            manager.update(false);
            break;
        }
    }
}

From source file:org.eclipse.ui.glance.internal.panels.SearchStatusLine.java

License:Open Source License

public void closePanel() {
    if (item != null) {
        fireClose();//from ww  w  . j  av  a  2  s . c om
        IStatusLineManager manager = getManager();
        if (manager != null) {
            manager.remove(item);
            manager.update(false);
        }
        item = null;
    }
}

From source file:org.limy.eclipse.qalab.editor.QalabEditorContributor.java

License:Open Source License

@Override
public void contributeToStatusLine(IStatusLineManager statusLineManager) {

    statusFieldCoverage = new StatusLineContributionItem(LimyQalabConstants.QALAB_CATEGORY_COVERAGE, true, 26);
    statusLineManager.add(statusFieldCoverage);

    statusFieldCc = new StatusLineContributionItem(LimyQalabConstants.QALAB_CATEGORY_CC, true, 10);
    statusLineManager.add(statusFieldCc);

    // super ???AstatusField??iE?j
    super.contributeToStatusLine(statusLineManager);

    statusLineManager.remove(ITextEditorActionConstants.STATUS_CATEGORY_ELEMENT_STATE);
    statusLineManager.remove(ITextEditorActionConstants.STATUS_CATEGORY_INPUT_MODE);
}