void () { if (myMarketplace || myPluginModel.getState(myPlugin).isDisabled()) { myInstallButton.setButtonColors(false); myInstallButton.setEnabled(false, IdeBundle.message("plugin.status.not.allowed")); myInstallButton.setToolTipText(IdeBundle.message("plugin.status.not.allowed.tooltip")); } else { myInstallButton.setButtonColors(false); myInstallButton.setEnabled(true, IdeBundle.message("plugin.status.not.allowed.but.enabled")); myInstallButton.setText(IdeBundle.message("plugin.status.not.allowed.but.enabled")); myInstallButton.setToolTipText(IdeBundle.message("plugin.status.not.allowed.tooltip.but.enabled")); myInstallButton.setBorderColor(JBColor.red); myInstallButton.setTextColor(JBColor.red); myInstallButton.addActionListener(e -> { myPluginModel.disable(List.of(myPlugin)); setupNotAllowedMarkerButton(); }); } ColorButton.setWidth72(myInstallButton); }