uk.ac.starlink.hapi

## Class HapiTableLoadDialog

- java.lang.Object
- - uk.ac.starlink.table.gui.AbstractTableLoadDialog
  - - uk.ac.starlink.hapi.HapiTableLoadDialog

- All Implemented Interfaces:
    TableLoadDialog

      public class HapiTableLoadDialog
      extends AbstractTableLoadDialog

  TableLoadDialog for working with HAPI services.
  Since:
    12 Jan 2024

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `HapiTableLoadDialog()` No-arg constructor.
    `HapiTableLoadDialog(java.util.function.Consumer<java.net.URL> docUrlHandler)` Constructor using a URL handler.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `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.
    `javax.swing.JMenu[]` | `getMenus()` Returns an array of menus which may be presented in the window alongside the query component.
    `javax.swing.Action[]` | `getToolbarActions()` Returns an array of actions suitable for presentation as toolbar buttons alongside the query component.
    `boolean` | `isReady()` Indicates whether the submit action should be enabled.

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

      `addToolbarAction, asIOException, configure, createFormatSelector, getDescription, getIcon, getName, getQueryComponent, getSelectedFormat, getSubmitAction, isAvailable, isComponentShowing, 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

    - #### HapiTableLoadDialog

          public HapiTableLoadDialog()

      No-arg constructor.

    - #### HapiTableLoadDialog

          public HapiTableLoadDialog(java.util.function.Consumer<java.net.URL> docUrlHandler)

      Constructor using a URL handler.
      Parameters:
        `docUrlHandler` - handler for documentation URLs, typically displays in a browser; may be null

  - ### Method Detail

    - #### 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

    - #### getMenus

          public javax.swing.JMenu[] getMenus()

      Description copied from interface: `TableLoadDialog`
      Returns an array of menus which may be presented in the window alongside the query component.
      Specified by:
        `getMenus` in interface `TableLoadDialog`
      Overrides:
        `getMenus` in class `AbstractTableLoadDialog`
      Returns:
        menu array; may be empty

    - #### getToolbarActions

          public javax.swing.Action[] getToolbarActions()

      Description copied from interface: `TableLoadDialog`
      Returns an array of actions suitable for presentation as toolbar buttons alongside the query component.
      Specified by:
        `getToolbarActions` in interface `TableLoadDialog`
      Overrides:
        `getToolbarActions` in class `AbstractTableLoadDialog`
      Returns:
        toolbar action array; may be empty

    - #### isReady

          public boolean isReady()

      Description copied from class: `AbstractTableLoadDialog`
      Indicates whether the submit action should be enabled. The implementation should return true if the user should be allowed to submit the query, or false if the internal state of this dialogue is known to be incomplete in some way. Evaluation should be fast; the return does not need to provide a guarantee that a submitted query will suceed.

      The default implementation returns true.

      Overrides:
        `isReady` in class `AbstractTableLoadDialog`
      Returns:
        false iff dialogue state is known to be incomplete

    - #### 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