CheckBoxListModelEditor<T> (final @NotNull Consumer<? super T> consumer) { toolbarDecorator.addExtraAction(new ToolbarDecorator.ElementActionButton(IdeBundle.message("button.copy"), PlatformIcons.COPY_ICON) { @Override public void actionPerformed(@NotNull AnActionEvent e) { int[] indices = list.getSelectedIndices(); if (indices == null) { return; } for (int index : indices) { T item = list.getItemAt(index); if (item != null) { consumer.consume(item); } } } @Override public @NotNull ActionUpdateThread getActionUpdateThread() { return ActionUpdateThread.EDT; } }); return this; }