|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
wt.clients.beans.explorer.WTExplorer
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
Explorable
,
Serialized FormNested 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.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private static boolean TIMING
private symantec.itools.awt.BorderPanel myPanel
private WTToolBar myToolBar
private String[] myTools
private WTTree myTree
private WTList myList
private WTStatusBar myStatus
private WTStatusBar myTreeStatus
private WTStatusBar myListStatus
private WTSplitterBar mySplitterBar
private Vector myListener
private int imageStyle
private Applet myApplet
private HelpContext myHelpContext
private int myStatusBarPadding
private ThreadGroup myThreadGroup
private boolean refreshContentsOnExpose
private boolean displayUsesAsContents
private boolean autoDisplayListStatusBarText
private Image rootNodeCollapsedImage
private Image rootNodeExpandedImage
private Color canvasForeground
private Color canvasBackground
private Filter[] listFilters
private Filter[] treeFilters
Constructor Detail |
public WTExplorer()
public WTExplorer(boolean aToolBar)
aToolBar
- if true, display a toolbar for the explorerpublic WTExplorer(Explorable root_node)
root_node
- an Explorable to be used as the root node of the
tree view in the explorerMethod Detail |
public void addTools()
public void setApplet(Applet a)
a
- the parent applet for this component.public Applet getApplet()
public void clear()
public void init(Explorable obj)
This will clear the tree of all existing node.
obj
- the object to display at the node level.public Component add(Component aComp)
public void refresh()
public void setListFilters(Filter[] filters)
public Filter[] getListFilters()
public void setTreeFilters(Filter[] filters)
public Filter[] getTreeFilters()
public Image getRootNodeExpandedImage()
setRootNodeExpandedImage
public void setRootNodeExpandedImage(Image image)
getRootNodeExpandedImage
public Image getRootNodeCollapsedImage()
setRootNodeExpandedImage
public void setRootNodeCollapsedImage(Image image)
getRootNodeCollapsedImage
public boolean isAutoDisplayListStatusBarText()
setAutoDisplayListStatusBarText
public void setAutoDisplayListStatusBarText(boolean value)
value
- boolean new value to useisAutoDisplayListStatusBarText
public boolean isRefreshContentsOnExpose()
setRefreshContentsOnExpose
public void setRefreshContentsOnExpose(boolean value)
isRefreshContentsOnExpose
public boolean isDisplayUsesAsContents()
public void setDisplayUsesAsContents(boolean value)
public String[] getListColumnAlignments()
setListColumnAlignments
public void setListColumnAlignments(String[] alignments) throws PropertyVetoException
alignments
- an array of strings that determines column alignment.
Each item should contain one of the following: "Left", "Center", or "Right"
PropertyVetoException
getListColumnAlignments
public String[] getListColumnSizes()
setListColumnSizes
public void setListColumnSizes(String[] sizes) throws PropertyVetoException
PropertyVetoException
getListColumnSizes
public String[] getListRelativeColumnWidths()
setListColumnSizes
public void setListRelativeColumnWidths(String[] sizes) throws PropertyVetoException
PropertyVetoException
getListColumnSizes
public String[] getListHeadings()
getListColumnSizes
public void setListHeadings(String[] headings) throws PropertyVetoException
headings
- array of heading title strings
PropertyVetoException
getListHeadings
public String[] getListMethods()
setListMethods
public void setListMethods(String[] methods) throws PropertyVetoException
methods
- an array of strings containing method names
PropertyVetoException
getListMethods
public Font getListFont()
setListFont
public void setListFont(Font font) throws PropertyVetoException
font
- the font to use.
PropertyVetoException
getListFont
public Font getListCellFont()
setListCellFont
public void setListCellFont(Font font) throws PropertyVetoException
font
- the font to use
PropertyVetoException
getListCellFont
public Font getListHeadingFont()
setListHeadingFont
public void setListHeadingFont(Font font) throws PropertyVetoException
font
- the font to use
PropertyVetoException
getListHeadingFont
public Font getListStatusBarFont()
setListStatusBarFont
public void setListStatusBarFont(Font font)
font
- the font to usegetListStatusBarFont
public Font getTreeStatusBarFont()
setTreeStatusBarFont
public void setTreeStatusBarFont(Font font)
font
- the font to use.getTreeStatusBarFont
public Font getTreeFont()
setTreeFont
public void setTreeFont(Font font)
font
- the font to usegetTreeFont
public String getTreeStatusBarText()
setTreeStatusBarText
public void setTreeStatusBarText(String text) throws PropertyVetoException
text
- the string to use
PropertyVetoException
getTreeStatusBarText
public String getListStatusBarText()
setListStatusBarText
public void setListStatusBarText(String text) throws PropertyVetoException
text
- the string to use
PropertyVetoException
getTreeStatusBarText
public String[] getTools()
setTools
public void setTools(String[] aTools)
getTools
public void setRootNodeText(String text)
text
- string to displaygetRootNodeText
public String getRootNodeText()
setRootNodeText
public void setCursor(Cursor cursor)
public void displayWaitIndicatorOn()
public void displayWaitIndicatorOff()
public Color getCanvasForeground()
setCanvasForeground
public void setCanvasForeground(Color aColor)
aColor
- the color to usegetCanvasForeground
public Color getCanvasBackground()
setCanvasBackground
public void setCanvasBackground(Color aColor)
aColor
- the Color to usegetCanvasBackground
public void setBackground(Color aColor)
public void setForeground(Color aColor)
public void setMultipleMode(boolean value) throws PropertyVetoException
PropertyVetoException
public boolean isMultipleMode()
WTStatusBar getListStatus()
WTStatusBar getTreeStatus()
public WTList getList()
public WTTree getTree()
public void setList(WTList aList)
aList
- the new list viewpublic WTNode getRootNode()
public WTNode addNode(WTNode aParent, WTNode aChild)
aParent
- the parent of the new nodeaChild
- the new child node
public WTNode addNode(WTNode aParent, Explorable aChild)
aParent
- the parent of the new nodeaChild
- the new child object used to construct the new node
public WTNode addNode(WTNode aParent, Explorable aChild, boolean redraw)
aParent
- the parent of the new nodeaChild
- the new child object used to construct the new noderedraw
- if true, force redraw after adding node
public WTNode removeNode(WTNode aNode)
aNode
- the node to remove
public WTNode getSelectedNode()
public void setToolBarText(String aString)
aString
- the text to display in the toolbar areapublic Explorable addDetail(WTNode aNode, Explorable aDetail)
aNode
- the node to add detailaDetail
- the detail to add
public Explorable removeDetail(WTNode aNode, Explorable aDetail)
aNode
- the node to remove detail fromaDetail
- the detail to remove
public Explorable getSelectedDetail()
public Explorable[] getSelectedDetails()
public void showDetails(WTNode aNode)
aNode
- the node to show details forpublic WTNode[] findNodes(Explorable obj)
obj
- - the object to find.WTNode
,
Explorable
public WTNode findNode(Explorable obj)
obj
- - the object to find.WTNode
,
Explorable
public void refreshNode(WTNode aNode, Explorable newObj)
aNode
- the node to refreshnewObj
- the object used to refresh the nodepublic void refreshNode(WTNode aNode, Explorable newObj, boolean showDetails, boolean expand)
aNode
- the node to refreshnewObj
- the object used to refresh the nodeshowDetails
- if true, refresh the listview for the nodeexpand
- if true, expand the node after it is refreshedFrame getParentFrame()
protected ThreadGroup getThreadGroup()
protected void setThreadGroup(ThreadGroup threadGroup)
public void addListener(WTExplorerListener aListener)
aListener
- the new listenerpublic void removeListener(WTExplorerListener aListener)
aListener
- the listener to removeprivate void processEvent(WTExplorerEvent aEvent)
aEvent
- the event to processpublic void actionPerformed(ActionEvent e)
actionPerformed
in interface ActionListener
e
- the action event to processpublic void itemStateChanged(ItemEvent e)
itemStateChanged
in interface ItemListener
e
- the item event to processpublic void explorerEvent(WTExplorerEvent e)
explorerEvent
in interface WTExplorerListener
e
- the explorer event to processvoid processNode(WTNode aNode, boolean expose)
aNode
- the node to processexpose
- if true, redraw the contents in the list view.public void processExpose(WTNode aNode)
aNode
- the node to exposepublic void processExpand(WTNode aNode)
aNode
- the node to expandpublic void setHelpContext(HelpContext aHelpContext)
aHelpContext
- the new help contextpublic HelpContext getHelpContext()
private void initializeHelp()
public void propertyChange(PropertyChangeEvent event)
propertyChange
in interface PropertyChangeListener
public void setStatusBarText(String text) throws PropertyVetoException
text
- the string to display
PropertyVetoException
public String getStatusBarText()
public int getStatusBarPadding()
public void setStatusBarPadding(int x)
x
- the padding size for the status barpublic void setSelectedNode(WTNode node)
protected void showMessage(String title, String message)
title
- the title for the dialogmessage
- the message to displaypublic static void main(String[] args)
public void enableButton(String button_name, boolean enable)
button_name
- the String name of the button to be enabled/
disabledenable
- if true, the toolbar button is enabled;
if false, the toolbar button is disabledprotected boolean confirmAction(String message)
message
- the String message to display in the dialog
public void setRootNode(Explorable tree_root)
public void setImageStyle(int image_style)
image_style
- the integer value indicating the image style to use on
the toolbar butttonspublic void refreshDetails(WTNode node, Explorable obj) throws WTException
node
- the Node whose details are refreshedobj
- the Explorable to use as the object of the node
WTException
public void setColumnSorter(int column, symantec.itools.awt.CompareCells compare)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |