JComponent () { JPanel panel = new JPanel(new BorderLayout()); // Toolbar DefaultActionGroup group = new DefaultActionGroup(); fillToolbarActions(group); group.addSeparator(); ExpandAllAction expandAllAction = new ExpandAllAction(); expandAllAction.registerCustomShortcutSet(getActiveKeymapShortcuts(IdeActions.ACTION_EXPAND_ALL), myTree); group.add(expandAllAction); CollapseAllAction collapseAllAction = new CollapseAllAction(); collapseAllAction.registerCustomShortcutSet(getActiveKeymapShortcuts(IdeActions.ACTION_COLLAPSE_ALL), myTree); group.add(collapseAllAction); ActionToolbar toolbar = ActionManager.getInstance().createActionToolbar("MemberChooser", group, true); toolbar.setTargetComponent(myTree); panel.add(toolbar.getComponent(), BorderLayout.NORTH); // Tree expandFirst(); defaultExpandTree(); installSpeedSearch(); JScrollPane scrollPane = ScrollPaneFactory.createScrollPane(myTree); scrollPane.setPreferredSize(JBUI.size(350, 450)); panel.add(scrollPane, BorderLayout.CENTER); return panel; }