use of com.android.tools.idea.gradle.structure.configurables.ui.treeview.AbstractBaseExpandAllAction 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);
}
use of com.android.tools.idea.gradle.structure.configurables.ui.treeview.AbstractBaseExpandAllAction 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;
}
use of com.android.tools.idea.gradle.structure.configurables.ui.treeview.AbstractBaseExpandAllAction 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);
}
use of com.android.tools.idea.gradle.structure.configurables.ui.treeview.AbstractBaseExpandAllAction 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);
}
use of com.android.tools.idea.gradle.structure.configurables.ui.treeview.AbstractBaseExpandAllAction 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;
}
Aggregations