void (@NotNull AnActionEvent e) { RadComponent rootComponent = myArea.getRootComponent(); if (rootComponent != null) { final List<RadComponent> selection = myArea.getSelection(); final List<RadComponent> components = new ArrayList<>(); rootComponent.accept(new RadComponentVisitor() { @Override public void endVisit(RadComponent component) { if (!component.isBackground()) { for (RadComponent selected : selection) { if (selected.isSameType(component)) { components.add(component); break; } } } } }, true); myArea.setSelection(components); } }