List<AnAction> () { AnAction expandAll = new AnAction(UIBundle.messagePointer("action.DesignerToolWindow.Anonymous.text.expand.all"), AllIcons.Actions.Expandall) { @Override public void actionPerformed(@NotNull AnActionEvent e) { if (myTreeBuilder != null) { TreeUtil.expandAll(myComponentTree); } } }; AnAction collapseAll = new AnAction(UIBundle.messagePointer("action.DesignerToolWindow.Anonymous.text.collapse.all"), AllIcons.Actions.Collapseall) { @Override public void actionPerformed(@NotNull AnActionEvent e) { if (myTreeBuilder != null) { TreeUtil.collapseAll(myComponentTree, 1); } } }; return Arrays.asList(expandAll, collapseAll); }