|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--javax.swing.JComponent | +--javax.swing.JPanel | +--uk.ac.starlink.table.gui.BasicTableLoadDialog | +--uk.ac.starlink.table.gui.FilestoreTableLoadDialog
Table load dialogue based on a FilestoreChooser.
Nested Class Summary |
Nested classes inherited from class uk.ac.starlink.table.gui.BasicTableLoadDialog |
BasicTableLoadDialog.DataSourceTableSupplier, BasicTableLoadDialog.TableSupplier |
Field Summary |
Fields inherited from class javax.swing.JComponent |
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
FilestoreTableLoadDialog()
|
Method Summary | |
FilestoreChooser |
getChooser()
|
protected BasicTableLoadDialog.TableSupplier |
getTableSupplier()
Concrete subclasses should implement this method to supply a TableSupplier object which can attempt to load a table based on the current state (as filled in by the user) of this component. |
boolean |
isAvailable()
Indicates whether this dialog can be invoked. |
void |
setEnabled(boolean enabled)
|
protected void |
setFormatModel(ComboBoxModel formatModel)
Installs a table format selector intot this dialogue. |
boolean |
showLoadDialog(Component parent,
StarTableFactory factory,
ComboBoxModel formatModel,
TableConsumer consumer)
Presents the user with a dialogue which may be used to specify a table to load. |
Methods inherited from class uk.ac.starlink.table.gui.BasicTableLoadDialog |
asIOException, createDialog, getCancelAction, getDescription, getName, getOkAction |
Methods inherited from class javax.swing.JPanel |
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public FilestoreTableLoadDialog()
Method Detail |
protected void setFormatModel(ComboBoxModel formatModel)
BasicTableLoadDialog
JComboBox
).
The default implementation does nothing (suitable for classes which can't make sense of varying table formats).
setFormatModel
in class BasicTableLoadDialog
formatModel
- selector model to installprotected BasicTableLoadDialog.TableSupplier getTableSupplier()
BasicTableLoadDialog
getTableSupplier
in class BasicTableLoadDialog
public boolean isAvailable()
TableLoadDialog
TableLoadDialog.showLoadDialog(java.awt.Component, uk.ac.starlink.table.StarTableFactory, javax.swing.ComboBoxModel, uk.ac.starlink.table.gui.TableConsumer)
,
but is not guaranteed to be invoked again.
public FilestoreChooser getChooser()
public void setEnabled(boolean enabled)
setEnabled
in class JComponent
public boolean showLoadDialog(Component parent, StarTableFactory factory, ComboBoxModel formatModel, TableConsumer consumer)
TableLoadDialog
In the event that true is returned, the implementation of this
method should ensure that notification of the table load attempt
should be made to the consumer argument
using the defined TableConsumer
methods.
The purpose of doing it like this
(rather than just returning a StarTable from this method)
is so that the table loading, which may be time-consuming,
can be done in a thread other than the event dispatch thread
on which this method will have been called.
The LoadWorker
class is provided to assist with this;
the usual idiom for performing the load from the event dispatch
thread within the implementation of this method looks like this:
new LoadWorker( tableConsumer, tableId ) { protected StarTable attemptLoad() throws IOException { return tableFactory.makeStarTable( ... ); } }.invoke();
Error conditions during the course of the user interaction by this method should in general be dealt with by informing the user (e.g. with a popup) and permitting another attempt. Some sort of cancel button should be provided which should trigger return with a false result.
The formatModel argument may be used to determine or
set the format to be used for interpreting tables.
Its entries are Strings, and in general the selected one
should be passed as the handler argument to one of
factory's makeStarTable methods.
The dialogue may wish to allow the user to modify the selection
by presenting a JComboBox
based on this model.
A suitable model can be obtained using
TableLoadChooser.makeFormatBoxModel(uk.ac.starlink.table.StarTableFactory)
.
showLoadDialog
in interface TableLoadDialog
showLoadDialog
in class BasicTableLoadDialog
parent
- parent windowfactory
- factory which may be used for table creationformatModel
- comboBoxModelconsumer
- object which can do something with the loaded table
|
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 |