uk.ac.starlink.table.gui
Interface TableLoadDialog

All Known Implementing Classes:
AbstractTableLoadDialog, FileChooserTableLoadDialog, FilestoreTableLoadDialog, LocationTableLoadDialog, SQLTableLoadDialog

public interface TableLoadDialog

Interface for an object which can handle the user interaction for selecting a table or tables to load.

Since:
13 Sept 2010

Method Summary
 void configure(StarTableFactory tfact, Action submitAct)
          Provides some configuration which must be performed before use.
 TableLoader createTableLoader()
          Returns a new object which specifies how table loading is to be performed.
 String getDescription()
          Returns a short description of this dialogue.
 Icon getIcon()
          Returns an icon associated with this dialogue.
 JMenu[] getMenus()
          Returns an array of menus which may be presented in the window alongside the query component.
 String getName()
          Returns the name of this dialogue.
 Component getQueryComponent()
          Returns the GUI component which allows the user to select how tables are to be loaded.
 Action getSubmitAction()
          Returns the action set by configure(uk.ac.starlink.table.StarTableFactory, javax.swing.Action).
 Action[] getToolbarActions()
          Returns an array of actions suitable for presentation as toolbar buttons alongside the query component.
 boolean isAvailable()
          Indicates whether this dialogue may be used.
 

Method Detail

getName

String getName()
Returns the name of this dialogue. This may be used as the text of a button (Action.NAME).

Returns:
dialogue name

getDescription

String getDescription()
Returns a short description of this dialogue. This may be used as the tooltip text of a button (Action.SHORT_DESCRIPTION).

Returns:
dialogue description

getIcon

Icon getIcon()
Returns an icon associated with this dialogue. A size of 24x24 pixels is preferred. Null may be returned if no icon is available.

Returns:
dialogue icon

getQueryComponent

Component getQueryComponent()
Returns the GUI component which allows the user to select how tables are to be loaded.

Returns:
component for user interaction

getMenus

JMenu[] getMenus()
Returns an array of menus which may be presented in the window alongside the query component.

Returns:
menu array; may be empty

getToolbarActions

Action[] getToolbarActions()
Returns an array of actions suitable for presentation as toolbar buttons alongside the query component.

Returns:
toolbar action array; may be empty

isAvailable

boolean isAvailable()
Indicates whether this dialogue may be used. Normally it will return true, but in the case that classes or other resources required for its use are missing, it should return false. In this case most of the other methods will not be called.

Returns:
true iff this dialogue may be able to do something useful

configure

void configure(StarTableFactory tfact,
               Action submitAct)
Provides some configuration which must be performed before use. This method should be called before 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 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.

Parameters:
tfact - representative table factory
submitAct - action for load submission

getSubmitAction

Action getSubmitAction()
Returns the action set by configure(uk.ac.starlink.table.StarTableFactory, javax.swing.Action).

Returns:
action which initiates a table load attempt

createTableLoader

TableLoader createTableLoader()
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

Copyright © 2004 CLRC: Central Laboratory of the Research Councils. All rights reserved.