JComponent () { JPanel panelForTable = ToolbarDecorator.createDecorator(myDirectoryMappingTable, null) .setAddActionUpdater(e -> !myIsDisabled && rootsOfOneKindInSelection()) .setAddAction(button -> { List<MapInfo> unregisteredRoots = getSelectedUnregisteredRoots(); if (unregisteredRoots.isEmpty()) { addMapping(); } else { addSelectedUnregisteredMappings(unregisteredRoots); } updateRootCheckers(); }) .setEditActionUpdater(e -> !myIsDisabled && onlyRegisteredRootsInSelection()) .setEditAction(button -> { editMapping(); updateRootCheckers(); }) .setRemoveActionUpdater(e -> !myIsDisabled && onlyRegisteredRootsInSelection()) .setRemoveAction(button -> { removeMapping(); updateRootCheckers(); }) .disableUpDownActions() .createPanel(); panelForTable.setPreferredSize(new JBDimension(-1, 200)); return panelForTable; }