net.refractions.udig.catalog.service.database
Class UserHostPage

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.service.database.UserHostPage
All Implemented Interfaces:
UDIGConnectionPage

public class UserHostPage
extends AbstractUDIGImportPage
implements UDIGConnectionPage

The first of a two page wizard for connecting to a database. This page requires the user enter host, port, username and password.

Since:
1.1.0
Author:
jesse

Field Summary
protected static java.lang.String PASSWORD
           
protected static java.lang.String TIMESTAMP
           
 
Constructor Summary
UserHostPage(DatabaseServiceDialect dialect)
           
 
Method Summary
 void createControl(Composite parent)
           
 java.lang.String[] getDatabaseNames()
          Returns the database names looked up when the next button is pressed.
protected  IDialogSettings getDialogSettings()
           
 java.lang.String getHost()
          Returns the host parameter entered into this page.
 java.util.Map<java.lang.String,java.io.Serializable> getParams()
          Gather up connection parameters from the user interface
 java.lang.String getPassword()
          Returns the password parameter entered into this page.
 java.lang.Integer getPort()
          Returns the port parameter entered into this page.
 java.lang.String getUsername()
          Returns the username parameter entered into this page.
 boolean isPageComplete()
           
 boolean leavingPage()
          Called by framework as the page is about to be left.
protected  void removeConnection()
           
 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, getResourceIDs, getServices, setErrorMessage, setMessage
 
Methods inherited from class net.refractions.udig.catalog.ui.workflow.WorkflowWizardPage
canFlipToNextPage, 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
getResourceIDs, getServices, setErrorMessage
 

Field Detail

TIMESTAMP

protected static final java.lang.String TIMESTAMP
See Also:
Constant Field Values

PASSWORD

protected static final java.lang.String PASSWORD
See Also:
Constant Field Values
Constructor Detail

UserHostPage

public UserHostPage(DatabaseServiceDialect dialect)
Method Detail

getParams

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

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

createControl

public void createControl(Composite parent)

removeConnection

protected void removeConnection()

getDialogSettings

protected IDialogSettings getDialogSettings()

isPageComplete

public boolean isPageComplete()

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

leavingPage

public boolean leavingPage()
Description copied from class: AbstractUDIGImportPage
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 AbstractUDIGImportPage
Returns:
true if it is acceptable to leave the page false if the page must not be left
See Also:
WorkflowWizardPage.leavingPage()

getDatabaseNames

public java.lang.String[] getDatabaseNames()
Returns the database names looked up when the next button is pressed.

NOTE: This can therefore only be called after the next button has been pressed.

Returns:
the database names looked up when the next button is pressed.

getHost

public java.lang.String getHost()
Returns the host parameter entered into this page.

Returns:
the host parameter entered into this page.

getPort

public java.lang.Integer getPort()
Returns the port parameter entered into this page.

Returns:
the port parameter entered into this page.

getUsername

public java.lang.String getUsername()
Returns the username parameter entered into this page.

Returns:
the username parameter entered into this page.

getPassword

public java.lang.String getPassword()
Returns the password parameter entered into this page.

Returns:
the password parameter entered into this page.