Class RemoteTreeBrowser

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public abstract class RemoteTreeBrowser extends JPanel
General browser for a remote file store of some description which can be represented as a TreeModel. As well as including a JTree suitably populated, this component gives you a button to trigger logging in and out; concrete subclasses must implement the abstract logIn() and logOut(javax.swing.tree.TreeModel) methods.
Since:
31 Jan 2005
Author:
Mark Taylor (Starlink)
See Also:
  • Constructor Details

    • RemoteTreeBrowser

      public RemoteTreeBrowser()
      Constructor.
  • Method Details

    • logIn

      protected abstract TreeModel logIn() throws IOException
      Return a TreeModel representing the data to be displayed.
      Returns:
      tree model representing remote data
      Throws:
      IOException
    • logOut

      protected abstract void logOut(TreeModel model)
      Called when the tree model obtained by logIn() is about to be discarded.
    • getExtraPanel

      public JComponent getExtraPanel()
      Returns an initially empty panel near the bottom of the window which can be used to hold custom components.
      Returns:
      empty panel
    • getSelectedNode

      public Object getSelectedNode()
      Returns the currently selected node, if there is one.
      Returns:
      selected tree node
    • getJTree

      public JTree getJTree()
      Returns the JTree component used for display.
      Returns:
      jtree
    • isConnected

      public boolean isConnected()
      Determines whether there is a usable connection to the remote resource in effect.
      Returns:
      true iff we are logged in
    • getAllowContainerSelection

      public boolean getAllowContainerSelection()
      Indicates whether it is permitted to select a container (directory) or only a file-type node.
      Returns:
      true iff containers can be selected
    • setAllowContainerSelection

      public void setAllowContainerSelection(boolean allowed)
      Sets whether it is permitted to select a container (directory) or only a file-type node.
      Parameters:
      allowed - true iff you want containers to be selected