uk.ac.starlink.table.gui
Class StarTableNodeChooser

java.lang.Object
  |
  +--uk.ac.starlink.table.gui.StarTableNodeChooser

public class StarTableNodeChooser
extends Object

Provides a browser widget which presents the hierarchy of available nodes graphically and allows a StarTable to be selected.

This is currently implemented on top of classes in the uk.ac.starlink.treeview package; there is no guarantee that these will be available at compile time, so it's all done via reflection. Hence the interface is deliberately sparse. In due course the package hierarchy ought to be reorganised so that the widget on which the one provided here is based will be available to application packages directly.

In the mean time, classes which know that they have access to the classes in the package uk.ac.starlink.treeview may be better off using those.


Method Summary
 StarTable chooseStarTable(Component parent)
          Pops up a modal dialog to choose a table from this chooser, with default characteristics.
 String getChosenPath()
          Returns the path string for the node which is currently chosen.
static boolean isAvailable()
          Indicates whether it will be possible to construct a StarTableNodeChooser object.
static StarTableNodeChooser newInstance()
          Constructs a new chooser object if the requisite classes are available.
 void setRootNode(Object dataNode)
          Sets the root node of the chooser.
 void setRootObject(Object root)
          Sets the root object of the chooser.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

newInstance

public static StarTableNodeChooser newInstance()
Constructs a new chooser object if the requisite classes are available.

Returns:
a new chooser object, or null if the classes are not available

chooseStarTable

public StarTable chooseStarTable(Component parent)
Pops up a modal dialog to choose a table from this chooser, with default characteristics. If an error occurs in turning the selection into a table, the user will be informed, and null will be returned.

Parameters:
parent - the parent component for the dialog
Returns:
a table corresponding to the selected DataNode, or null if none was selected or there was an error in converting it to a table

setRootObject

public void setRootObject(Object root)
                   throws IOException
Sets the root object of the chooser.

Parameters:
root - an object which will be turned into a uk.ac.starlink.treeview.DataNode and then installed as the root of the chooser tree
IOException

setRootNode

public void setRootNode(Object dataNode)
Sets the root node of the chooser.


getChosenPath

public String getChosenPath()
Returns the path string for the node which is currently chosen.

Returns:
chosen node path, or null

isAvailable

public static boolean isAvailable()
Indicates whether it will be possible to construct a StarTableNodeChooser object. It may not be if the requisite classes are not in place.

Returns:
true iff newInstance() can be expected to return a new chooser

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