net.refractions.udig.catalog.ui
Class IDataWizard

java.lang.Object
  extended by Wizard
      extended by net.refractions.udig.catalog.ui.IDataWizard

public abstract class IDataWizard
extends Wizard

A wizard which is used to import data into udig.

This is wizard is made up of primary pages, and secondary pages. A primary page is an

Author:
Justin Deoliveira,Refractions Research Inc.,jdeolive@refractions.net
See Also:
that the wizard declares it will contain. A secondary page is a page which is dynamically contributed to the wizard via a primary page, or another secondary page.

Sublcasses declare the ordered set of primary pages with the getPrimaryPages() method. Secondary pages are contributed dynamically by returning them from a call to,

Secondary page processing will continue, until a page returns null from getNextPage(). Processing then continues at the next primary page. If no more primary pages exist, the wizard finishes.

If using an IDataWizard outside of the workbench wizard framework, it is up to client code to call, immediatly after instantiating the wizard.

The following are requirements on the pages of the wizard.

Example: public IWizardPage getNextPage() { if (returnNewPage) { WizardPage newPage = new WizardPage(....); IDataWizard wizard = (IDataWizard)getWizard(); wizard.init(page); return page; } return super.getNextPage(); }

It is important to note that pages inside this wizard must return a page or super.getNextPage() from getNextPage().

This wizard creates dialog settings for pages upon creation.


Constructor Summary
IDataWizard()
           
 
Method Summary
 void addPages()
          Adds the primary pages to the wizard.
 boolean canFinish()
           
 IWizardPage getNextPage(IWizardPage page)
          Returns the next primary page in the page sequence.
protected abstract  WizardPage[] getPrimaryPages()
          Returns the set of primary pages.
 IStructuredSelection getSelection()
           
 IWorkbench getWorkbench()
           
 boolean hasMorePrimaryPages()
          Determines if the wizard has any more primary pages.
 void init(IWorkbench workbench, IStructuredSelection selection)
           
 void init(WizardPage page)
          Initializes a wizard page for use in the data wizard.
 boolean needsPreviousAndNextButtons()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IDataWizard

public IDataWizard()
Method Detail

init

public void init(IWorkbench workbench,
                 IStructuredSelection selection)
See Also:
IWorkbenchWizard#init(org.eclipse.ui.IWorkbench, org.eclipse.jface.viewers.IStructuredSelection)

getSelection

public IStructuredSelection getSelection()
Returns:
the selection the wizard was initialized with.

getWorkbench

public IWorkbench getWorkbench()
Returns:
the workbench the wizard was initialized with.

addPages

public void addPages()
Adds the primary pages to the wizard.

See Also:
org.eclipse.jface.wizard.IWizard#addPages()

getNextPage

public IWizardPage getNextPage(IWizardPage page)
Returns the next primary page in the page sequence. This method is called by the

See Also:
when a page does not contribute a secondary page., org.eclipse.jface.wizard.IWizard#getNextPage(org.eclipse.jface.wizard.IWizardPage)

hasMorePrimaryPages

public boolean hasMorePrimaryPages()
Determines if the wizard has any more primary pages.

Returns:
True if so, otherwise false.

needsPreviousAndNextButtons

public boolean needsPreviousAndNextButtons()
See Also:
org.eclipse.jface.wizard.IWizard#needsPreviousAndNextButtons()

canFinish

public boolean canFinish()

init

public void init(WizardPage page)
Initializes a wizard page for use in the data wizard. This method should be called by pages returning a new page from getNextPage().

Parameters:
page - The page to be initialized.

getPrimaryPages

protected abstract WizardPage[] getPrimaryPages()
Returns the set of primary pages. This method is called while the wizard is being instantiated.