wt.clients.beans.explorer
Class WTExplorer

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended bywt.clients.beans.explorer.WTExplorer
All Implemented Interfaces:
ActionListener, EventListener, ImageObserver, ItemListener, MenuContainer, PropertyChangeListener, Serializable, WTExplorerListener

public class WTExplorer
extends Container
implements ActionListener, ItemListener, WTExplorerListener, PropertyChangeListener

WTExplorer is a Explorer type browser for displaying items and relationships.

It contains a linked Treeview and Listview which can be used to display and navigate objects which implement the wt.clients.beans.explorer.Explorable interface. It will invoke the getUses() method on the contained object to display its children in the treeview. It will invoke the getContents() method on the object to display its details in the listview.

The columns displayed in the listview can be set at runtime, as well as the methods to invoke to retrieve the information displayed for each column.

Supported API: true

Extendable: true

See Also:
Explorable, Serialized Form

Nested Class Summary
(package private)  class WTExplorer.ProcessExpand
           
(package private)  class WTExplorer.ProcessExpose
           
 
Nested classes inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
private  boolean autoDisplayListStatusBarText
           
private  Color canvasBackground
           
private  Color canvasForeground
           
private  boolean displayUsesAsContents
           
private  int imageStyle
           
private  Filter[] listFilters
           
private  Applet myApplet
           
private  HelpContext myHelpContext
           
private  WTList myList
           
private  Vector myListener
           
private  WTStatusBar myListStatus
           
private  symantec.itools.awt.BorderPanel myPanel
           
private  WTSplitterBar mySplitterBar
           
private  WTStatusBar myStatus
           
private  int myStatusBarPadding
           
private  ThreadGroup myThreadGroup
           
private  WTToolBar myToolBar
           
private  String[] myTools
           
private  WTTree myTree
           
private  WTStatusBar myTreeStatus
           
private  boolean refreshContentsOnExpose
           
private  Image rootNodeCollapsedImage
           
private  Image rootNodeExpandedImage
           
private static boolean TIMING
           
private  Filter[] treeFilters
           
 
Fields inherited from class java.awt.Container
 
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
WTExplorer()
          Create a default WTExplorer.
WTExplorer(boolean aToolBar)
          Create a WTExplorer with the specified title and toolbar options.
WTExplorer(Explorable root_node)
          Constructor for a WTExplorer.
 
Method Summary
 void actionPerformed(ActionEvent e)
          Process an action event.
 Component add(Component aComp)
           
 Explorable addDetail(WTNode aNode, Explorable aDetail)
          Add detail to a node.
 void addListener(WTExplorerListener aListener)
          Add a listener for this component.
 WTNode addNode(WTNode aParent, Explorable aChild)
          Add a child node to the specified parent
 WTNode addNode(WTNode aParent, Explorable aChild, boolean redraw)
          Add a child node to the specified parent
 WTNode addNode(WTNode aParent, WTNode aChild)
          Add a child node to the specified parent.
 void addTools()
           
 void clear()
          Clear the explorer of all nodes.
protected  boolean confirmAction(String message)
          Method to display an OK/Cancel dialog with the given String message as the text of the dialog.
 void displayWaitIndicatorOff()
           
 void displayWaitIndicatorOn()
           
 void enableButton(String button_name, boolean enable)
          Enables/Disables the toolbar button corresponding to the given toolbar button name.
 void explorerEvent(WTExplorerEvent e)
          Process an explorer event
 WTNode findNode(Explorable obj)
          Find the node containing the Explorable.
 WTNode[] findNodes(Explorable obj)
          Find the node containing the Explorable.
 Applet getApplet()
          Get the parent applet for this component.
 Color getCanvasBackground()
          Gets tree and list background color.
 Color getCanvasForeground()
          Gets tree and list foreground color.
 HelpContext getHelpContext()
          Get the help context for this component.
 WTList getList()
          Return the list view.
 Font getListCellFont()
          Gets the font for the cells in the list.
 String[] getListColumnAlignments()
          Gets a string array containing the column alignment of each column in the list.
 String[] getListColumnSizes()
          Returns a string array containing the width of each column in pixels.
 Filter[] getListFilters()
           
 Font getListFont()
          Gets the font for the list.
 Font getListHeadingFont()
          Gets the font for the headings in the list.
 String[] getListHeadings()
          Gets a String array of all of the column headings for the list.
 String[] getListMethods()
          Gets a String array of all of the methods invoked to get data for each column in the list.
 String[] getListRelativeColumnWidths()
          Returns a string array containing the width of each column in pixels.
(package private)  WTStatusBar getListStatus()
          Return the status bar over the list view
 Font getListStatusBarFont()
          Gets the font for the status bar over the list.
 String getListStatusBarText()
          Gets the text for the list status bar.
(package private)  Frame getParentFrame()
          Utility function to get the frame
 WTNode getRootNode()
          Get the root node for the treeview.
 Image getRootNodeCollapsedImage()
          get the current collapsed image used for the root node
 Image getRootNodeExpandedImage()
          Get the current expanded image used for the root node
 String getRootNodeText()
          Gets the text displayed beside the root node.
 Explorable getSelectedDetail()
          Get the selected detail from the list view.
 Explorable[] getSelectedDetails()
          Get the selected details from the list view.
 WTNode getSelectedNode()
          Return the selected node in the tree.
 int getStatusBarPadding()
          Get the padding size for the status bar.
 String getStatusBarText()
          Get the text displayed in the bottom status bar.
protected  ThreadGroup getThreadGroup()
           
 String[] getTools()
          Gets the names of the current toolbar buttons.
 WTTree getTree()
          Return the treeview.
 Filter[] getTreeFilters()
           
 Font getTreeFont()
          Gets the font for the tree.
(package private)  WTStatusBar getTreeStatus()
          Return the status bar over the tree view.
 Font getTreeStatusBarFont()
          Gets the font for the status bar over the tree.
 String getTreeStatusBarText()
          Gets the text for the tree status bar.
 void init(Explorable obj)
          Initialize the Explorer with a single Explorer object as its root.
private  void initializeHelp()
          Initialize the help for this component.
 boolean isAutoDisplayListStatusBarText()
          Determine if the ListStatusBar should automatically display a string "Contents of '...'
 boolean isDisplayUsesAsContents()
           
 boolean isMultipleMode()
           
 boolean isRefreshContentsOnExpose()
          Determine if the contents should be refreshed by calling getContents() on the business object everytime the node is exposed.
 void itemStateChanged(ItemEvent e)
          Process an item state change event.
static void main(String[] args)
          A main method that demonstrates how to use this class and allows testing
private  void processEvent(WTExplorerEvent aEvent)
          Process an explorer event.
 void processExpand(WTNode aNode)
          Process the expand event for a node
 void processExpose(WTNode aNode)
          Process the expose event for a node.
(package private)  void processNode(WTNode aNode, boolean expose)
          Process the specified node.
 void propertyChange(PropertyChangeEvent event)
          Update the status area with online help.
 void refresh()
          Refresh the explorer.
 void refreshDetails(WTNode node, Explorable obj)
          Refreshes the detail objects of the given node using the given Explorable.
 void refreshNode(WTNode aNode, Explorable newObj)
          Refresh the specified node with the specified object.
 void refreshNode(WTNode aNode, Explorable newObj, boolean showDetails, boolean expand)
          Refresh the node with the specified object.
 Explorable removeDetail(WTNode aNode, Explorable aDetail)
          Remove detail from a node.
 void removeListener(WTExplorerListener aListener)
          Remove a listener for this component.
 WTNode removeNode(WTNode aNode)
          Remove the specified node.
 void setApplet(Applet a)
          Set the parent applet for this component.
 void setAutoDisplayListStatusBarText(boolean value)
          Determine if the ListStatusBar should automatically display a string "Contents of '...'
 void setBackground(Color aColor)
           
 void setCanvasBackground(Color aColor)
          Sets tree and list background color.
 void setCanvasForeground(Color aColor)
          Sets tree and list foreground color.
 void setColumnSorter(int column, symantec.itools.awt.CompareCells compare)
           
 void setCursor(Cursor cursor)
           
 void setDisplayUsesAsContents(boolean value)
           
 void setForeground(Color aColor)
           
 void setHelpContext(HelpContext aHelpContext)
          Set the help context for this component.
 void setImageStyle(int image_style)
          Public method for setting the placement style for the images on the toolbar buttons.
 void setList(WTList aList)
          Set the list view.
 void setListCellFont(Font font)
          Sets the cell font for the list.
 void setListColumnAlignments(String[] alignments)
          Sets the current column alignments for the list.
 void setListColumnSizes(String[] sizes)
          Sets the the width of each column in the list in pixels.
 void setListFilters(Filter[] filters)
           
 void setListFont(Font font)
          Sets the font for the list.
 void setListHeadingFont(Font font)
          Sets the font for the list heading.
 void setListHeadings(String[] headings)
          Initializes all the column headings with the given list.
 void setListMethods(String[] methods)
          Sets the the methods to be invoked to retrieve data for each column in the list.
 void setListRelativeColumnWidths(String[] sizes)
          Sets the the width of each column in the list in pixels.
 void setListStatusBarFont(Font font)
          Sets the font for the status bar over the list.
 void setListStatusBarText(String text)
          Sets the text for the tree status bar.
 void setMultipleMode(boolean value)
           
 void setRefreshContentsOnExpose(boolean value)
          Determine if the contents should be refreshed by calling getContents() on the business object everytime the node is exposed.
 void setRootNode(Explorable tree_root)
          Public method for explicitly setting the root node of the tree view.
 void setRootNodeCollapsedImage(Image image)
          set the collapsed image for the root node
 void setRootNodeExpandedImage(Image image)
          Set the expanded image for the root node
 void setRootNodeText(String text)
          Sets the text to display beside the root node.
 void setSelectedNode(WTNode node)
           
 void setStatusBarPadding(int x)
          Set the padding size for the status bar.
 void setStatusBarText(String text)
          Set the text displayed in the bottom status bar.
protected  void setThreadGroup(ThreadGroup threadGroup)
           
 void setToolBarText(String aString)
          Set the text in the toolbar area.
 void setTools(String[] aTools)
          Sets the names of the current toolbar buttons.
 void setTreeFilters(Filter[] filters)
           
 void setTreeFont(Font font)
          Sets the font for the tree.
 void setTreeStatusBarFont(Font font)
          Sets the font for the status bar over the tree.
 void setTreeStatusBarText(String text)
          Sets the text for the tree status bar.
 void showDetails(WTNode aNode)
          Show the details for the specified node.
protected  void showMessage(String title, String message)
          Show the specified message in a dialog.
 
Methods inherited from class java.awt.Container
add, add, add, add, addContainerListener, addImpl, addNotify, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, setLayout, transferFocusBackward, transferFocusDownCycle, update, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBounds, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TIMING

private static boolean TIMING

myPanel

private symantec.itools.awt.BorderPanel myPanel

myToolBar

private WTToolBar myToolBar

myTools

private String[] myTools

myTree

private WTTree myTree

myList

private WTList myList

myStatus

private WTStatusBar myStatus

myTreeStatus

private WTStatusBar myTreeStatus

myListStatus

private WTStatusBar myListStatus

mySplitterBar

private WTSplitterBar mySplitterBar

myListener

private Vector myListener

imageStyle

private int imageStyle

myApplet

private Applet myApplet

myHelpContext

private HelpContext myHelpContext

myStatusBarPadding

private int myStatusBarPadding

myThreadGroup

private ThreadGroup myThreadGroup

refreshContentsOnExpose

private boolean refreshContentsOnExpose

displayUsesAsContents

private boolean displayUsesAsContents

autoDisplayListStatusBarText

private boolean autoDisplayListStatusBarText

rootNodeCollapsedImage

private Image rootNodeCollapsedImage

rootNodeExpandedImage

private Image rootNodeExpandedImage

canvasForeground

private Color canvasForeground

canvasBackground

private Color canvasBackground

listFilters

private Filter[] listFilters

treeFilters

private Filter[] treeFilters
Constructor Detail

WTExplorer

public WTExplorer()
Create a default WTExplorer.


WTExplorer

public WTExplorer(boolean aToolBar)
Create a WTExplorer with the specified title and toolbar options.

Parameters:
aToolBar - if true, display a toolbar for the explorer

WTExplorer

public WTExplorer(Explorable root_node)
Constructor for a WTExplorer. This constructor takes in an Explorable to be used as the root node of the tree of this explorer.

Parameters:
root_node - an Explorable to be used as the root node of the tree view in the explorer
Method Detail

addTools

public void addTools()

setApplet

public void setApplet(Applet a)
Set the parent applet for this component.

Parameters:
a - the parent applet for this component.

getApplet

public Applet getApplet()
Get the parent applet for this component.

Returns:
the parent applet for this component

clear

public void clear()
Clear the explorer of all nodes.


init

public void init(Explorable obj)
Initialize the Explorer with a single Explorer object as its root.

This will clear the tree of all existing node.

Parameters:
obj - the object to display at the node level.

add

public Component add(Component aComp)

refresh

public void refresh()
Refresh the explorer. This will repaint the list and the treeview.


setListFilters

public void setListFilters(Filter[] filters)

getListFilters

public Filter[] getListFilters()

setTreeFilters

public void setTreeFilters(Filter[] filters)

getTreeFilters

public Filter[] getTreeFilters()

getRootNodeExpandedImage

public Image getRootNodeExpandedImage()
Get the current expanded image used for the root node

Returns:
Image current image
See Also:
setRootNodeExpandedImage

setRootNodeExpandedImage

public void setRootNodeExpandedImage(Image image)
Set the expanded image for the root node

See Also:
getRootNodeExpandedImage

getRootNodeCollapsedImage

public Image getRootNodeCollapsedImage()
get the current collapsed image used for the root node

Returns:
Image current image
See Also:
setRootNodeExpandedImage

setRootNodeCollapsedImage

public void setRootNodeCollapsedImage(Image image)
set the collapsed image for the root node

See Also:
getRootNodeCollapsedImage

isAutoDisplayListStatusBarText

public boolean isAutoDisplayListStatusBarText()
Determine if the ListStatusBar should automatically display a string "Contents of '...'

Returns:
boolean indicating current value
See Also:
setAutoDisplayListStatusBarText

setAutoDisplayListStatusBarText

public void setAutoDisplayListStatusBarText(boolean value)
Determine if the ListStatusBar should automatically display a string "Contents of '...'

Parameters:
value - boolean new value to use
See Also:
isAutoDisplayListStatusBarText

isRefreshContentsOnExpose

public boolean isRefreshContentsOnExpose()
Determine if the contents should be refreshed by calling getContents() on the business object everytime the node is exposed.

See Also:
setRefreshContentsOnExpose

setRefreshContentsOnExpose

public void setRefreshContentsOnExpose(boolean value)
Determine if the contents should be refreshed by calling getContents() on the business object everytime the node is exposed.

See Also:
isRefreshContentsOnExpose

isDisplayUsesAsContents

public boolean isDisplayUsesAsContents()

setDisplayUsesAsContents

public void setDisplayUsesAsContents(boolean value)

getListColumnAlignments

public String[] getListColumnAlignments()
Gets a string array containing the column alignment of each column in the list. The possible values for each element are "Left", "Center", "Right" .

See Also:
setListColumnAlignments

setListColumnAlignments

public void setListColumnAlignments(String[] alignments)
                             throws PropertyVetoException
Sets the current column alignments for the list.

Parameters:
alignments - an array of strings that determines column alignment. Each item should contain one of the following: "Left", "Center", or "Right"
Throws:
PropertyVetoException
See Also:
getListColumnAlignments

getListColumnSizes

public String[] getListColumnSizes()
Returns a string array containing the width of each column in pixels. If columns are being automatically sized, it will return null.

Returns:
an array of ints containing the size for each column
See Also:
setListColumnSizes

setListColumnSizes

public void setListColumnSizes(String[] sizes)
                        throws PropertyVetoException
Sets the the width of each column in the list in pixels. Setting the column sizes to null will turn auto resizing on.

Throws:
PropertyVetoException
See Also:
getListColumnSizes

getListRelativeColumnWidths

public String[] getListRelativeColumnWidths()
Returns a string array containing the width of each column in pixels. If columns are being automatically sized, it will return null.

Returns:
an array of ints containing the size for each column
See Also:
setListColumnSizes

setListRelativeColumnWidths

public void setListRelativeColumnWidths(String[] sizes)
                                 throws PropertyVetoException
Sets the the width of each column in the list in pixels. Setting the column sizes to null will turn auto resizing on.

Throws:
PropertyVetoException
See Also:
getListColumnSizes

getListHeadings

public String[] getListHeadings()
Gets a String array of all of the column headings for the list.

Returns:
an array of all of the current headings
See Also:
getListColumnSizes

setListHeadings

public void setListHeadings(String[] headings)
                     throws PropertyVetoException
Initializes all the column headings with the given list. For each string in the given list, create a column, use the string as its heading, and give it a default width.

Parameters:
headings - array of heading title strings
Throws:
PropertyVetoException
See Also:
getListHeadings

getListMethods

public String[] getListMethods()
Gets a String array of all of the methods invoked to get data for each column in the list.

Returns:
an array of all of the current methods
See Also:
setListMethods

setListMethods

public void setListMethods(String[] methods)
                    throws PropertyVetoException
Sets the the methods to be invoked to retrieve data for each column in the list.

Parameters:
methods - an array of strings containing method names
Throws:
PropertyVetoException
See Also:
getListMethods

getListFont

public Font getListFont()
Gets the font for the list.

See Also:
setListFont

setListFont

public void setListFont(Font font)
                 throws PropertyVetoException
Sets the font for the list.

Parameters:
font - the font to use.
Throws:
PropertyVetoException
See Also:
getListFont

getListCellFont

public Font getListCellFont()
Gets the font for the cells in the list.

Returns:
the font used
See Also:
setListCellFont

setListCellFont

public void setListCellFont(Font font)
                     throws PropertyVetoException
Sets the cell font for the list.

Parameters:
font - the font to use
Throws:
PropertyVetoException
See Also:
getListCellFont

getListHeadingFont

public Font getListHeadingFont()
Gets the font for the headings in the list.

See Also:
setListHeadingFont

setListHeadingFont

public void setListHeadingFont(Font font)
                        throws PropertyVetoException
Sets the font for the list heading.

Parameters:
font - the font to use
Throws:
PropertyVetoException
See Also:
getListHeadingFont

getListStatusBarFont

public Font getListStatusBarFont()
Gets the font for the status bar over the list.

Returns:
the font used
See Also:
setListStatusBarFont

setListStatusBarFont

public void setListStatusBarFont(Font font)
Sets the font for the status bar over the list.

Parameters:
font - the font to use
See Also:
getListStatusBarFont

getTreeStatusBarFont

public Font getTreeStatusBarFont()
Gets the font for the status bar over the tree.

Returns:
the font used
See Also:
setTreeStatusBarFont

setTreeStatusBarFont

public void setTreeStatusBarFont(Font font)
Sets the font for the status bar over the tree.

Parameters:
font - the font to use.
See Also:
getTreeStatusBarFont

getTreeFont

public Font getTreeFont()
Gets the font for the tree.

Returns:
the font used
See Also:
setTreeFont

setTreeFont

public void setTreeFont(Font font)
Sets the font for the tree.

Parameters:
font - the font to use
See Also:
getTreeFont

getTreeStatusBarText

public String getTreeStatusBarText()
Gets the text for the tree status bar.

Returns:
the string used by the status bar.
See Also:
setTreeStatusBarText

setTreeStatusBarText

public void setTreeStatusBarText(String text)
                          throws PropertyVetoException
Sets the text for the tree status bar.

Parameters:
text - the string to use
Throws:
PropertyVetoException
See Also:
getTreeStatusBarText

getListStatusBarText

public String getListStatusBarText()
Gets the text for the list status bar.

Returns:
the string used by the status bar.
See Also:
setListStatusBarText

setListStatusBarText

public void setListStatusBarText(String text)
                          throws PropertyVetoException
Sets the text for the tree status bar.

Parameters:
text - the string to use
Throws:
PropertyVetoException
See Also:
getTreeStatusBarText

getTools

public String[] getTools()
Gets the names of the current toolbar buttons. The name of the button determines both the gif file to be used and the name of the command event fired when the button is pressed.

Returns:
a string array of the button names
See Also:
setTools

setTools

public void setTools(String[] aTools)
Sets the names of the current toolbar buttons. The name of the button determines both the gif file to be used and the name of the command event fired when the button is pressed.

See Also:
getTools

setRootNodeText

public void setRootNodeText(String text)
Sets the text to display beside the root node.

Parameters:
text - string to display
See Also:
getRootNodeText

getRootNodeText

public String getRootNodeText()
Gets the text displayed beside the root node.

Returns:
string currently displayed
See Also:
setRootNodeText

setCursor

public void setCursor(Cursor cursor)

displayWaitIndicatorOn

public void displayWaitIndicatorOn()

displayWaitIndicatorOff

public void displayWaitIndicatorOff()

getCanvasForeground

public Color getCanvasForeground()
Gets tree and list foreground color.

Returns:
Color currently used
See Also:
setCanvasForeground

setCanvasForeground

public void setCanvasForeground(Color aColor)
Sets tree and list foreground color.

Parameters:
aColor - the color to use
See Also:
getCanvasForeground

getCanvasBackground

public Color getCanvasBackground()
Gets tree and list background color.

Returns:
Color currently used
See Also:
setCanvasBackground

setCanvasBackground

public void setCanvasBackground(Color aColor)
Sets tree and list background color.

Parameters:
aColor - the Color to use
See Also:
getCanvasBackground

setBackground

public void setBackground(Color aColor)

setForeground

public void setForeground(Color aColor)

setMultipleMode

public void setMultipleMode(boolean value)
                     throws PropertyVetoException
Throws:
PropertyVetoException

isMultipleMode

public boolean isMultipleMode()

getListStatus

WTStatusBar getListStatus()
Return the status bar over the list view

Returns:
the status bar over the list view

getTreeStatus

WTStatusBar getTreeStatus()
Return the status bar over the tree view.

Returns:
the status bar over the tree view

getList

public WTList getList()
Return the list view.

Returns:
the list view

getTree

public WTTree getTree()
Return the treeview.

Returns:
the treeview

setList

public void setList(WTList aList)
Set the list view.

Parameters:
aList - the new list view

getRootNode

public WTNode getRootNode()
Get the root node for the treeview.

Returns:
the root node

addNode

public WTNode addNode(WTNode aParent,
                      WTNode aChild)
Add a child node to the specified parent.

Parameters:
aParent - the parent of the new node
aChild - the new child node
Returns:
the added node

addNode

public WTNode addNode(WTNode aParent,
                      Explorable aChild)
Add a child node to the specified parent

Parameters:
aParent - the parent of the new node
aChild - the new child object used to construct the new node
Returns:
the added node

addNode

public WTNode addNode(WTNode aParent,
                      Explorable aChild,
                      boolean redraw)
Add a child node to the specified parent

Parameters:
aParent - the parent of the new node
aChild - the new child object used to construct the new node
redraw - if true, force redraw after adding node
Returns:
the added node

removeNode

public WTNode removeNode(WTNode aNode)
Remove the specified node.

Parameters:
aNode - the node to remove
Returns:
the removed node

getSelectedNode

public WTNode getSelectedNode()
Return the selected node in the tree.

Returns:
the selected node in the tree

setToolBarText

public void setToolBarText(String aString)
Set the text in the toolbar area.

Parameters:
aString - the text to display in the toolbar area

addDetail

public Explorable addDetail(WTNode aNode,
                            Explorable aDetail)
Add detail to a node.

Parameters:
aNode - the node to add detail
aDetail - the detail to add
Returns:
the added detail

removeDetail

public Explorable removeDetail(WTNode aNode,
                               Explorable aDetail)
Remove detail from a node.

Parameters:
aNode - the node to remove detail from
aDetail - the detail to remove
Returns:
the removed detail

getSelectedDetail

public Explorable getSelectedDetail()
Get the selected detail from the list view.

Returns:
the selected detail from the list view

getSelectedDetails

public Explorable[] getSelectedDetails()
Get the selected details from the list view.

Returns:
an array of the selected details from the list view

showDetails

public void showDetails(WTNode aNode)
Show the details for the specified node.

Parameters:
aNode - the node to show details for

findNodes

public WTNode[] findNodes(Explorable obj)
Find the node containing the Explorable. The method will use the getIdentity() method on the business object as the basis for comparison. If no matching node is found, an empty array is returned.

Parameters:
obj - - the object to find.
See Also:
WTNode, Explorable

findNode

public WTNode findNode(Explorable obj)
Find the node containing the Explorable. The method will use the getIdentity() method on the business object as the basis for comparison. If no matching node is found, a null is returned.

Parameters:
obj - - the object to find.
See Also:
WTNode, Explorable

refreshNode

public void refreshNode(WTNode aNode,
                        Explorable newObj)
Refresh the specified node with the specified object.

Parameters:
aNode - the node to refresh
newObj - the object used to refresh the node

refreshNode

public void refreshNode(WTNode aNode,
                        Explorable newObj,
                        boolean showDetails,
                        boolean expand)
Refresh the node with the specified object.

Parameters:
aNode - the node to refresh
newObj - the object used to refresh the node
showDetails - if true, refresh the listview for the node
expand - if true, expand the node after it is refreshed

getParentFrame

Frame getParentFrame()
Utility function to get the frame

Returns:
the parent frame

getThreadGroup

protected ThreadGroup getThreadGroup()

setThreadGroup

protected void setThreadGroup(ThreadGroup threadGroup)

addListener

public void addListener(WTExplorerListener aListener)
Add a listener for this component.

Parameters:
aListener - the new listener

removeListener

public void removeListener(WTExplorerListener aListener)
Remove a listener for this component.

Parameters:
aListener - the listener to remove

processEvent

private void processEvent(WTExplorerEvent aEvent)
Process an explorer event.

Parameters:
aEvent - the event to process

actionPerformed

public void actionPerformed(ActionEvent e)
Process an action event.

Specified by:
actionPerformed in interface ActionListener
Parameters:
e - the action event to process

itemStateChanged

public void itemStateChanged(ItemEvent e)
Process an item state change event.

Specified by:
itemStateChanged in interface ItemListener
Parameters:
e - the item event to process

explorerEvent

public void explorerEvent(WTExplorerEvent e)
Process an explorer event

Specified by:
explorerEvent in interface WTExplorerListener
Parameters:
e - the explorer event to process

processNode

void processNode(WTNode aNode,
                 boolean expose)
Process the specified node. Display the contents in the list view. Display the children in the tree view.

Parameters:
aNode - the node to process
expose - if true, redraw the contents in the list view.

processExpose

public void processExpose(WTNode aNode)
Process the expose event for a node.

Parameters:
aNode - the node to expose

processExpand

public void processExpand(WTNode aNode)
Process the expand event for a node

Parameters:
aNode - the node to expand

setHelpContext

public void setHelpContext(HelpContext aHelpContext)
Set the help context for this component.

Parameters:
aHelpContext - the new help context

getHelpContext

public HelpContext getHelpContext()
Get the help context for this component.

Returns:
the help context for this component.

initializeHelp

private void initializeHelp()
Initialize the help for this component.


propertyChange

public void propertyChange(PropertyChangeEvent event)
Update the status area with online help.

Specified by:
propertyChange in interface PropertyChangeListener

setStatusBarText

public void setStatusBarText(String text)
                      throws PropertyVetoException
Set the text displayed in the bottom status bar.

Parameters:
text - the string to display
Throws:
PropertyVetoException

getStatusBarText

public String getStatusBarText()
Get the text displayed in the bottom status bar.

Returns:
the displayed text

getStatusBarPadding

public int getStatusBarPadding()
Get the padding size for the status bar.

Returns:
the padding size for the status bar

setStatusBarPadding

public void setStatusBarPadding(int x)
Set the padding size for the status bar.

Parameters:
x - the padding size for the status bar

setSelectedNode

public void setSelectedNode(WTNode node)

showMessage

protected void showMessage(String title,
                           String message)
Show the specified message in a dialog.

Parameters:
title - the title for the dialog
message - the message to display

main

public static void main(String[] args)
A main method that demonstrates how to use this class and allows testing


enableButton

public void enableButton(String button_name,
                         boolean enable)
Enables/Disables the toolbar button corresponding to the given toolbar button name.

Parameters:
button_name - the String name of the button to be enabled/ disabled
enable - if true, the toolbar button is enabled; if false, the toolbar button is disabled

confirmAction

protected boolean confirmAction(String message)
Method to display an OK/Cancel dialog with the given String message as the text of the dialog. This method returns a boolean value indicating whether the user chose "OK" or "Cancel".

Parameters:
message - the String message to display in the dialog
Returns:
true, if the user chose "OK", false if the user chose "Cancel"

setRootNode

public void setRootNode(Explorable tree_root)
Public method for explicitly setting the root node of the tree view. This method is useful if the explorer is to use a "real" business object instead of a placeholder object as the root node of the tree.


setImageStyle

public void setImageStyle(int image_style)
Public method for setting the placement style for the images on the toolbar buttons. Valid image styles are the integer constants defined in the symantec.itools.awt.ImageButton class: IMAGE_CENTERED, IMAGE_NORMAL, IMAGE_SCALED, and IMAGE_TILED.

Parameters:
image_style - the integer value indicating the image style to use on the toolbar butttons

refreshDetails

public void refreshDetails(WTNode node,
                           Explorable obj)
                    throws WTException
Refreshes the detail objects of the given node using the given Explorable. This method will refresh the details, but will not cause the explorer to redisplay

Parameters:
node - the Node whose details are refreshed
obj - the Explorable to use as the object of the node
Throws:
WTException

setColumnSorter

public void setColumnSorter(int column,
                            symantec.itools.awt.CompareCells compare)