JComponent () { myList = new JBList<>(getListModel()); myList.setCellRenderer(createListCellRenderer(myList)); TreeUIHelper.getInstance().installListSpeedSearch(myList, VirtualFile::getPresentableUrl); ToolbarDecorator toolbarDecorator = ToolbarDecorator.createDecorator(myList) .disableUpDownActions() .setAddActionUpdater(e -> myEnabled) .setRemoveActionUpdater(e -> isRemoveActionEnabled(getSelectedRoots())) .setAddAction(button -> { final VirtualFile[] added = doAddItems(); if (added.length > 0) { setModified(true); } requestDefaultFocus(); setSelectedRoots(added); }) .setRemoveAction(button -> { int[] indices = myList.getSelectedIndices(); doRemoveItems(indices, myList); }); addToolbarButtons(toolbarDecorator); myPanel = toolbarDecorator.createPanel(); myPanel.setBorder(null); return myPanel; }