net.refractions.udig.catalog.ui.wizard
Class DataBaseRegistryWizardPage

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.wizard.DataStoreWizardPage
                  extended by net.refractions.udig.catalog.ui.wizard.DataBaseRegistryWizardPage
All Implemented Interfaces:
UDIGConnectionPage
Direct Known Subclasses:
AbstractProprietaryDatastoreWizardPage

public abstract class DataBaseRegistryWizardPage
extends DataStoreWizardPage

David's magic superclass reduced to linear, documented, boring reality so that it may be understandable by mortals; this is an abstract superclass for implementations of the 'IWizardPage' interface required by the 'wizardPage' portion of the net.refractions.udig.catalog.ui.connectionFactory extension point contract with the uDig catalog system. The connectionFactory extension point needs a DataStore factory to make the connection used by the Catalog and a IWizardPage to obtain from the user the parameters which will be used by the factory. The IWizardPage interface extends the eclipse RCP 'Import...' system by providing a User Interface SWT Group which will be placed in a 'Page' of the import wizard and will obtain the required parameters to connect to some resource, in this case a database (Db) server. Concrete extensions of this class will then use the parameters to connect to the server using approaches specific to each Database Management System (DBMS). WARNING: Modifications to this class must consider the consequences for all extending classes, notably both PostGisWizardPage and AbstractProprietaryDatastoreWizardPage. ************* David's magic spells (now for mortals) *********************** This class performs a number of actions as explained below. These actions have been changed from happening magically in response to users clicking on the widgets to happening after user input or button clicks. Hopefully this logic will be more predicatable, robust, and understandable. Establish default Connection Parameters: * must be added by the extending class during its construction * are used to set the current connection parameters at the same time * TODO: let the user reset to this in the case where the user is lost Get Storage for Connection Parameters: * must be obtained or created by the extending class' constructor. Get and Use Stored Connection Parameters: * are taken from storage and added to the list by the extending class during its construction. * are added to the drop down list during * TODO: limit the parameters added to a few recent Retain Successful Connection Parameters: * are added to the list after each successful connection Store Successful Connection Parameters: * are stored to the storage system after each successful connection Show the Advanced group: * by the widgetSelected(.) handler for the check button widget if this widget is clicked (checked). Activate the lookup and connect buttons: * by the modifyText(.) handler for any of the input widgets, if the current host, port, user, password, and database parameters are all filled out. Lookup the available databases and schema on the server: * by the widgetSelected(.) handler for the "Lookup" button, when it is clicked. Connect to a database server: * by the widgetSelected(.) handler for the "Connect" button, when it is clicked. Activate the finish buttons: * by the widgetSelected(.) handler for the "Connect" button if, after the connection attempt, there is a live connection and the parameter map built from the current connection can be processed by the DataStore factory. Reset the lists of available resources when altering key connection params: * by the modifyText(.) handlers for each of the widgets: host, port, user, and password, when they are modified. Still to be done: (some of these are distant hopes) pre-select text on re-edit: * Note this seems to be the default when using the key to move through the widgets Hint text completion from the storage list: * Note this requires improvement in the earlier logic. Importantly, we must be able to connect to a resource that is a subset of an earlier resource, i.e. if a previous connection was made to the host "serverAlex," a user must still be able to connect to the host "serverA" by typing 's' 'e' 'r' 'v' 'e' 'r' 'A' '' without our completion logic getting in the way of the user. Validate input: * This is to be done in three parts, character exclusion, URL component validation, and URL validation: - changes with characters in the 'invalidChar*List' lists will not be allowed (and add an error in the RCP Animated Area). - changes with character sequences in the 'invalidString*List' lists will not be allowed (and add an error in the RCP Animated Area). - URLs will be subject to a coarse verification before being used to connect to a database. Password entry warnings: * If CapsLock is set during password entry, an error will be placed in the RCP Animated Area. Connection Status Information: * Will be displayed in the dialog. Verifications of permissions: * the permissions of the user on the server's database will be obtained and reported to the user. Verification of the database: * since we can only use spatial tables, the databases offered to the user should be evaluated to ensure they can hold spatial data. ****************** Class Outline (i.e. the key pieces) ********************

 
   FIELDS:                      // The fields describe here all use instances 
                                // of the inner class 
                                //   DataBaseConnInfo
                                // which is essentially a structure of
                                //       : host 
                                //       : port 
                                //       : user 
                                //       : ?pass? 
                                //         NOTE: the password field should 
                                //               probably be dropped in the
                                //               future since we want to treat 
                                //               it specially for safety.
                                //       : database 
                                //       : schema 
                                //       : timestamp (for sorting) 
   
       * currentDBCI            - The connection parameters gathered by the 
                                  GUI and used to make the final connection.
                                  
       * defaultDBCI            - Parameters which generally apply to the DBMS
                                - The database name will be used during initial
                                  lookup of the available databases and schema.
                                - The values will be provided as hints to the 
                                  user.
                            !MUST BE PROVIDED BY THE EXTENDING CONSTRUCTOR!
                            
       * storedDBCIList         - A java.util.List of DBCI which may be empty 
                                  if no successful connections have been made 
                                  or will hold a list of all the connections 
                                  made along with their timestamps.
   
   
   CONSTRUCTORS:                // Merely call the superclass with a String 
                                // for the page title area
   
   
   UTILITY METHODS:             // These are internal to the uDig system of 
                                // Database connection dialogs and therefore 
                                // only required by our needs.
   
   
   CONTRACT METHODS:            // Satisfy extension point contracts and 
                                // interface requirements.
   
       * setVisible             //TODO: document
       
       * isPageComplete         //TODO: document
       
       * createControl          // This creates the GUI as follows:
                                //   1. Instantiate the widgets
                                //   2. Populate the 'Previous' drop down list
                                //   3. Hook up the listeners
                                //   4? Connect the tab traversal
                                //   5? set page complete
       
       * createAdvancedControl  // Implemented in extending classes to add 
                                // GUI elements for DBMS specific parameters
       
       * getConnection          // THE WHOLE POINT, here is abstract, will be
                                // implemented with DBMS specific logic by the 
                                // concrete extendors of this class
   
   LOOKUP METHODS               // Two methods to lookup the databases and 
                                // schemata available
                                
       * lookupDB               - Gets a String array of available database
                                  names
       
       * lookupSchema           - Gets a String array of available schema
                                - names
   
   EVENT HANDLERS:
   
       * focusGain              //Does little
       
       * focusLoss              //Does little
       
       * verifyText             //Not yet implemented
           
       * modifyText             //Handles *all* the modification logic:
                                - uses the widget text to set the appropriate 
                                  current connection parameter
                                - resets the available database and schema 
                                  lists if they are no longer valid
                                - activates the lookup and connect buttons if
                                  the parameters are complete enough
       
       * widgetSelected         //Handles the button clicked events
       
           -lookupButtonWdg     - connects to the server with the default 
                                  database/schema and gets the list of 
                                  available databases and schemata.
                                  
           -connectButtonWdg    - makes the connection using currentDBCI.
           
           -advButtonWdg        - exposes the advanced section of the GUI.
           
       * widgetDefaultSelected  //Not used
   
   
   DataBaseConnInfo class       // A bean inner class, essentially a structure
                                // to hold the connection parameters and a 
                                // timestamp for the last successful 
                                // connection using those parameters.
 
 
 
****************** Contract with Concrete Extending Classses *************** This class, being abstract, is designed specifically for the needs of the extending classes, notably the PostGISWizardPage and the AbstractProprietaryDatastoreWizardPage classes. See

Since:
0.3
Author:
David Zwiers, dzwiers, for Refractions Research, Inc., Jody Garnett, jody, for Refractions Research, Inc., Jesse Eichar, jeichar, for Refractions Research, Inc., Richard Gould, rgould, for Refractions Research, Inc., Amr Alam, aalam, for Refractions Research, Inc., Justin Deoliveira, jdeolive, for Refractions Research, Inc., Cory Horner, chorner, for Refractions Research, Inc., Adrian Custer, acuster., Harry Bullen, hbullen.
See Also:
for the cannonical example of how to use (extend) this class in a concrete implementation. This class implicitly establishes the following contract with its extendors: I. EXTENDING CLASSES MUST: Implement a constructor which 1. calls this constructor, idealy with an appropriate string for the title area. 2. gets an IDialogSettings instance from the RCP storage system, creating a new instance if none is available. 3. populates the past connection list 4. populates the db and schema exclusion lists 5. TODO: populates the invalid character and characterSequence lists. Implement the abstract methods, most importantly the getConnection(.) method that will be used to make a test connection with the host. Override the createControl(..) method with an initial call to super.createControl(..args..) and then add logic to handle drag-and-drop (TODO). II. Extending classes may: Implement createAdvancedControl(..) to return an SWT Group widget which contains all the input widgets to obtain any DBMS specific advanced parameters desired, and handle all the appropriate event logic that ensues. Override the getDatabaseResultSet(..) and/or the getSchemasResultSet(..), if a different technique is necessary to retrieve a list of Databases or Schemas. ????????????????? DROP THIS SECTION AS REPETITIVE ????????????????????????? Note also: Extending classes wishing to expand the event handling logic should be aware of the following design for the UI event handling system: The JDBC 'Connection' to the Db or Schema on the DBMS will be obtained in response to the user clicking on the "Connect" button - This will be performed by the selectionListener(..) method tied to the connectButton. The selectionListener will eventually call the getConnection(..) method assuming the paramters to use are stored in the currConn DataBaseConnInfo field. The list of databases and schema available to the user on the DBMS will be obtained in response to the user clicking on the "Lookup" button - The selectionListener tied to to the button will create a temporary, dummy connection to the DBMS, possibly using some default database generally available on the specific DBMS if the user has not yet named any more specific database. The list of available databases and schema will be reset if the user changes any of the key connection parameters - If the user modifies the host, port, user, or password parameters, the list of available databases and schema will be reset to null. Parameters for successful connections will be stored into the eclipse RCP settings system and retrieved on page construction - Values will be obtained from the eclipse storage system and placed into a java.util.List field. The UI will offer the user a drop down list of past successful values and selection by the user will cause both the values to be stored into the currInfo object and into the text area of the input widgets. TODO: Input will be verified both character by character during input to the GUI widgets and as overall urls prior to connection - ? should this happen as each widget is about to loose focus? ? There are two strategies to help child classes: either a bunch of new methods can be created with names like verifyHostText() or we can create inner Listener classes. TODO: When focus arrives on an entry widget, the contents should be pre-selected so that direct input will obliterate existing values - TODO: The system must ignore focus events due to the user moving the mouse around the desktop. Auto-completion of values based on previous successful connection. TODO: Make sure the user actively must accept the auto-completed text so that a prior connection to 'localhost' does not prevent a future connection to 'local', i.e. the user should be able to type 'l', 'o', 'c', 'a', 'l', '' and not have the completion hint in the way. ****************************************************************************

Field Summary
protected  Button advancedBtnWgt
           
protected  Group advancedGrp
           
protected  Button connectBtnWgt
           
protected  DataBaseConnInfo currentDBCI
          The parameters we will use to make any eventual connection.
protected  BasicDataSource dataSource
          The connection used to actually connect with the database.
protected  Combo dbComboWgt
           
protected  java.util.List<java.lang.String> dbExclusionList
          The names of any databases which should not be offered to the user, generally used for databases that are part of the DBMS itself.
protected  DataBaseConnInfo defaultDBCI
          The parameters which work as defaults for the particular DBMS of the concrete extender; will be populated during construction.
protected  Text hostTextWgt
           
protected  Button lookupBtnWgt
           
protected  Text passTextWgt
           
protected  Text portTextWgt
           
protected  Combo rcntComboWgt
           
protected  Combo schemaComboWgt
           
protected  java.util.List<java.lang.String> schemaExclusionList
          The names of any schemata which should not be offered to the user, generally used for schemata that are part of the DBMS itself.
protected  IDialogSettings settings
          The RCP structure to hold and store the successful connection parameters.
protected  java.lang.String settingsArrayName
          The name of the section used to store the successful connection parameter settings in the RCP storage system.
protected  java.util.List<DataBaseConnInfo> storedDBCIList
          The parameters of any previous successful connection, obtained from storage during construction of the concrete extending class, added to following any successful connection and stored prior to exit.
protected  Text userTextWgt
           
 
Fields inherited from class net.refractions.udig.catalog.ui.wizard.DataStoreWizardPage
canFlipToNextPage
 
Constructor Summary
DataBaseRegistryWizardPage()
           
DataBaseRegistryWizardPage(java.lang.String header)
          The usual (?only one used?) constructor.
 
Method Summary
protected  void canNowConnect()
          Activates the 'Connect' button, and implicitly the 'Lookup' button.
protected  void canNowLookup()
          Activates the 'Lookup' button.
protected  boolean couldConnect()
          Evaluates if the currentDBCI is complete enough that we could attempt a connection
protected  boolean couldLookup()
          Evaluates if the currentDBCI is complete enough that we could attempt a connection to lookup values.
protected  Group createAdvancedControl(Composite arg0)
          Creates a GUI Group with widgets to set advanced parameters of the connection or, by default, null if there are no advanced settings.
 void createControl(Composite comp)
          Called by the Wizard to instantiate the page and draw the GUI.
protected abstract  boolean dbmsUsesSchema()
          Checks if the DBMS uses Schema or not; if true, the schema widget will be shown and the schema parameter passed to the DBMS during connect.
 void dispose()
           
protected  boolean excludeDbFromUserChoices(java.lang.String d)
          Checks the database name against those that should not be offered to the user for connection; by default, all database names are acceptable so the method always returns false.
protected  boolean excludeSchemaFromUserChoices(java.lang.String s)
          Checks the schema name against those that should not be offered to the user for connection; by default, all schema names are acceptable so the method always returns false.
 void focusGained(FocusEvent e)
          The focusGained method is called when input focus passes to one of the widgets in the page, following the standard FocusListener contract.
 void focusLost(FocusEvent e)
          The focusLost method is called when input focus leaves one of the widgets in our page, following the standard FocusListener contract.
protected  java.sql.ResultSet getDatabaseResultSet(java.sql.Connection c)
          This method can is called so that diffrent databases can provied their own method of obtaining the list of databases without overriding the lookupDbNamesForDisplay method.
protected abstract  javax.sql.DataSource getDataSource()
          This is the class that will actually obtain the DataSource.
protected  java.sql.ResultSet getSchemasResultSet(java.sql.Connection c)
          This method can is called so that diffrent databases can provied their own method of obtaining the list of schemas without overriding the lookupSchemasNamesForDisplay method.
 boolean isPageComplete()
          Method provided by the DataStoreWizardPage class.
protected  java.lang.String[] lookupDbNamesForDisplay(javax.sql.DataSource dataSource)
          This method is called in response to selection of the lookup button and gets the names of the available databases on the DBMS server.
protected  java.lang.String[] lookupSchemaNamesForDisplay(javax.sql.DataSource dataSource)
          This method is called in response to selection of the lookup button and gets the names of the available schemata on the DBMS server.
 void modifyText(ModifyEvent e)
          The modifyText method is called by the event handling mechanism for any widget with a Text field, notably Text and Combo widgets, according to the standard ModifyListener contract.
protected  void runInPage(IRunnableWithProgress activity)
          This method will run the provided activity using the wizard page progress bar; and wait for the result to complete.
 void setVisible(boolean visible)
          Method required by the IDialogPage implementation contract.
 void widgetDefaultSelected(SelectionEvent e)
          The method called by the event handling mechanism for any 'default' selection event on any widget to which this class was added as a SelectionListener.
 void widgetSelected(SelectionEvent e)
          The method called by the event handling mechanism for any regular (i.e.
 
Methods inherited from class net.refractions.udig.catalog.ui.wizard.DataStoreWizardPage
canFlipToNextPage, getDataStoreFactorySpi, getParams, setCanFlipToNextPage
 
Methods inherited from class net.refractions.udig.catalog.ui.AbstractUDIGImportPage
getNextPage, getResourceIDs, getServices, leavingPage, setErrorMessage, setMessage
 
Methods inherited from class net.refractions.udig.catalog.ui.workflow.WorkflowWizardPage
getState, getWizard, setState, shown
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

currentDBCI

protected final DataBaseConnInfo currentDBCI
The parameters we will use to make any eventual connection. Parameters are presumed to be valid once stored in this object. These Parameters will be obtained via the GUI from the user.


defaultDBCI

protected final DataBaseConnInfo defaultDBCI
The parameters which work as defaults for the particular DBMS of the concrete extender; will be populated during construction.


storedDBCIList

protected final java.util.List<DataBaseConnInfo> storedDBCIList
The parameters of any previous successful connection, obtained from storage during construction of the concrete extending class, added to following any successful connection and stored prior to exit. Copy new DBCI's into this list with DataBaseConnInfo dbci = new DataBaseConnInfo(""); storedDBCIList.add(dbci.setParameters(dbciToAdd)) rather than adding the DBCI directly in order to preserve the separation of instances.


settings

protected IDialogSettings settings
The RCP structure to hold and store the successful connection parameters. This must be here because we need to store the settings on successful connection.


dataSource

protected BasicDataSource dataSource
The connection used to actually connect with the database. Don't use this directly instead call getDataSource() and use what it returns.


settingsArrayName

protected java.lang.String settingsArrayName
The name of the section used to store the successful connection parameter settings in the RCP storage system.


rcntComboWgt

protected Combo rcntComboWgt

hostTextWgt

protected Text hostTextWgt

portTextWgt

protected Text portTextWgt

userTextWgt

protected Text userTextWgt

passTextWgt

protected Text passTextWgt

dbComboWgt

protected Combo dbComboWgt

schemaComboWgt

protected Combo schemaComboWgt

lookupBtnWgt

protected Button lookupBtnWgt

connectBtnWgt

protected Button connectBtnWgt

advancedBtnWgt

protected Button advancedBtnWgt

advancedGrp

protected Group advancedGrp

dbExclusionList

protected final java.util.List<java.lang.String> dbExclusionList
The names of any databases which should not be offered to the user, generally used for databases that are part of the DBMS itself. The list will be populated during construction.


schemaExclusionList

protected final java.util.List<java.lang.String> schemaExclusionList
The names of any schemata which should not be offered to the user, generally used for schemata that are part of the DBMS itself. The list will be populated during construction.

Constructor Detail

DataBaseRegistryWizardPage

public DataBaseRegistryWizardPage(java.lang.String header)
The usual (?only one used?) constructor.

Parameters:
header - The string presented to the user in the topmost part of the wizard page.

DataBaseRegistryWizardPage

public DataBaseRegistryWizardPage()
Method Detail

dbmsUsesSchema

protected abstract boolean dbmsUsesSchema()
Checks if the DBMS uses Schema or not; if true, the schema widget will be shown and the schema parameter passed to the DBMS during connect.

Returns:
true if the DBMS uses a Schema.

excludeDbFromUserChoices

protected boolean excludeDbFromUserChoices(java.lang.String d)
Checks the database name against those that should not be offered to the user for connection; by default, all database names are acceptable so the method always returns false. The constructor of implementing classes should add appropriate names to the exclusion list.

Parameters:
d - the name of the database to check.
Returns:
true if the name should be excluded from those presented to the user. Here it will be false always, because by default the dbExclusionList is empty.

excludeSchemaFromUserChoices

protected boolean excludeSchemaFromUserChoices(java.lang.String s)
Checks the schema name against those that should not be offered to the user for connection; by default, all schema names are acceptable so the method always returns false. The constructor of implementing classes should add appropriate names to the exclusion list.

Parameters:
s - the name of the schema to check.
Returns:
true if the name should be excluded from those presented to the user. Here it will be false always, because by default the schemaExclusionList is empty.

couldLookup

protected boolean couldLookup()
Evaluates if the currentDBCI is complete enough that we could attempt a connection to lookup values.

Returns:
true if we have all the pieces to connect, false otherwise

couldConnect

protected boolean couldConnect()
Evaluates if the currentDBCI is complete enough that we could attempt a connection

Returns:
true if we have all the pieces to connect, false otherwise

canNowLookup

protected void canNowLookup()
Activates the 'Lookup' button.


canNowConnect

protected void canNowConnect()
Activates the 'Connect' button, and implicitly the 'Lookup' button.


runInPage

protected void runInPage(IRunnableWithProgress activity)
This method will run the provided activity using the wizard page progress bar; and wait for the result to complete.

If anything goes wrong the message will be shown to the user

Parameters:
activity -

setVisible

public void setVisible(boolean visible)
Method required by the IDialogPage implementation contract.


isPageComplete

public boolean isPageComplete()
Method provided by the DataStoreWizardPage class. TODO: The method currently always returns false; it is probably better to leave it to the subclass to implement it since the compiler will catch the missing method.

Specified by:
isPageComplete in class DataStoreWizardPage
See Also:
org.eclipse.jface.wizard.IWizardPage#isPageComplete()

createControl

public void createControl(Composite comp)
Called by the Wizard to instantiate the page and draw the GUI.

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

createAdvancedControl

protected Group createAdvancedControl(Composite arg0)
Creates a GUI Group with widgets to set advanced parameters of the connection or, by default, null if there are no advanced settings. Classes extending this abstract class may override this method and both provide the widgets and handle the events.

Parameters:
arg0 - the parent widget in which the widgets will be added.
Returns:
the Group containing the widgets which will be drawn in the 'Advanced' section of the wizard page or null (the default) if there is none.

getDataSource

protected abstract javax.sql.DataSource getDataSource()
                                               throws java.lang.Exception
This is the class that will actually obtain the DataSource. It will try and make a connection to ensure this works out, as such it throws an SQLException if it's an odd day of the week or if you squint too hard.

Returns:
A working DataSource for the database. It should not be closed. But it might be if you are unlucky.
Throws:
java.lang.Exception

lookupDbNamesForDisplay

protected java.lang.String[] lookupDbNamesForDisplay(javax.sql.DataSource dataSource)
This method is called in response to selection of the lookup button and gets the names of the available databases on the DBMS server. Instead of overriding this method it is better to override the getDatabaseResultSet method if a custom way of getting the database names is needed

Parameters:
con - the java.sql.Connection returned by getConnection()
Returns:
An array of Strings containing the names of only the databases available on the server which are suitable for display to the user.

getDatabaseResultSet

protected java.sql.ResultSet getDatabaseResultSet(java.sql.Connection c)
                                           throws java.sql.SQLException
This method can is called so that diffrent databases can provied their own method of obtaining the list of databases without overriding the lookupDbNamesForDisplay method.

Parameters:
c - the java.sql.Connection returned by getConnection()
Returns:
A ResultSet that contains the Database names, for this connection.
Throws:
java.sql.SQLException

lookupSchemaNamesForDisplay

protected java.lang.String[] lookupSchemaNamesForDisplay(javax.sql.DataSource dataSource)
This method is called in response to selection of the lookup button and gets the names of the available schemata on the DBMS server. Like lookupDbNameForDisplay it is better to avoid overiding this method if a database specific implementation is needed. Instead overide getSchemaResultSet WARNING: This should never be called if !dbmsUsesSchema().

Parameters:
con - the java.sql.Connection object returned by getConnection()
Returns:
An array of Strings containing the names of the schemata available on the server.

getSchemasResultSet

protected java.sql.ResultSet getSchemasResultSet(java.sql.Connection c)
                                          throws java.sql.SQLException
This method can is called so that diffrent databases can provied their own method of obtaining the list of schemas without overriding the lookupSchemasNamesForDisplay method.

Parameters:
c - the java.sql.Connection returned by getConnection()
Returns:
A ResultSet that contains the Schema names, for this connection.
Throws:
java.sql.SQLException

focusGained

public void focusGained(FocusEvent e)
The focusGained method is called when input focus passes to one of the widgets in the page, following the standard FocusListener contract. If we need to distinguish internal changes of focus from changes of focus involving other programs, such as if the user wanders off to read about the GNU project in her browser and then comes back, we compare the widget which lost focus, saved when handling the focusLost event, to the widget for which this event has been generated. In this case we ignore any focusGain events for widgets which just had the focus; such widgets should still be in the correct state. We no longer trigger connections or validation on focusEvents because of this uncertainty. TODO: Gain of focus on text widgets merely pre-selects the text for deletion if the user inputs new text.

Parameters:
e - the event object describing the action that triggered this call
See Also:
org.eclipse.swt.events.FocusListener#focusGained(org.eclipse.swt.events.FocusEvent)

focusLost

public void focusLost(FocusEvent e)
The focusLost method is called when input focus leaves one of the widgets in our page, following the standard FocusListener contract. Note that loss of focus does not necessarily imply the user has to work on another widget but may be due to a temporary move to another part of the operating system---the user's mouse could have slipped onto another window or they could be checking email. We no longer trigger connections or validation on focusEvents because of this uncertainty.

Parameters:
e - the event (and widget via e.widget) generated for the focus change.
See Also:
org.eclipse.swt.events.FocusListener#focusLost(org.eclipse.swt.events.FocusEvent)

modifyText

public void modifyText(ModifyEvent e)
The modifyText method is called by the event handling mechanism for any widget with a Text field, notably Text and Combo widgets, according to the standard ModifyListener contract. We use this method to add the modified contents into the currentDBCI. The text of the modification should already have been verified prior to this method being called. We may add the verification of the whole text field either here or in the verify listener. TODO: add a verification step here to establish that the whole text contents of the widget's Text field are valid. Figure out how to respond if they are not. If any of the connection parameters are altered, we clear the lists of available databases and schemata since they are no longer guaranteed to work but we leave the text as is since the user is working on it. As a last step, we also evaluate if we can now connect, and if so activate the lookup and connect buttons.


widgetSelected

public void widgetSelected(SelectionEvent e)
The method called by the event handling mechanism for any regular (i.e. not 'default) selection event on any widget to which this class was added as a SelectionListener. The only widgets we care about are the button widgets. Text and Combo widgets will receive modifyEvents for any changes to their contents so we handle their entries in the modifyText(..) method.

Parameters:
e - the SelectionEvent which includes e.widget, the widget generating the event
See Also:
org.eclipse.swt.events.SelectionListener#widgetSelected(org.eclipse.swt.events.SelectionEvent), #widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent)

widgetDefaultSelected

public void widgetDefaultSelected(SelectionEvent e)
The method called by the event handling mechanism for any 'default' selection event on any widget to which this class was added as a SelectionListener. There is nothing to do here. The widgetDefaultSelected method is called only in the Text and Combo widgets when the key is typed while focus is on the Text field. Since changes to the text field all generate the modifyEvent as well, we will handle modifications in the modifyText(..) method and can do nothing here.

Parameters:
e -
See Also:
org.eclipse.swt.events.SelectionListener#widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent), #widgetSelected(org.eclipse.swt.events.SelectionEvent)

dispose

public void dispose()
Overrides:
dispose in class AbstractUDIGImportPage