/** * Finds the next visible step based on the active step. * * @return The next visible step based on the active step */ protected final IWizardStep findNextVisibleStep() { int startIndex = (activeStep == null) ? 0 : steps.indexOf(activeStep) + 1; for (int i = startIndex; i < conditions.size(); i++) { ICondition condition = conditions.get(i); if (condition.evaluate()) { return steps.get(i); } } throw new IllegalStateException("Wizard contains no more visible steps"); }
/** * Finds the next visible step based on the active step. * * @return The next visible step based on the active step */ protected final IWizardStep findNextVisibleStep() { int startIndex = (activeStep == null) ? 0 : steps.indexOf(activeStep) + 1; for (int i = startIndex; i < conditions.size(); i++) { ICondition condition = conditions.get(i); if (condition.evaluate()) { return steps.get(i); } } throw new IllegalStateException("Wizard contains no more visible steps"); }
/** * Finds the last step in this model. * * @return The last step */ protected final IWizardStep findLastStep() { for (int i = conditions.size() - 1; i >= 0; i--) { ICondition condition = conditions.get(i); if (condition.evaluate()) { return steps.get(i); } } throw new IllegalStateException("Wizard contains no visible steps"); }
/** * Finds the last step in this model. * * @return The last step */ protected final IWizardStep findLastStep() { for (int i = conditions.size() - 1; i >= 0; i--) { ICondition condition = conditions.get(i); if (condition.evaluate()) { return steps.get(i); } } throw new IllegalStateException("Wizard contains no visible steps"); }
/** * @see IWizardModel#stepIterator() */ @Override public Iterator<IWizardStep> stepIterator() { List<IWizardStep> filtered = new ArrayList<>(); for (int s = 0; s < steps.size(); s++) { if (conditions.get(s).evaluate()) { filtered.add(steps.get(s)); } } return filtered.iterator(); }