private static void setConfigurationIcon( final Presentation presentation, final RunnerAndConfigurationSettings settings, final Project project) { try { presentation.setIcon(RunManagerEx.getInstanceEx(project).getConfigurationIcon(settings)); } catch (IndexNotReadyException ignored) { } }
@Override public void update(final AnActionEvent event) { final Presentation presentation = event.getPresentation(); String name = myEnvironment.getRunProfile().getName(); ProcessHandler processHandler = myDescriptor.getProcessHandler(); final boolean isRunning = processHandler != null && !processHandler.isProcessTerminated(); presentation.setText(ExecutionBundle.message("rerun.configuration.action.name", name)); presentation.setIcon(isRunning ? AllIcons.Actions.Restart : myExecutor.getIcon()); presentation.setEnabled(isEnabled()); }
public SelectTargetAction( final Project project, final ExecutionTarget target, boolean selected) { myProject = project; myTarget = target; String name = target.getDisplayName(); Presentation presentation = getTemplatePresentation(); presentation.setText(name, false); presentation.setDescription("Select " + name); presentation.setIcon(selected ? CHECKED_ICON : EMPTY_ICON); presentation.setSelectedIcon(selected ? CHECKED_SELECTED_ICON : EMPTY_ICON); }
private static void updatePresentation( @Nullable ExecutionTarget target, @Nullable RunnerAndConfigurationSettings settings, @Nullable Project project, @NotNull Presentation presentation) { if (project != null && target != null && settings != null) { String name = settings.getName(); if (target != DefaultExecutionTarget.INSTANCE) { name += " | " + target.getDisplayName(); } else { if (!settings.canRunOn(target)) { name += " | Nothing to run on"; } } presentation.setText(name, false); setConfigurationIcon(presentation, settings, project); } else { presentation.setText(""); // IDEA-21657 presentation.setIcon(null); } }
public SaveTemporaryAction() { Presentation presentation = getTemplatePresentation(); presentation.setIcon(AllIcons.Actions.Menu_saveall); }