Example usage for com.intellij.openapi.actionSystem DefaultActionGroup removeAll

List of usage examples for com.intellij.openapi.actionSystem DefaultActionGroup removeAll

Introduction

In this page you can find the example usage for com.intellij.openapi.actionSystem DefaultActionGroup removeAll.

Prototype

public final void removeAll() 

Source Link

Document

Removes all children actions (separators as well) from the group.

Usage

From source file:be.mavicon.intellij.ppimport.PPImportPlugin.java

License:Apache License

@Override
public void initComponent() {
    ActionManager am = ActionManager.getInstance();
    DefaultActionGroup group = (DefaultActionGroup) am.getAction("PPImportGroup");
    group.removeAll();

    List<AnAction> actions = new ArrayList<AnAction>();
    if (state == null) {
        state = new PPConfiguration();
        state.init();//from  ww w. ja  v a 2  s .  c  om
    }
    List<String> includeExtentions = getIncludeExtentions(state.getFileExtensions());
    for (Target target : state.getTargets()) {
        AnAction action = new PPImportAction(target, includeExtentions, state.packMultipleFilesInJar);
        actions.add(action);
        am.unregisterAction(target.getProfile());
        am.registerAction(target.getProfile(), action);
        group.add(action);
    }
}

From source file:be.wimsymons.intellij.polopolyimport.PPImportPlugin.java

License:Apache License

private void registerActions() {
    ActionManager am = ActionManager.getInstance();

    DefaultActionGroup group = (DefaultActionGroup) am.getAction(PLUGIN_GROUP_NAME);
    group.removeAll();

    for (Target target : state.getTargets()) {
        AnAction action = new PPImportAction(target, getIncludeExtensions(state.getFileExtensions()),
                state.getReplacements(), state.isPackMultipleFilesInJar());
        am.unregisterAction(target.getProfile());
        am.registerAction(target.getProfile(), action);
        group.add(action);//from   ww w .  j  a  v  a  2  s  . c om
    }
}

From source file:com.android.tools.idea.uibuilder.editor.NlActionManager.java

License:Apache License

private void addViewActionsForHandler(@NotNull DefaultActionGroup group, @NotNull NlComponent component,
        @NotNull List<NlComponent> newSelection, @NotNull ViewEditor editor, @Nullable ViewHandler handler,
        boolean toolbar) {
    if (handler == null) {
        return;/*w w w  .  j a  va  2 s . c o  m*/
    }

    List<ViewAction> viewActions = createViewActionList();
    if (toolbar) {
        viewActions.addAll(ViewHandlerManager.get(mySurface.getProject()).getToolbarActions(handler));
    } else {
        viewActions.addAll(ViewHandlerManager.get(mySurface.getProject()).getPopupMenuActions(handler));
    }
    Collections.sort(viewActions);

    group.removeAll();
    List<AnAction> target = Lists.newArrayList();
    NlActionManager actionManager = mySurface.getActionManager();
    for (ViewAction viewAction : viewActions) {
        actionManager.addActions(target, toolbar, viewAction, mySurface.getProject(), editor, handler,
                component, newSelection);
    }
    boolean lastWasSeparator = false;
    for (AnAction action : target) {
        // Merge repeated separators
        boolean isSeparator = action instanceof Separator;
        if (isSeparator && lastWasSeparator) {
            continue;
        }

        group.add(action);
        lastWasSeparator = isSeparator;
    }
}

From source file:com.intellij.ide.favoritesTreeView.actions.AddToFavoritesPopupAction.java

License:Apache License

@Override
protected void fillActions(Project project, @NotNull DefaultActionGroup group,
        @NotNull DataContext dataContext) {
    group.removeAll();

    final List<String> availableFavoritesLists = FavoritesManager.getInstance(project)
            .getAvailableFavoritesListNames();
    availableFavoritesLists.remove(FavoritesTreeViewPanel.FAVORITES_LIST_NAME_DATA_KEY.getData(dataContext));

    for (String favoritesList : availableFavoritesLists) {
        group.add(new AddToFavoritesAction(favoritesList));
    }/* www .  j a v  a 2 s.  c  o  m*/
    group.add(new AddToNewFavoritesListAction());
}

From source file:com.mediaworx.intellij.opencmsplugin.actions.menus.OpenCmsMainMenu.java

License:Open Source License

private void unregisterChildActions(DefaultActionGroup parentGroup) {
    AnAction[] allActions = parentGroup.getChildActionsOrStubs();
    for (AnAction action : allActions) {
        String actionId = actionManager.getId(action);
        keymap.removeAllActionShortcuts(actionId);
        actionManager.unregisterAction(actionId);
    }/*from   w w  w. j a  v a2s .c o  m*/
    parentGroup.removeAll();
}

From source file:org.nanocontainer.idea.PicoPlugin.java

License:Open Source License

private void addToolBarActions(DefaultActionGroup toolGroup, List actions) {
    toolGroup.removeAll();
    for (Iterator iterator = actions.iterator(); iterator.hasNext();) {
        AnAction a = (AnAction) iterator.next();
        toolGroup.add(a);//from   ww  w .  j  a v  a2  s  .  c o  m
    }
}