uk.ac.starlink.table.gui

## Class SQLTableLoadDialog

- java.lang.Object
- - uk.ac.starlink.table.gui.AbstractTableLoadDialog
  - - uk.ac.starlink.table.gui.SQLTableLoadDialog

- All Implemented Interfaces:
    TableLoadDialog

      public class SQLTableLoadDialog
      extends AbstractTableLoadDialog

  Load dialogue for loading data from a database via JDBC.
  Since:
    14 Sep 2010

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `SQLTableLoadDialog()` Constructor.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `configure(StarTableFactory tfact, javax.swing.Action submitAct)` Provides some configuration which must be performed before use.
    `protected java.awt.Component` | `createQueryComponent()` Constructs the query component used by this dialogue.
    `TableLoader` | `createTableLoader()` Returns a new object which specifies how table loading is to be performed.
    `boolean` | `isAvailable()` The default implementation returns true.

    - ### Methods inherited from class uk.ac.starlink.table.gui.AbstractTableLoadDialog

      `asIOException, createFormatSelector, getDescription, getIcon, getMenus, getName, getQueryComponent, getSelectedFormat, getSubmitAction, getToolbarActions, isComponentShowing, isReady, setIcon, setIconUrl, setMenus, setToolbarActions, submit, updateReady`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### SQLTableLoadDialog

          public SQLTableLoadDialog()

      Constructor.

  - ### Method Detail

    - #### isAvailable

          public boolean isAvailable()

      Description copied from class: `AbstractTableLoadDialog`
      The default implementation returns true.
      Specified by:
        `isAvailable` in interface `TableLoadDialog`
      Overrides:
        `isAvailable` in class `AbstractTableLoadDialog`
      Returns:
        true iff this dialogue may be able to do something useful

    - #### configure

          public void configure(StarTableFactory tfact,
                                javax.swing.Action submitAct)

      Description copied from interface: `TableLoadDialog`
      Provides some configuration which must be performed before use. This method should be called before `TableLoadDialog.getQueryComponent()` is called.

      The `tfact` argument provides a table factory which resembles the one to be used for generating tables. Although this factory should not in general be used or retained, since the one presented later to the TableLoader should be used instead, it can be interrogated for known table formats etc.

      The `submitAct` argument sets the action which when invoked will cause `TableLoadDialog.createTableLoader()` to be called. Its setEnabled method can be called to reflect readiness, and it can be added as a listener to dialogue-specific events which indicate that a selection has been made.

      Specified by:
        `configure` in interface `TableLoadDialog`
      Overrides:
        `configure` in class `AbstractTableLoadDialog`
      Parameters:
        `tfact` - representative table factory
        `submitAct` - action for load submission

    - #### createQueryComponent

          protected java.awt.Component createQueryComponent()

      Description copied from class: `AbstractTableLoadDialog`
      Constructs the query component used by this dialogue. Called only once (lazily).
      Specified by:
        `createQueryComponent` in class `AbstractTableLoadDialog`
      Returns:
        query component

    - #### createTableLoader

          public TableLoader createTableLoader()

      Description copied from interface: `TableLoadDialog`
      Returns a new object which specifies how table loading is to be performed. The actions performed by the returned object will presumably be determined by the state at call time of this dialogues GUI component.

      If the dialogue is not in a suitable state, either return null, or, if you want to provide more detailed information about what's wrong, throw a RuntimeException with an informative message.

      Returns:
        new table loader object