void (@NotNull AnActionEvent e) { Project project = e.getProject(); GroupItem groupToBeRemoved = e.getData(GroupItem.DATA_KEY); if (groupToBeRemoved == null || project == null) return; if(!Palette.isRemovable(groupToBeRemoved)){ Messages.showInfoMessage( project, UIDesignerBundle.message("error.cannot.remove.default.group"), CommonBundle.getErrorTitle() ); return; } Palette palette = Palette.getInstance(project); ArrayList<GroupItem> groups = new ArrayList<>(palette.getGroups()); groups.remove(groupToBeRemoved); palette.setGroups(groups); }