net.refractions.udig.catalog.ui
Class FileConnectionPage

java.lang.Object
  extended by WizardPage
      extended by net.refractions.udig.catalog.ui.workflow.WorkflowWizardPage
          extended by net.refractions.udig.catalog.ui.AbstractUDIGImportPage
              extended by net.refractions.udig.catalog.ui.FileConnectionPage
All Implemented Interfaces:
UDIGConnectionPage

public class FileConnectionPage
extends AbstractUDIGImportPage
implements UDIGConnectionPage

A wizard page that opens a file dialog and closes the wizard when dialog is closed.

Since:
0.9.0
Author:
jeichar

Constructor Summary
FileConnectionPage()
          Construct OpenFilePage.
 
Method Summary
 boolean canFlipToNextPage()
          This method returns true if there are more states in the workflow, and the current page is complete.
 void createControl(Composite parent)
           
 FileDialog getFileDialog()
           
 java.lang.String getId()
           
 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()
protected  boolean hasOneResource(SubProgressMonitor monitor, java.util.List<IService> services)
           
 void shown()
          Called immediately after a page has been shown in the wizard.
 
Methods inherited from class net.refractions.udig.catalog.ui.AbstractUDIGImportPage
dispose, getNextPage, getParams, leavingPage, setErrorMessage, setMessage
 
Methods inherited from class net.refractions.udig.catalog.ui.workflow.WorkflowWizardPage
getState, getWizard, setState
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.refractions.udig.catalog.ui.UDIGConnectionPage
getParams, setErrorMessage
 

Constructor Detail

FileConnectionPage

public FileConnectionPage()
Construct OpenFilePage.

Method Detail

getId

public java.lang.String getId()

hasOneResource

protected boolean hasOneResource(SubProgressMonitor monitor,
                                 java.util.List<IService> services)
                          throws java.io.IOException
Throws:
java.io.IOException

canFlipToNextPage

public boolean canFlipToNextPage()
Description copied from class: WorkflowWizardPage
This method returns true if there are more states in the workflow, and the current page is complete. Subclasses should extend this method in the following way.
 
 public boolean canFlipToNextPage() {
   boolean flip = super.canFlipToNextPage();
   if (flip) {
        //validate user input (usually checking state of ui)
        if (...) {
                return true;
        }
   }
 
   return false;
 }
 
 

Overrides:
canFlipToNextPage in class WorkflowWizardPage
See Also:
org.eclipse.jface.wizard.WizardPage#canFlipToNextPage()

createControl

public void createControl(Composite parent)
See Also:
org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)

shown

public void shown()
Description copied from class: WorkflowWizardPage
Called immediately after a page has been shown in the wizard. At the time this method is called, the page can be sure that its ui has been created (via a call to #createContents()) and that it's state has been set (via #setState()). Default implementation does nothing, subclass should override.

Overrides:
shown in class WorkflowWizardPage

getFileDialog

public FileDialog getFileDialog()

getServices

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

Specified by:
getServices in interface UDIGConnectionPage
Overrides:
getServices in class AbstractUDIGImportPage

getResourceIDs

public java.util.Collection<java.net.URL> getResourceIDs()
Description copied from class: AbstractUDIGImportPage
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
Overrides:
getResourceIDs in class AbstractUDIGImportPage
Returns:
the ids of the GeoResource to use as the "selected" resources.