All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.netobjects.nfx.sitebrowser.SiteBrowser

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----com.sun.java.swing.JComponent
                           |
                           +----com.sun.java.swing.JPanel
                                   |
                                   +----com.netobjects.nfx.sitebrowser.SiteBrowser

public class SiteBrowser
extends JPanel
Constructs a sorted browse tree with the site "home" page as its root and with its immediate children visible. The entire site hierarchy is available for browsing but each branch, below the next visible level, is loaded dynamically as the user expands a node. This approach improves performance on initialization and allows the user to load only those portions of the directory hierarchy necessary.

Version:
1.0
Author:
Scott Cinnamond

Variable Index

 o dmCodeBase
 o dmExceptionHandler
 o dmIcon
 o dmIconSelected
 o dmListeners
 o dmScrollPane
 o dmSelectedItem
 o dmSelectedNode
 o dmTree

Constructor Index

 o SiteBrowser(String, DNode, String, ExceptionHandler)
Constructor.
 o SiteBrowser(String, String, ExceptionHandler)
Constructor.

Method Index

 o addChildren(SiteTreeNode)
Adds child nodes to the given node based on the directory hierarchy.
 o addDescendants(SiteTreeNode)
Traverses the file hierarchy starting at the given directory, which is encapsulated in the given node, adding child-nodes to the given node.
 o addFirstChild(SiteTreeNode)
Adds a child node to the given node based on the DNode hierarchy.
 o addTreeSelectionListener(TreeSelectionListener)
Add the given listener to the encapsulated tree.
 o createControls()
 o createIcons()
 o getIcon()
Return the site icon.
 o getIconSelected()
Return the site icon.
 o getSelectedItem()
Returns the selected item as a string.
 o getSelectedNode()
Returns the selected item as a DNode.
 o getTree()
Return the encapsulated tree.
 o setIcon(ImageIcon)
Set the site icon.

Variables

 o dmExceptionHandler
 private ExceptionHandler dmExceptionHandler
 o dmScrollPane
 private JScrollPane dmScrollPane
 o dmTree
 private SiteBrowser. SiteTree dmTree
 o dmSelectedNode
 private DNode dmSelectedNode
 o dmSelectedItem
 private String dmSelectedItem
 o dmIcon
 private ImageIcon dmIcon
 o dmIconSelected
 private ImageIcon dmIconSelected
 o dmCodeBase
 private String dmCodeBase
 o dmListeners
 private Vector dmListeners

Constructors

 o SiteBrowser
 public SiteBrowser(String title,
                    String codeBase,
                    ExceptionHandler handler) throws InternalError
Constructor.

Parameters:
title - the title for the dialog.
codeBase - the base path where the browser can find it's images.
handler - its exception handler.
Throws: InternalError
if it decides to throw one.
 o SiteBrowser
 public SiteBrowser(String title,
                    DNode selected,
                    String codeBase,
                    ExceptionHandler handler) throws InternalError
Constructor.

Parameters:
title - the title for the dialog.
selected - the selected node.
codeBase - the base path where the browser can find it's images.
handler - its exception handler.
Throws: InternalError
if it decides to throw one.

Methods

 o createIcons
 private void createIcons()
 o createControls
 private void createControls() throws InternalError
 o getIcon
 public ImageIcon getIcon()
Return the site icon.

 o getIconSelected
 public ImageIcon getIconSelected()
Return the site icon.

 o setIcon
 public void setIcon(ImageIcon icon)
Set the site icon.

Parameters:
the - icon
 o getSelectedNode
 public DNode getSelectedNode()
Returns the selected item as a DNode.

Returns:
the node.
 o getSelectedItem
 public String getSelectedItem()
Returns the selected item as a string.

Returns:
the item.
 o getTree
 public SiteBrowser. SiteTree getTree()
Return the encapsulated tree.

Returns:
the tree
 o addTreeSelectionListener
 public void addTreeSelectionListener(TreeSelectionListener listener)
Add the given listener to the encapsulated tree.

Parameters:
listener - the TreeSelectionListener.
 o addDescendants
 public void addDescendants(SiteTreeNode node) throws InternalError
Traverses the file hierarchy starting at the given directory, which is encapsulated in the given node, adding child-nodes to the given node. The entire file hierarchy from the given node/file is traversed.

Parameters:
node - the root node.
Throws: InternalError
if the given node does not contain a file which is a directory.
 o addChildren
 public void addChildren(SiteTreeNode node) throws InternalError
Adds child nodes to the given node based on the directory hierarchy.

Parameters:
node - the root node.
Throws: InternalError
if the given node does not contain a file which is a directory.
 o addFirstChild
 public void addFirstChild(SiteTreeNode node) throws InternalError
Adds a child node to the given node based on the DNode hierarchy. The first DNode found is added.

Parameters:
node - the root node.
Throws: InternalError
if the given node does not contain a file which is a directory.

All Packages  Class Hierarchy  This Package  Previous  Next  Index