use of org.stepik.core.courseFormat.StudyNode in project intellij-plugins by StepicOrg.
the class StudyStepNavigationAction method update.
@Override
public void update(AnActionEvent e) {
final Presentation presentation = e.getPresentation();
presentation.setEnabled(false);
Project project = e.getProject();
if (!StepikProjectManager.isStepikProject(project)) {
return;
}
StudyNode selected = StepikProjectManager.getSelected(project);
StudyNode target = getTargetStep(selected);
boolean enabled = selected == null || target != null;
if (StepikProjectManager.isAdaptive(project)) {
enabled = enabled && selected != null && target.getParent() == selected.getParent();
}
presentation.setEnabled(enabled);
}
Aggregations