Exemplo n.º 1
0
 private void update() {
   if (null != currentPage) {
     setText(currentPage.getWindowTitle());
     setTitle(currentPage.getTitle());
     setDescription(currentPage.getDesciption());
   }
 }
Exemplo n.º 2
0
 /*
  * (non-Javadoc) Method declared on IWizard.
  */
 public IWizardPage getPage(String name) {
   for (int i = 0; i < pages.size(); i++) {
     IWizardPage page = (IWizardPage) pages.get(i);
     String pageName = page.getName();
     if (pageName.equals(name)) {
       return page;
     }
   }
   return null;
 }
Exemplo n.º 3
0
  public void showPage(String pageID) {
    if (false == pages.containsKey(pageID)) {
      Debug.out("MultipageWizard:: a page with this ID is not found ID:" + pageID);
      return;
    }

    IWizardPage page = (IWizardPage) pages.get(pageID);

    if (null != currentPage) {
      if (true == currentPage.getPageID().equals(page.getPageID())) {
        return;
      }
      currentPage.performAboutToBeHidden();
    }

    /*
     * Initializing the page if not done already
     */
    if (false == initializedPages.contains(page.getPageID())) {
      page.createControls(contentPanel);
      initializedPages.add(page.getPageID());
    }

    page.performAboutToBeShown();

    previousPage = currentPage;
    currentPage = page;
    contentStackLayout.topControl = page.getControl();

    update();

    contentPanel.layout(true);
  }
Exemplo n.º 4
0
  public void open() {
    /*
     * Show the first page
     */
    if (false == pages.isEmpty()) {
      IWizardPage page = (IWizardPage) pages.values().iterator().next();
      showPage(page.getPageID());
    }

    shell.open();
  }
Exemplo n.º 5
0
 /**
  * The <code>Wizard</code> implementation of this <code>IWizard</code> method creates all the
  * pages controls using <code>IDialogPage.createControl</code>. Subclasses should reimplement this
  * method if they want to delay creating one or more of the pages lazily. The framework ensures
  * that the contents of a page will be created before attempting to show it.
  */
 public void createPageControls(Composite pageContainer) {
   // the default behavior is to create all the pages controls
   for (int i = 0; i < pages.size(); i++) {
     IWizardPage page = (IWizardPage) pages.get(i);
     page.createControl(pageContainer);
     // page is responsible for ensuring the created control is
     // accessable
     // via getControl.
     Assert.isNotNull(page.getControl());
   }
 }
Exemplo n.º 6
0
  public boolean removePage(IWizardPage page) {
    if (null == page) {
      return false;
    }

    if (false == pages.containsKey(page.getPageID())) {
      Debug.out("MultipageWizard:: a page with this ID is not found ID:" + page.getPageID());
      return false;
    }
    pages.remove(page.getPageID());
    page.performDispose();
    return true;
  }
Exemplo n.º 7
0
  public boolean isLastPage(String pageID) {
    if (false == pages.isEmpty()) {
      IWizardPage page = null;
      for (Iterator iterator = pages.values().iterator(); iterator.hasNext(); ) {
        page = (IWizardPage) iterator.next();
      }

      if (null != page) {
        return page.getPageID().equals(pageID);
      }
    }
    return false;
  }
Exemplo n.º 8
0
  public void performNext() {
    if (true == pages.isEmpty()) {
      return;
    }

    if (null == currentPage) {
      IWizardPage page = (IWizardPage) pages.values().iterator().next();
      showPage(page.getPageID());
    } else {
      boolean foundCurrent = false;
      for (Iterator iterator = pages.values().iterator(); iterator.hasNext(); ) {
        IWizardPage page = (IWizardPage) iterator.next();
        if (true == foundCurrent) {
          showPage(page.getPageID());
          return;
        }

        if (page.getPageID().equals(currentPage.getPageID())) {
          foundCurrent = true;
        }
      }

      if (false == foundCurrent) {
        Debug.out("MultipageWizard:: there is no more page to go to");
      }
    }
  }
Exemplo n.º 9
0
  public boolean addPage(IWizardPage page) {
    if (null == page) {
      return false;
    }
    if (true == pages.containsKey(page.getPageID())) {
      Debug.out("MultipageWizard:: a page with this ID already exists ID:" + page.getPageID());
      return false;
    }

    pages.put(page.getPageID(), page);

    if (true == page.isInitOnStartup()) {
      page.createControls(contentPanel);
      initializedPages.add(page.getPageID());
    }
    return true;
  }
Exemplo n.º 10
0
  public void performBack() {

    if (null != previousPage) {
      showPage(previousPage.getPageID());
    }
  }
Exemplo n.º 11
0
 /**
  * Adds a new page to this wizard. The page is inserted at the end of the page list.
  *
  * @param page the new page
  */
 public void addPage(IWizardPage page) {
   pages.add(page);
   page.setWizard(this);
 }