net.refractions.udig.catalog.ui
Class AbstractUDIGImportPage

java.lang.Object
  extended by WizardPage
      extended by net.refractions.udig.catalog.ui.workflow.WorkflowWizardPage
          extended by net.refractions.udig.catalog.ui.AbstractUDIGImportPage
All Implemented Interfaces:
UDIGConnectionPage
Direct Known Subclasses:
DataConnectionPage, DataStoreWizardPage, FileConnectionPage, NewServiceConnectionPage, UserHostPage

public abstract class AbstractUDIGImportPage
extends WorkflowWizardPage
implements UDIGConnectionPage

Abstract implementation of UDIGImportPage.

Author:
jdeolive

Constructor Summary
AbstractUDIGImportPage(java.lang.String pageName)
           
 
Method Summary
 void dispose()
           
 IWizardPage getNextPage()
           
 java.util.Map<java.lang.String,java.io.Serializable> getParams()
          Gather up connection parameters from the user interface
 java.util.Collection<java.net.URL> getResourceIDs()
          Returns the ids of the GeoResource to use as the "selected" resources.
 java.util.Collection<IService> getServices()
          Default implementation creates a collection of services from the parameters returned UDIGConnectionPage.getParams()
 boolean leavingPage()
          Called by framework as the page is about to be left.
 void setErrorMessage(java.lang.String newMessage)
          Sets the error Message on the wizard page.
 void setMessage(java.lang.String newMessage, int newType)
          Sets a Message on the wizard page.
 
Methods inherited from class net.refractions.udig.catalog.ui.workflow.WorkflowWizardPage
canFlipToNextPage, getState, getWizard, setState, shown
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractUDIGImportPage

public AbstractUDIGImportPage(java.lang.String pageName)
Method Detail

setMessage

public void setMessage(java.lang.String newMessage,
                       int newType)
Sets a Message on the wizard page. Since these pages are decorated by a connection page the default implementation Fails


setErrorMessage

public void setErrorMessage(java.lang.String newMessage)
Sets the error Message on the wizard page. Since these pages are decorated by a connection page the default implementation Fails to display the error.

Specified by:
setErrorMessage in interface UDIGConnectionPage
Parameters:
newMessage - the message, or null to clear the error message

getNextPage

public final IWizardPage getNextPage()

leavingPage

public boolean leavingPage()
Called by framework as the page is about to be left.

There are two main use cases for this method. The first is to save settings for the next time the wizard is visited. The other is to perform some checks or do some loading that is too expensive to do every time isPageComplete() is called. For example a database wizard page might try to connect to the database in this method rather than isPageComplete() because it is such an expensive method to call.

Remember that this method is only called when moving forward.

If an expensive method is called make sure to run it in the container:

 getContainer().run(false, cancelable, runnable);
 
Remember to pass in false as the fork parameter so that it blocks until the method has completed executing.

Overrides:
leavingPage in class WorkflowWizardPage
Returns:
true if it is acceptable to leave the page false if the page must not be left
See Also:
WorkflowWizardPage.leavingPage()

getResourceIDs

public java.util.Collection<java.net.URL> getResourceIDs()
Returns the ids of the GeoResource to use as the "selected" resources. If a non-empty collection is returned then the next states in the wizard "should" use these as the items selected by the user.

Example: The postgis wizard pages permits the user to select the table of interest. When moving to a new state (for example the Resource Selection State in net.refractions.udig.project.ui) that state should use that as the selected IGeoResources if it needs a selection of IGeoResources
In the ResourceSelectionState example it would use this collection and not need to query the user with a wizard page for that input

Specified by:
getResourceIDs in interface UDIGConnectionPage
Returns:
the ids of the GeoResource to use as the "selected" resources.

getServices

public java.util.Collection<IService> getServices()
Default implementation creates a collection of services from the parameters returned UDIGConnectionPage.getParams()

Specified by:
getServices in interface UDIGConnectionPage

getParams

public java.util.Map<java.lang.String,java.io.Serializable> getParams()
Gather up connection parameters from the user interface

Specified by:
getParams in interface UDIGConnectionPage
Returns:
connection parameters from the user interface

dispose

public void dispose()