use of com.intellij.openapi.actionSystem.Presentation in project intellij-community by JetBrains.
the class DumpLookupElementWeights method update.
@Override
public void update(final AnActionEvent e) {
final Presentation presentation = e.getPresentation();
final Editor editor = e.getData(CommonDataKeys.EDITOR);
presentation.setEnabled(editor != null && LookupManager.getActiveLookup(editor) != null);
}
use of com.intellij.openapi.actionSystem.Presentation in project intellij-community by JetBrains.
the class ContentEntryEditingAction method update.
@Override
public void update(AnActionEvent e) {
super.update(e);
final Presentation presentation = e.getPresentation();
presentation.setEnabled(true);
final VirtualFile[] files = getSelectedFiles();
if (files.length == 0) {
presentation.setEnabled(false);
return;
}
for (VirtualFile file : files) {
if (file == null || !file.isDirectory()) {
presentation.setEnabled(false);
break;
}
}
}
use of com.intellij.openapi.actionSystem.Presentation in project intellij-community by JetBrains.
the class LocalHistoryAction method update.
@Override
public void update(@NotNull AnActionEvent e) {
Presentation p = e.getPresentation();
if (e.getProject() == null) {
p.setEnabledAndVisible(false);
} else {
p.setVisible(true);
p.setText(getText(e), true);
LocalHistoryFacade vcs = getVcs();
IdeaGateway gateway = getGateway();
p.setEnabled(vcs != null && gateway != null && isEnabled(vcs, gateway, e));
}
}
use of com.intellij.openapi.actionSystem.Presentation in project intellij-community by JetBrains.
the class TreeExpandAllActionBase method update.
public final void update(AnActionEvent event) {
Presentation presentation = event.getPresentation();
TreeExpander expander = getExpander(event.getDataContext());
presentation.setEnabled(expander != null && expander.canExpand());
}
use of com.intellij.openapi.actionSystem.Presentation in project intellij-community by JetBrains.
the class FakeRerunAction method update.
@Override
public void update(@NotNull AnActionEvent event) {
Presentation presentation = event.getPresentation();
ExecutionEnvironment environment = getEnvironment(event);
if (environment != null) {
presentation.setText(ExecutionBundle.message("rerun.configuration.action.name", StringUtil.escapeMnemonics(environment.getRunProfile().getName())));
presentation.setIcon(ExecutionManagerImpl.isProcessRunning(getDescriptor(event)) ? AllIcons.Actions.Restart : environment.getExecutor().getIcon());
presentation.setEnabled(isEnabled(event));
return;
}
presentation.setEnabled(false);
}
Aggregations