void () { addActionsTo(myToolbarGroup); myToolbarGroup.add(new MyCloseAction()); ActionToolbar toolbar = ActionManager.getInstance().createActionToolbar(ActionPlaces.FILEHISTORY_VIEW_TOOLBAR, myToolbarGroup, ! myVerticalToolbar); JComponent centerPanel = createCenterPanel(); toolbar.setTargetComponent(centerPanel); for (AnAction action : myToolbarGroup.getChildren(null)) { action.registerCustomShortcutSet(action.getShortcutSet(), centerPanel); } add(centerPanel, BorderLayout.CENTER); if (myVerticalToolbar) { add(toolbar.getComponent(), BorderLayout.WEST); } else { add(toolbar.getComponent(), BorderLayout.NORTH); } }