Search in sources :

Example 1 with ShowWhitespaceCharactersAction

use of org.eclipse.ui.texteditor.ShowWhitespaceCharactersAction in project xtext-xtend by eclipse.

the class ShowWhitespaceCharactersActionContributor method editorDisposed.

@Override
public void editorDisposed(XtextEditor editor) {
    IToolBarManager toolBarManager = editor.getEditorSite().getActionBars().getToolBarManager();
    IContributionItem i = toolBarManager.remove(ITextEditorActionConstants.SHOW_WHITESPACE_CHARACTERS);
    if (i instanceof ActionContributionItem) {
        IAction action = ((ActionContributionItem) i).getAction();
        if (action instanceof ShowWhitespaceCharactersAction) {
            ((ShowWhitespaceCharactersAction) action).setEditor(null);
        }
    }
}
Also used : ActionContributionItem(org.eclipse.jface.action.ActionContributionItem) IAction(org.eclipse.jface.action.IAction) IToolBarManager(org.eclipse.jface.action.IToolBarManager) ShowWhitespaceCharactersAction(org.eclipse.ui.texteditor.ShowWhitespaceCharactersAction) IContributionItem(org.eclipse.jface.action.IContributionItem)

Aggregations

ActionContributionItem (org.eclipse.jface.action.ActionContributionItem)1 IAction (org.eclipse.jface.action.IAction)1 IContributionItem (org.eclipse.jface.action.IContributionItem)1 IToolBarManager (org.eclipse.jface.action.IToolBarManager)1 ShowWhitespaceCharactersAction (org.eclipse.ui.texteditor.ShowWhitespaceCharactersAction)1