private void addButton(@NotNull JPanel panel, @NotNull GridBagConstraints gc, @NotNull InplaceButton button, boolean cancel) {
      button.setMinimumSize(button.getPreferredSize());

      if (commentEnabled) {
        button.addMouseListener(new HoverListener(cancel));
      }

      gc.anchor = GridBagConstraints.EAST;
      gc.fill = GridBagConstraints.NONE;
      panel.add(button, gc);
    }
private void addButton(@NotNull JPanel panel, @NotNull GridBagConstraints gc, @NotNull InplaceButton button, boolean cancel)