public void update(AnActionEvent e) { super.update(e); if (e != null) { if (e.getPresentation().isVisible() && findActions(e).length == 0) { e.getPresentation().setVisible(false); } } }
public boolean isApplicable(AnActionEvent event, final Map<String, Object> _params) { ActionGroup group = ((ActionGroup) ActionManager.getInstance() .getAction("jetbrains.mps.ide.editor.actions.GenerationActions_ActionGroup")); group.update(event); return group.getChildren(event).length != 0; }
@Override public void update(AnActionEvent e) { super.update(e); e.getPresentation() .setVisible( SendToFavoritesAction.isEnabled(e) && FavoritesTreeViewPanel.FAVORITES_LIST_NAME_DATA_KEY.getData(e.getDataContext()) != null); }
@Override public void update(AnActionEvent event) { super.update(event); Presentation presentation = event.getPresentation(); FileTemplate[] allTemplates = FileTemplateManager.getInstance().getAllTemplates(); for (FileTemplate template : allTemplates) { if (canCreateFromTemplate(event, template)) { presentation.setEnabled(true); return; } } presentation.setEnabled(false); }
public void update(AnActionEvent e) { // myAction.getChildren(e).length getTemplatePresentation().setText(myAction.getTemplatePresentation().getText()); super.update(e); }