JComponent () { myModel = new ProjectStartupTasksTableModel(); myTable = new JBTable(myModel); myTable.setShowGrid(false); myTable.getEmptyText().setText(ExecutionBundle.message("settings.project.startup.add.run.configurations.with.the.button")); TableSpeedSearch.installOn(myTable); DefaultCellEditor defaultEditor = (DefaultCellEditor)myTable.getDefaultEditor(Object.class); defaultEditor.setClickCountToStart(1); myTable.getSelectionModel().setSelectionMode(ListSelectionModel.SINGLE_SELECTION); DumbAwareAction.create(e -> { int row = myTable.getSelectedRow(); if (row >= 0 && myModel.isCellEditable(row, ProjectStartupTasksTableModel.IS_SHARED_COLUMN)) { myModel.setValueAt(!Boolean.TRUE.equals(myTable.getValueAt(row, ProjectStartupTasksTableModel.IS_SHARED_COLUMN)), row, ProjectStartupTasksTableModel.IS_SHARED_COLUMN); } }).registerCustomShortcutSet(new CustomShortcutSet(KeyEvent.VK_SPACE), myTable); myTable.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { if (e.getClickCount() >= 2) { editRunConfiguration(); } } }); installRenderers(); myDecorator = ToolbarDecorator.createDecorator(myTable) .setAddAction(this::selectAndAddConfiguration) .setAddIcon(LayeredIcon.ADD_WITH_DROPDOWN) .setEditAction(new AnActionButtonRunnable() { @Override public void run(AnActionButton button) { editRunConfiguration(); } }) .setEditActionUpdater(e -> myTable.getSelectedRow() >= 0) .disableUpAction().disableDownAction(); final JPanel tasksPanel = myDecorator.createPanel(); final JLabel label = new JLabel(ExecutionBundle.message("settings.project.startup.run.tasks.and.tools.via.run.configurations")); label.setForeground(NamedColorUtil.getInactiveTextColor()); label.setHorizontalAlignment(SwingConstants.RIGHT); final JPanel wrapper = new JPanel(new BorderLayout()); wrapper.add(new JLabel(ExecutionBundle.message("settings.project.startup.to.be.started.on.project.opening")), BorderLayout.WEST); wrapper.add(label, BorderLayout.EAST); wrapper.setBorder(BorderFactory.createEmptyBorder(0, 0, UIUtil.DEFAULT_VGAP, 0)); final JPanel main = new JPanel(new BorderLayout()); main.add(wrapper, BorderLayout.NORTH); main.add(tasksPanel, BorderLayout.CENTER); return main; }