Search in sources :

Example 1 with MatchFilterSelectionAction

use of org.eclipse.search2.internal.ui.MatchFilterSelectionAction in project eclipse.platform.text by eclipse.

the class AbstractTextSearchViewPage method addFilterActionsToViewMenu.

private IAction[] addFilterActionsToViewMenu() {
    AbstractTextSearchResult input = getInput();
    if (input == null) {
        return null;
    }
    MatchFilter[] allMatchFilters = input.getAllMatchFilters();
    if (allMatchFilters == null && getElementLimit() == null) {
        return null;
    }
    IActionBars bars = getSite().getActionBars();
    IMenuManager menu = bars.getMenuManager();
    menu.prependToGroup(IContextMenuConstants.GROUP_FILTERING, new MatchFilterSelectionAction(this));
    if (allMatchFilters != null) {
        MatchFilterAction[] actions = new MatchFilterAction[allMatchFilters.length];
        for (int i = allMatchFilters.length - 1; i >= 0; i--) {
            MatchFilterAction filterAction = new MatchFilterAction(this, allMatchFilters[i]);
            actions[i] = filterAction;
            menu.prependToGroup(IContextMenuConstants.GROUP_FILTERING, filterAction);
        }
        return actions;
    }
    return null;
}
Also used : IMenuManager(org.eclipse.jface.action.IMenuManager) MatchFilterAction(org.eclipse.search2.internal.ui.MatchFilterAction) IActionBars(org.eclipse.ui.IActionBars) MatchFilterSelectionAction(org.eclipse.search2.internal.ui.MatchFilterSelectionAction)

Aggregations

IMenuManager (org.eclipse.jface.action.IMenuManager)1 MatchFilterAction (org.eclipse.search2.internal.ui.MatchFilterAction)1 MatchFilterSelectionAction (org.eclipse.search2.internal.ui.MatchFilterSelectionAction)1 IActionBars (org.eclipse.ui.IActionBars)1