use of com.intellij.ide.TreeExpander in project intellij-community by JetBrains.
the class TreeExpandAllActionBase method actionPerformed.
public final void actionPerformed(AnActionEvent e) {
TreeExpander expander = getExpander(e.getDataContext());
if (expander == null)
return;
if (!expander.canExpand())
return;
expander.expandAll();
}
use of com.intellij.ide.TreeExpander in project android by JetBrains.
the class ToolWindowAlikePanel method createTreePanel.
@NotNull
public static ToolWindowAlikePanel createTreePanel(@NotNull String title, @NotNull JTree tree) {
ToolWindowAlikePanel panel = new ToolWindowAlikePanel(title, createScrollPane(tree));
Object root = tree.getModel().getRoot();
if (root instanceof TreeNode && ((TreeNode) root).getChildCount() > 0) {
TreeExpander expander = new DefaultTreeExpander(tree);
CommonActionsManager actions = CommonActionsManager.getInstance();
AnAction expandAllAction = actions.createExpandAllAction(expander, tree);
expandAllAction.getTemplatePresentation().setIcon(ExpandAll);
AnAction collapseAllAction = actions.createCollapseAllAction(expander, tree);
collapseAllAction.getTemplatePresentation().setIcon(CollapseAll);
panel.setAdditionalTitleActions(expandAllAction, collapseAllAction);
}
return panel;
}
Aggregations