JComponent (@NotNull Presentation presentation, @NotNull String place) { if (myDelegate instanceof Separator) { return getSecretComponentForToolbar(); // this is necessary because the toolbar hide if all action panels are not visible } myDelegate.applyTextOverride(myActionPlace, presentation); DataProvider dataProvider = myProvider instanceof DataProvider ? (DataProvider)myProvider : null; ActionLinkButton button = new ActionLinkButton(this, presentation, dataProvider); ClientProperty.put(button, InplaceEditor.IGNORE_MOUSE_EVENT, true); JPanel actionPanel = createCustomToolbarComponent(this, button); presentation.addPropertyChangeListener(new PropertyChangeListener() { @Override public void propertyChange(PropertyChangeEvent evt) { if (Presentation.PROP_TEXT.equals(evt.getPropertyName())) { String value = (String)evt.getNewValue(); button.setText(StringUtil.capitalize(value.toLowerCase(Locale.ROOT))); button.repaint(); } if (Presentation.PROP_ENABLED.equals(evt.getPropertyName())) { actionPanel.setVisible((Boolean)evt.getNewValue()); actionPanel.repaint(); } } }); actionPanel.setVisible(presentation.isEnabled()); return actionPanel; }