JComponent () { final MyListModel model = new MyListModel(); final JButton button = new JButton(SSRBundle.message("edit.metadata.button")); button.addActionListener(__ -> performEditMetaData(button)); final JList<Configuration> list = new JBList<>(model) { @Override protected String itemToText(int index, Configuration value) { return ConfigurationUtil.toXml(value); } }; list.setCellRenderer(new ConfigurationCellRenderer()); final JPanel listPanel = ToolbarDecorator.createDecorator(list) .setAddAction(b -> performAdd(list, b)) .setAddActionName(SSRBundle.message("add.pattern.action")) .setRemoveAction(b -> performRemove(list)) .setRemoveActionUpdater(e -> list.getSelectedValuesList().size() < list.getModel().getSize()) .setEditAction(b -> performEdit(list)) .setMoveUpAction(b -> performMove(list, true)) .setMoveDownAction(b -> performMove(list, false)) .createPanel(); new DoubleClickListener() { @Override protected boolean onDoubleClick(@NotNull MouseEvent e) { performEdit(list); return true; } }.installOn(list); final JPanel panel = new FormBuilder() .addComponent(button) .addLabeledComponentFillVertically(SSRBundle.message("templates.title"), listPanel) .getPanel(); panel.setBorder(JBUI.Borders.emptyTop(10)); return panel; }