@Nullable @Override public WizardPage<T> navigateToFirst() { resetNavigationState(); return navigateToNext(); }
/** * Add page to wizard at the specified position. * * @param page page to be stored at the specified position * @param index position where the page should be inserted * @param replace {@code true} if the existed page should be replaced by the given one, {@code * false} if a page should be inserted at the specified position */ public void addPage(@NotNull WizardPage<T> page, int index, boolean replace) { if (index >= wizardPages.size()) { addPage(page); return; } if (replace) { setPage(page, index); } else { List<WizardPage<T>> before = ListHelper.slice(wizardPages, 0, index); WizardPage<T> currentPage = wizardPages.get(index); List<WizardPage<T>> after = ListHelper.slice(wizardPages, index + 1, wizardPages.size()); wizardPages.clear(); wizardPages.addAll(before); addPage(page); wizardPages.add(currentPage); wizardPages.addAll(after); } }
@Nullable @Override public WizardPage<T> navigateToNext() { return getNextPage(); }