|
||||||||||
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.TableLoadChooser
Window which permits the user to select an existing StarTable
from file browsers or other external sources.
The most straightforward way to use this is to invoke the
showTableDialog(java.awt.Component)
method.
As well as a text field in which the user may type the location of a
table, a number of buttons are offered which pop up additional dialogues,
for instance a normal file browser and a dialogue for posing an
SQL query. This list is extensible at run time; if you wish to
provide an additional table acquisition dialogue, then you must
provide an implementation of the TableLoadDialog
interface.
This can be made known to the chooser either by passing a list of
additional dialogues to the constructor,
or by specifying the class names as the value
of the system property with the name LOAD_DIALOGS_PROPERTY
(multiple classnames may be separated by colons).
In the latter case the implementing class(es) must have a
no-arg constructor.
By default, if the required classes are present, only the
FileChooserLoader
handler is installed.
As well as ones you might implement yourself, a number of other
useful TableLoadDialog
implementations are available in
the Starlink java set, including:
SQLReadDialog
(Load tables from an SQL server using JDBC)
uk.ac.starlink.datanode.tree.TreeTableLoadDialog
(Treeview-like hierarchical display of nodes)
uk.ac.starlink.vo.ConeSearchDialog
(Obtain a source catalogue using a cone search query)
uk.ac.starlink.vo.SiapTableLoadDialog
(Obtain a list of SIAP services)
uk.ac.starlink.vo.RegistryTableLoadDialog
(Get the result of a registry query as a table of resources)
If you want to make more customised use of this component than is offered by showTableDialog it is possible, but these javadocs don't go out of their way to explain how. Take a look at the implementation of showTableDialog.
Field Summary | |
static String |
LOAD_DIALOGS_PROPERTY
Name of the system property which can be used to specify the class names of additional TableLoadDialog implementations. |
static String[] |
STANDARD_DIALOG_CLASSES
List of classnames for TableLoadDialog
implementations used by default. |
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 | |
TableLoadChooser()
Constructs a new chooser window with default characteristics. |
|
TableLoadChooser(StarTableFactory factory)
Constructs a new chooser window with a specified table factory. |
|
TableLoadChooser(StarTableFactory factory,
TableLoadDialog[] dialogs,
String[] extraDialogNames)
Constructs a new chooser window with a specified table factory and specification of what load dialogues to use. |
Method Summary | |
void |
configureFromSaver(TableSaveChooser saver)
Sets the configuration of this loader to match that of a saver widget. |
JDialog |
createDialog(Component parent,
JProgressBar progBar)
Constructs a modal dialogue containing this window which can be presented to the user. |
String |
getFormatName()
Returns the format selected with which to interpret the table. |
TableLoadDialog[] |
getKnownDialogs()
Returns an array of all dialogues known by this chooser. |
StarTableFactory |
getStarTableFactory()
Returns the factory object which this chooser uses to resolve files into StarTables. |
Action |
getSubmitAction()
Returns the action used when the location text is submitted. |
StarTable |
getTable(Component parent)
Deprecated. use showTableDialog instead |
TableConsumer |
getTableConsumer()
Returns the object which does something with tables that the user selects to load. |
TransferHandler |
getTableImportTransferHandler()
Returns a transfer handler which will accept a table dropped on it as a selected one. |
Action |
makeAction(TableLoadDialog tld)
Constructs and returns a new action suitable for invoking a TableLoadDialog within this chooser. |
static TableLoadDialog[] |
makeDefaultLoadDialogs()
Returns a default list of sub-dialogs which can be invoked to load a table. |
static ComboBoxModel |
makeFormatBoxModel(StarTableFactory factory)
Creates and returns a ComboBoxModel suitable for use in a JComboBox which the user can use to choose the format of tables to be loaded. |
JMenu |
makeKnownDialogsMenu(String menuName)
Creates a menu containing actions for popping up modal dialogues corresponding to all the known load dialogue classes (as reported by getKnownDialogs() . |
void |
setEnabled(boolean isEnabled)
|
void |
setStarTableFactory(StarTableFactory factory)
Sets the factory object which this chooser uses to resove files into StarTables. |
void |
setTableConsumer(TableConsumer eater)
Sets the object which does something with tables that the user selects to load. |
StarTable |
showTableDialog(Component parent)
Pops up a modal dialogue which invites the user to select a table. |
void |
submitLocation(String location)
Attempts to make and select a table from a location string. |
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 |
Field Detail |
public static String[] STANDARD_DIALOG_CLASSES
TableLoadDialog
implementations used by default.
public static final String LOAD_DIALOGS_PROPERTY
TableLoadDialog
implementations.
Each must have a no-arg constructor. Multiple classnames should be
separated by colons.
Constructor Detail |
public TableLoadChooser()
makeDefaultLoadDialogs()
, are used.
public TableLoadChooser(StarTableFactory factory)
makeDefaultLoadDialogs()
, is used.
factory
- factory to use for creating tablespublic TableLoadChooser(StarTableFactory factory, TableLoadDialog[] dialogs, String[] extraDialogNames)
factory
- table factorydialogs
- main list of load dialoguesextraDialogNames
- names of additional classes which implement
TableLoadDialog
Method Detail |
public StarTable showTableDialog(Component parent)
parent
- the parent component, used for window positioning etc
public StarTable getTable(Component parent)
showTableDialog(java.awt.Component)
.
public void setTableConsumer(TableConsumer eater)
eater
- table consumerpublic TableConsumer getTableConsumer()
public StarTableFactory getStarTableFactory()
public void setStarTableFactory(StarTableFactory factory)
public void configureFromSaver(TableSaveChooser saver)
saver
- saverpublic String getFormatName()
public TableLoadDialog[] getKnownDialogs()
public JMenu makeKnownDialogsMenu(String menuName)
getKnownDialogs()
. Some of these may be
inactive if the requisite classes are not present etc.
menuName
- name of the menu. A default will be used if
null is suppliedpublic void setEnabled(boolean isEnabled)
setEnabled
in class JComponent
public JDialog createDialog(Component parent, JProgressBar progBar)
parent
- parent windowprogBar
- progress bar used to indicate load progresspublic Action makeAction(TableLoadDialog tld)
tld
- loader dialogue supplier
public TransferHandler getTableImportTransferHandler()
public void submitLocation(String location)
location
- public Action getSubmitAction()
public static TableLoadDialog[] makeDefaultLoadDialogs()
STANDARD_DIALOG_CLASSES
variable as well as any named
by the contents of the LOAD_DIALOGS_PROPERTY
property
(as long as the requisite classes can be loaded and instantiated).
TableLoadDialog
objectspublic static ComboBoxModel makeFormatBoxModel(StarTableFactory factory)
|
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 |