void (@NotNull ActionGroup actionGroup) { final AnAction[] actions = actionGroup.getChildren(null); if (actions.length > 0) { int gridx = 0; add(// left strut Box.createHorizontalGlue(), new GridBagConstraints(gridx++, 0, 1, 1, 1, 0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(8, 0, 0, 0), 0, 0)); JPanel buttonsPanel = createButtons(actions); //noinspection UnusedAssignment add(buttonsPanel, new GridBagConstraints(gridx++, 0, 1, 1, 0, 0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(8, 0, 0, 0), 0, 0)); } }