use of com.intellij.openapi.actionSystem.Presentation in project intellij-community by JetBrains.
the class PyStudyIntroductionCourseAction method update.
@Override
public void update(AnActionEvent e) {
final File projectDir = new File(ProjectUtil.getBaseDir(), INTRODUCTION_FOLDER);
if (projectDir.exists()) {
return;
}
if (StudyProjectGenerator.getBundledIntro() != null) {
return;
}
Presentation presentation = e.getPresentation();
presentation.setVisible(false);
presentation.setEnabled(false);
}
use of com.intellij.openapi.actionSystem.Presentation in project intellij-community by JetBrains.
the class OpenTaskInBrowserAction method update.
@Override
public void update(AnActionEvent event) {
super.update(event);
if (event.getPresentation().isEnabled()) {
Presentation presentation = event.getPresentation();
String url = getIssueUrl(event);
presentation.setEnabled(url != null);
Project project = getProject(event);
if (project == null || !TaskManager.getManager(project).getActiveTask().isIssue()) {
presentation.setText(getTemplatePresentation().getText());
} else {
presentation.setText("Open '" + TaskManager.getManager(project).getActiveTask().getPresentableName() + "' In _Browser");
}
}
}
use of com.intellij.openapi.actionSystem.Presentation in project intellij-community by JetBrains.
the class CloseTaskAction method update.
@Override
public void update(AnActionEvent event) {
Presentation presentation = event.getPresentation();
Project project = getProject(event);
boolean enabled = project != null && !TaskManager.getManager(project).getActiveTask().isDefault();
presentation.setEnabled(enabled);
}
use of com.intellij.openapi.actionSystem.Presentation in project intellij-community by JetBrains.
the class EditTaskAction method update.
@Override
public void update(AnActionEvent event) {
super.update(event);
Presentation presentation = event.getPresentation();
Project project = getEventProject(event);
if (project != null && presentation.isEnabled()) {
presentation.setText("Edit '" + TaskManager.getManager(project).getActiveTask().getPresentableName() + "'");
}
}
use of com.intellij.openapi.actionSystem.Presentation in project intellij-community by JetBrains.
the class ExpandSelectionAction method update.
public void update(final AnActionEvent e) {
final Presentation presentation = e.getPresentation();
final GuiEditor editor = FormEditingUtil.getEditorFromContext(e.getDataContext());
if (editor == null) {
presentation.setEnabled(false);
return;
}
final SelectionState selectionState = editor.getSelectionState();
selectionState.setInsideChange(true);
final Stack<ComponentPtr[]> history = selectionState.getSelectionHistory();
presentation.setEnabled(!history.isEmpty());
}
Aggregations