void () { myCheckboxTree = new PostfixTemplatesCheckboxTree() { @Override protected void selectionChanged() { myUpdateDescriptionPanelAlarm.cancelAllRequests(); myUpdateDescriptionPanelAlarm.addRequest(() -> resetDescriptionPanel(), 100); } }; JPanel panel = new JPanel(new BorderLayout()); boolean canAddTemplate = ContainerUtil.find(getProviders(), p -> StringUtil.isNotEmpty(p.getPresentableName())) != null; panel.add(ToolbarDecorator.createDecorator(myCheckboxTree) .setAddActionUpdater(e -> canAddTemplate) .setAddAction(button -> myCheckboxTree.addTemplate(button)) .setAddIcon(LayeredIcon.ADD_WITH_DROPDOWN) .setEditActionUpdater(e -> myCheckboxTree.canEditSelectedTemplate()) .setEditAction(button -> myCheckboxTree.editSelectedTemplate()) .setRemoveActionUpdater(e -> myCheckboxTree.canRemoveSelectedTemplates()) .setRemoveAction(button -> myCheckboxTree.removeSelectedTemplates()) .addExtraAction(duplicateAction()) .createPanel()); myUi.getTemplatesTreeContainer().setLayout(new BorderLayout()); myUi.getTemplatesTreeContainer().add(panel); }