Class TableNodeChooser

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, EventListener, Accessible, TreeSelectionListener

public class TableNodeChooser extends TreeNodeChooser
TreeNodeChooser subclass designed to return StarTable objects. DataNode implementations which wish to declare themselves (potentially) choosable by this chooser, because they can provide an associated StarTable object, must return true from DataNode.hasDataObject(DataType.TABLE).
Author:
Mark Taylor (Starlink)
See Also:
  • Constructor Details

    • TableNodeChooser

      public TableNodeChooser()
      Constructs a new chooser.
  • Method Details

    • setRoot

      public void setRoot(DataNode root)
      Description copied from class: TreeNodeChooser
      Sets the root of the tree to a new node, possibly one not already in the tree.
      Overrides:
      setRoot in class TreeNodeChooser
      Parameters:
      root - new root
    • getNodeMaker

      public DataNodeFactory getNodeMaker()
      Returns a lazily created node factory suitable for making nodes in a table-browsing environment.
      Overrides:
      getNodeMaker in class TreeNodeChooser
      Returns:
      the data node factory
    • isChoosable

      protected boolean isChoosable(DataNode node)
      Allows selection of any node which has a data object of type DataType.TABLE.
      Overrides:
      isChoosable in class TreeNodeChooser
      Parameters:
      node - the node to test for choosability
      Returns:
      true iff the node is suitable for turning into a table
    • chooseStarTable

      public uk.ac.starlink.table.StarTable chooseStarTable(Component parent, String buttonText, String title)
      Pops up a modal dialog to choose a table from this chooser. 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
      buttonText - the text to appear on the 'choose' button (or null for default)
      title - the title of the dialog window (or null for default)
      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
    • chooseStarTable

      public uk.ac.starlink.table.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
    • makeStarTable

      public uk.ac.starlink.table.StarTable makeStarTable(DataNode node) throws IOException
      Turns a DataNode into a StarTable.
      Parameters:
      node - the data node
      Returns:
      StarTable made from node
      Throws:
      IOException - if there's trouble