Ejemplo n.º 1
0
 /*
  * (non-Javadoc)
  *
  * @see
  * org.eclipse.jface.wizard.IWizard#getPreviousPage(org.eclipse.jface.wizard
  * .IWizardPage)
  */
 public IWizardPage getPreviousPage(IWizardPage page) {
   int index = pages.indexOf(page);
   if (index == 0 || index == -1)
     // first page or page not found
     return null;
   return (IWizardPage) pages.get(index - 1);
 }
Ejemplo n.º 2
0
  /*
   * (non-Javadoc)
   *
   * @see
   * org.eclipse.jface.wizard.IWizard#getNextPage(org.eclipse.jface.wizard
   * .IWizardPage)
   */
  public IWizardPage getNextPage(IWizardPage page) {
    int index = pages.indexOf(page);
    if (index == pages.size() - 1 || index == -1)
      // last page or page not found
      return null;

    return (IWizardPage) pages.get(index + 1);
  }
Ejemplo n.º 3
0
  protected void switchWizardFragment(WizardFragment newFragment) {
    List<WizardFragment> list = getAllWizardFragments();
    int oldIndex = list.indexOf(currentFragment);
    int newIndex = list.indexOf(newFragment);
    if (oldIndex == newIndex) return;

    if (currentFragment != null) currentFragment.exit();

    if (oldIndex < newIndex) oldIndex++;
    else oldIndex--;

    while (oldIndex != newIndex) {
      WizardFragment fragment = (WizardFragment) list.get(oldIndex);
      fragment.enter();
      fragment.exit();
      if (oldIndex < newIndex) oldIndex++;
      else oldIndex--;
    }

    currentFragment = newFragment;
    currentFragment.enter();
  }