void () { Presentation presentation = new Presentation(); AnActionEvent event = AnActionEvent.createFromDataContext("", presentation, DataContext.EMPTY_CONTEXT); myEnableAction.update(event); myCurrentAction = presentation.isEnabledAndVisible() ? myEnableAction : myDisableAction; String text = myCurrentAction.getTemplateText(); button.getAction().putValue(Action.NAME, text); bundledButton.setText(text); }