|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.ac.starlink.table.gui.AbstractTableLoadDialog
public abstract class AbstractTableLoadDialog
Partial implementation of TableLoadDialog interface.
Constructor Summary | |
---|---|
protected |
AbstractTableLoadDialog(String name,
String description)
Constructor. |
Method Summary | |
---|---|
static IOException |
asIOException(Throwable th)
Converts an exception to an IOException, probably by wrapping it in one. |
void |
configure(StarTableFactory tfact,
Action submitAct)
Provides some configuration which must be performed before use. |
JComboBox |
createFormatSelector()
Returns a new combo box which can be used to select table formats from the ones known by this dialogue. |
protected abstract Component |
createQueryComponent()
Constructs the query component used by this dialogue. |
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. |
String |
getSelectedFormat()
Returns the table format currently selected by any of the format selectors. |
Action |
getSubmitAction()
Returns the action set by TableLoadDialog.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()
The default implementation returns true. |
boolean |
isComponentShowing()
Indicates whether the query component of this dialogue is currently contained in a visible window. |
boolean |
isReady()
Indicates whether the submit action should be enabled. |
void |
setIcon(Icon icon)
Sets the icon to associate with this dialogue. |
void |
setIconUrl(URL iconUrl)
Sets the icon to associate with this dialogue by specifying its URL. |
void |
setMenus(JMenu[] menus)
Sets the menus for this dialogue. |
protected void |
setToolbarActions(Action[] acts)
Sets the toolbar actions for this dialogue. |
protected void |
submit()
Invokes this dialogue's Submit Action with a non-descript ActionEvent. |
protected void |
updateReady()
Updates the enabledness state of this dialogue's Submit Action according to the current value of isReady() . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface uk.ac.starlink.table.gui.TableLoadDialog |
---|
createTableLoader |
Constructor Detail |
---|
protected AbstractTableLoadDialog(String name, String description)
name
- dialogue namedescription
- dialogue descriptionMethod Detail |
---|
protected abstract Component createQueryComponent()
public String getName()
TableLoadDialog
Action.NAME
).
getName
in interface TableLoadDialog
public String getDescription()
TableLoadDialog
Action.SHORT_DESCRIPTION
).
getDescription
in interface TableLoadDialog
public Icon getIcon()
TableLoadDialog
getIcon
in interface TableLoadDialog
public Component getQueryComponent()
TableLoadDialog
getQueryComponent
in interface TableLoadDialog
public JMenu[] getMenus()
TableLoadDialog
getMenus
in interface TableLoadDialog
public void setMenus(JMenu[] menus)
menus
- menu arraypublic Action[] getToolbarActions()
TableLoadDialog
getToolbarActions
in interface TableLoadDialog
protected void setToolbarActions(Action[] acts)
acts
- toolbar actionspublic boolean isAvailable()
isAvailable
in interface TableLoadDialog
public void setIcon(Icon icon)
icon
- iconpublic void setIconUrl(URL iconUrl)
iconUrl
- URL of gif, png or jpeg iconpublic void configure(StarTableFactory tfact, Action submitAct)
TableLoadDialog
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.
configure
in interface TableLoadDialog
tfact
- representative table factorysubmitAct
- action for load submissionpublic JComboBox createFormatSelector()
public String getSelectedFormat()
createFormatSelector()
public Action getSubmitAction()
TableLoadDialog
TableLoadDialog.configure(uk.ac.starlink.table.StarTableFactory, javax.swing.Action)
.
getSubmitAction
in interface TableLoadDialog
public boolean isComponentShowing()
protected void submit()
protected void updateReady()
isReady()
.
Subclasses should call this method when the return value of
isReady
might have changed.
public boolean isReady()
The default implementation returns true.
public static IOException asIOException(Throwable th)
TableSupplier.getTable
.
th
- base throwable
th
|
Copyright © 2004 CLRC: Central Laboratory of the Research Councils. All rights reserved. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |