Search in sources :

Example 1 with AbstractBaseCollapseAllAction

use of com.android.tools.idea.gradle.structure.configurables.ui.treeview.AbstractBaseCollapseAllAction in project android by JetBrains.

the class TargetModulesPanel method setHeaderActions.

private void setHeaderActions() {
    List<AnAction> additionalActions = Lists.newArrayList();
    additionalActions.add(new AbstractBaseExpandAllAction(myTree) {

        @Override
        public void actionPerformed(AnActionEvent e) {
            myTree.requestFocusInWindow();
            myTreeBuilder.expandAllNodes();
        }
    });
    additionalActions.add(new AbstractBaseCollapseAllAction(myTree) {

        @Override
        public void actionPerformed(AnActionEvent e) {
            myTree.requestFocusInWindow();
            myTreeBuilder.collapseAllNodes();
        }
    });
    getHeader().setAdditionalActions(additionalActions);
}
Also used : AbstractBaseExpandAllAction(com.android.tools.idea.gradle.structure.configurables.ui.treeview.AbstractBaseExpandAllAction) AbstractBaseCollapseAllAction(com.android.tools.idea.gradle.structure.configurables.ui.treeview.AbstractBaseCollapseAllAction)

Example 2 with AbstractBaseCollapseAllAction

use of com.android.tools.idea.gradle.structure.configurables.ui.treeview.AbstractBaseCollapseAllAction in project android by JetBrains.

the class DependencyGraphPanel method getExtraToolbarActions.

@Override
@NotNull
protected List<AnAction> getExtraToolbarActions() {
    List<AnAction> actions = Lists.newArrayList();
    actions.add(new SelectNodesMatchingCurrentSelectionAction() {

        @Override
        @NotNull
        protected AbstractPsNodeTreeBuilder getTreeBuilder() {
            return myTreeBuilder;
        }
    });
    actions.add(new Separator());
    actions.add(new AbstractBaseExpandAllAction(myTree, Expandall) {

        @Override
        public void actionPerformed(AnActionEvent e) {
            myTree.requestFocusInWindow();
            myTreeBuilder.expandAllNodes();
            selectFirstNode();
        }
    });
    actions.add(new AbstractBaseCollapseAllAction(myTree, Collapseall) {

        @Override
        public void actionPerformed(AnActionEvent e) {
            myTreeBuilder.clearSelection();
            myTree.requestFocusInWindow();
            myTreeBuilder.collapseAllNodes();
            selectFirstNode();
        }
    });
    return actions;
}
Also used : AbstractBaseExpandAllAction(com.android.tools.idea.gradle.structure.configurables.ui.treeview.AbstractBaseExpandAllAction) NotNull(org.jetbrains.annotations.NotNull) AbstractBaseCollapseAllAction(com.android.tools.idea.gradle.structure.configurables.ui.treeview.AbstractBaseCollapseAllAction) NotNull(org.jetbrains.annotations.NotNull)

Example 3 with AbstractBaseCollapseAllAction

use of com.android.tools.idea.gradle.structure.configurables.ui.treeview.AbstractBaseCollapseAllAction in project android by JetBrains.

the class TargetArtifactsPanel method setHeaderActions.

private void setHeaderActions() {
    List<AnAction> additionalActions = Lists.newArrayList();
    additionalActions.add(new AbstractBaseExpandAllAction(myTree) {

        @Override
        public void actionPerformed(AnActionEvent e) {
            myTree.requestFocusInWindow();
            myTreeBuilder.expandAllNodes();
        }
    });
    additionalActions.add(new AbstractBaseCollapseAllAction(myTree) {

        @Override
        public void actionPerformed(AnActionEvent e) {
            myTree.requestFocusInWindow();
            myTreeBuilder.collapseAllNodes();
        }
    });
    getHeader().setAdditionalActions(additionalActions);
}
Also used : AbstractBaseExpandAllAction(com.android.tools.idea.gradle.structure.configurables.ui.treeview.AbstractBaseExpandAllAction) AnActionEvent(com.intellij.openapi.actionSystem.AnActionEvent) AnAction(com.intellij.openapi.actionSystem.AnAction) AbstractBaseCollapseAllAction(com.android.tools.idea.gradle.structure.configurables.ui.treeview.AbstractBaseCollapseAllAction)

Example 4 with AbstractBaseCollapseAllAction

use of com.android.tools.idea.gradle.structure.configurables.ui.treeview.AbstractBaseCollapseAllAction in project android by JetBrains.

the class ResolvedDependenciesPanel method setHeaderActions.

private void setHeaderActions() {
    List<AnAction> additionalActions = Lists.newArrayList();
    additionalActions.add(new SelectNodesMatchingCurrentSelectionAction() {

        @Override
        @NotNull
        protected AbstractPsNodeTreeBuilder getTreeBuilder() {
            return myTreeBuilder;
        }
    });
    additionalActions.add(Separator.getInstance());
    additionalActions.add(new AbstractBaseExpandAllAction(myTree) {

        @Override
        public void actionPerformed(AnActionEvent e) {
            myIgnoreTreeSelectionEvents = true;
            myTree.requestFocusInWindow();
            myTreeBuilder.expandAllNodes();
            myIgnoreTreeSelectionEvents = false;
        }
    });
    additionalActions.add(new AbstractBaseCollapseAllAction(myTree) {

        @Override
        public void actionPerformed(AnActionEvent e) {
            collapseAllNodes();
        }
    });
    additionalActions.add(Separator.getInstance());
    //DefaultActionGroup settingsGroup = new DefaultActionGroup();
    //settingsGroup.add(new ToggleAction("Group Similar") {
    //  @Override
    //  public boolean isSelected(AnActionEvent e) {
    //    return PsUISettings.getInstance().RESOLVED_DEPENDENCIES_GROUP_VARIANTS;
    //  }
    //
    //  @Override
    //  public void setSelected(AnActionEvent e, boolean state) {
    //    PsUISettings settings = PsUISettings.getInstance();
    //    if (settings.RESOLVED_DEPENDENCIES_GROUP_VARIANTS != state) {
    //      settings.RESOLVED_DEPENDENCIES_GROUP_VARIANTS = state;
    //      settings.fireUISettingsChanged();
    //    }
    //  }
    //});
    //
    //additionalActions.add(new DumbAwareAction("", "", AllIcons.General.Gear) {
    //  @Override
    //  public void actionPerformed(AnActionEvent e) {
    //    InputEvent inputEvent = e.getInputEvent();
    //    ActionManagerImpl actionManager = (ActionManagerImpl)ActionManager.getInstance();
    //    ActionPopupMenu popupMenu =
    //      actionManager.createActionPopupMenu(POPUP_PLACE, settingsGroup, new MenuItemPresentationFactory(true));
    //    int x = 0;
    //    int y = 0;
    //    if (inputEvent instanceof MouseEvent) {
    //      x = ((MouseEvent)inputEvent).getX();
    //      y = ((MouseEvent)inputEvent).getY();
    //    }
    //    popupMenu.getComponent().show(inputEvent.getComponent(), x, y);
    //  }
    //});
    getHeader().setAdditionalActions(additionalActions);
}
Also used : AbstractBaseExpandAllAction(com.android.tools.idea.gradle.structure.configurables.ui.treeview.AbstractBaseExpandAllAction) NotNull(org.jetbrains.annotations.NotNull) AbstractBaseCollapseAllAction(com.android.tools.idea.gradle.structure.configurables.ui.treeview.AbstractBaseCollapseAllAction)

Example 5 with AbstractBaseCollapseAllAction

use of com.android.tools.idea.gradle.structure.configurables.ui.treeview.AbstractBaseCollapseAllAction in project android by JetBrains.

the class DependencyGraphPanel method getExtraToolbarActions.

@Override
@NotNull
protected List<AnAction> getExtraToolbarActions() {
    List<AnAction> actions = Lists.newArrayList();
    actions.add(new SelectNodesMatchingCurrentSelectionAction() {

        @Override
        public void actionPerformed(AnActionEvent e) {
            myIgnoreTreeSelectionEvents = true;
            super.actionPerformed(e);
        }

        @Override
        @NotNull
        protected AbstractPsNodeTreeBuilder getTreeBuilder() {
            return myTreeBuilder;
        }
    });
    actions.add(new Separator());
    actions.add(new AbstractBaseExpandAllAction(myTree, Expandall) {

        @Override
        public void actionPerformed(AnActionEvent e) {
            myTree.requestFocusInWindow();
            myTreeBuilder.expandAllNodes();
            doEnsureSelection();
        }
    });
    actions.add(new AbstractBaseCollapseAllAction(myTree, Collapseall) {

        @Override
        public void actionPerformed(AnActionEvent e) {
            myTreeBuilder.clearSelection();
            notifySelectionChanged(Collections.emptyList());
            myTree.requestFocusInWindow();
            myTreeBuilder.collapseAllNodes();
            doEnsureSelection();
        }
    });
    return actions;
}
Also used : AbstractBaseExpandAllAction(com.android.tools.idea.gradle.structure.configurables.ui.treeview.AbstractBaseExpandAllAction) NotNull(org.jetbrains.annotations.NotNull) AbstractBaseCollapseAllAction(com.android.tools.idea.gradle.structure.configurables.ui.treeview.AbstractBaseCollapseAllAction) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

AbstractBaseCollapseAllAction (com.android.tools.idea.gradle.structure.configurables.ui.treeview.AbstractBaseCollapseAllAction)5 AbstractBaseExpandAllAction (com.android.tools.idea.gradle.structure.configurables.ui.treeview.AbstractBaseExpandAllAction)5 NotNull (org.jetbrains.annotations.NotNull)3 AnAction (com.intellij.openapi.actionSystem.AnAction)1 AnActionEvent (com.intellij.openapi.actionSystem.AnActionEvent)1