JComponent (@NotNull Presentation presentation, @NotNull String place) { final JButton button = new JButton(presentation.getText()); Icon icon = presentation.getIcon(); if (icon == null) { icon = AllIcons.Actions.IntentionBulb; } button.setEnabled(presentation.isEnabled()); button.setIcon(IconLoader.getTransparentIcon(icon, 0.75f)); new ClickListener() { @Override public boolean onClick(@NotNull MouseEvent event, int clickCount) { AnActionEvent action = AnActionEvent.createFromAnAction( QuickFixAction.this, event, place, ActionToolbar.getDataContextFor(button)); try (AccessToken ignore = SlowOperations.startSection(SlowOperations.ACTION_PERFORM)) { actionPerformed(action); } return true; } }.installOn(button); JPanel panel = new JPanel(); panel.setLayout(new BoxLayout(panel, BoxLayout.LINE_AXIS)); panel.setBorder(JBUI.Borders.empty(7, 0, 8, 0)); panel.add(button); return panel; }