void () { setLayout(new BorderLayout()); setFocusable(false); JPanel topPanel = new JPanel(new BorderLayout()); Component toolbarComponent = isVerticalToolbar() ? createToolbarComponent() : new TreeActionsToolbarPanel(createToolbarComponent(), myViewer); JComponent headerPanel = createHeaderPanel(); if (headerPanel != null) topPanel.add(headerPanel, BorderLayout.EAST); switch (myToolbarAnchor) { case SwingConstants.TOP -> topPanel.add(toolbarComponent, BorderLayout.CENTER); case SwingConstants.BOTTOM -> add(toolbarComponent, BorderLayout.SOUTH); case SwingConstants.LEFT -> add(toolbarComponent, BorderLayout.WEST); case SwingConstants.RIGHT -> add(toolbarComponent, BorderLayout.EAST); } add(topPanel, BorderLayout.NORTH); add(createCenterPanel(), BorderLayout.CENTER); myToolBarGroup.addAll(createToolbarActions()); myPopupMenuGroup.addAll(createPopupMenuActions()); AnAction groupByAction = ActionManager.getInstance().getAction(ChangesTree.GROUP_BY_ACTION_GROUP); if (!ActionUtil.recursiveContainsAction(myToolBarGroup, groupByAction)) { myToolBarGroup.addSeparator(); myToolBarGroup.add(groupByAction); } if (isVerticalToolbar()) { List<AnAction> treeActions = TreeActionsToolbarPanel.createTreeActions(myViewer); boolean hasTreeActions = ContainerUtil.exists(treeActions, action -> ActionUtil.recursiveContainsAction(myToolBarGroup, action)); if (!hasTreeActions) { myToolBarGroup.addSeparator(); myToolBarGroup.addAll(treeActions); } } myShowDiffAction.registerCustomShortcutSet(this, null); DiffUtil.recursiveRegisterShortcutSet(myToolBarGroup, this, null); }