JComponent () { return toolbarDecorator.addExtraAction( new ToolbarDecorator.ElementActionButton(IdeBundle.message("button.copy"), PlatformIcons.COPY_ICON) { @Override public void actionPerformed(@NotNull AnActionEvent e) { TableUtil.stopEditing(table); List<T> selectedItems = table.getSelectedObjects(); if (selectedItems.isEmpty()) { return; } for (T item : selectedItems) { model.addRow(itemEditor.clone(item, false)); } IdeFocusManager.getGlobalInstance().doWhenFocusSettlesDown(() -> IdeFocusManager.getGlobalInstance().requestFocus(table, true)); TableUtil.updateScroller(table); } @Override public @NotNull ActionUpdateThread getActionUpdateThread() { return ActionUpdateThread.EDT; } } ).createPanel(); }