facets.core.app
Class TreeView

java.lang.Object
  extended by facets.util.Tracer
      extended by facets.util.StatefulCore
          extended by facets.core.superficial.app.SelectionView
              extended by facets.core.app.TreeView
All Implemented Interfaces:
SView, Stateful, Titled, java.io.Serializable
Direct Known Subclasses:
ListView, TextTreeView

public class TreeView
extends SelectionView

SelectionView for TypedNode content.

See Also:
Serialized Form

Field Summary
static boolean debug
           
static int FACET_COLLAPSE
           
static int FACET_EXPAND
           
static java.lang.String KEY_DEBUG
           
static java.lang.String KEY_EXPAND
           
static java.lang.String NO_VALUE
           
 
Fields inherited from interface facets.core.superficial.app.SView
NO_VIEW
 
Constructor Summary
TreeView(java.lang.String title)
           
 
Method Summary
 boolean allowMultipleSelection()
          Implements interface method.
 boolean canChangeSelection()
           
 java.lang.String contentIconKey(java.lang.Object content)
          Key defining icon for node or value.
 java.lang.String emptyValueText()
           
protected  java.lang.Object[] filteredNodeContents(TypedNode node)
          Checks nodecontents against either includeNode(TypedNode,TypedNode) or includeValue(TypedNode,Object).
protected  boolean filterNodeContents()
           
protected  boolean includeNode(TypedNode parent, TypedNode node)
          Should node be included in the displayed contents of parent?
protected  boolean includeValue(TypedNode parent, java.lang.Object value)
          Should value be included in the displayed contents of parent?
 java.lang.Object[] nodeContents(SViewer viewer, TypedNode node)
          Return contents to be rendered.
 java.lang.String nodeRenderText(TypedNode node)
          The text to be rendered by the viewer for a node.
 boolean showRoot()
          Should the viewer display the root node of the tree?
 
Methods inherited from class facets.core.superficial.app.SelectionView
isLive, newViewerSelection
 
Methods inherited from class facets.util.StatefulCore
copyState, setState, setTitle, stateEquals, stateStamp, title, toString, updateStateStamp
 
Methods inherited from class facets.util.Tracer
trace, trace, trace, trace, trace, traceDebug, traceDebug, traceObjectText, traceOutput, traceOutputWithClass
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface facets.util.Titled
title
 

Field Detail

KEY_DEBUG

public static final java.lang.String KEY_DEBUG
See Also:
Constant Field Values

KEY_EXPAND

public static final java.lang.String KEY_EXPAND
See Also:
Constant Field Values

NO_VALUE

public static final java.lang.String NO_VALUE
See Also:
Constant Field Values

FACET_EXPAND

public static final int FACET_EXPAND
See Also:
Constant Field Values

FACET_COLLAPSE

public static final int FACET_COLLAPSE
See Also:
Constant Field Values

debug

public static boolean debug
Constructor Detail

TreeView

public TreeView(java.lang.String title)
Method Detail

allowMultipleSelection

public final boolean allowMultipleSelection()
Description copied from class: SelectionView
Implements interface method.

Default returns false.

Specified by:
allowMultipleSelection in interface SView
Overrides:
allowMultipleSelection in class SelectionView

contentIconKey

public java.lang.String contentIconKey(java.lang.Object content)
Key defining icon for node or value.

Parameters:
content - to be rendered

nodeContents

public java.lang.Object[] nodeContents(SViewer viewer,
                                       TypedNode node)
Return contents to be rendered.

The tree facet avatar may need to optimise calls to this method to ensure good rendering performance.

Parameters:
viewer - rendering the content
node - contains content to be rendered

filteredNodeContents

protected final java.lang.Object[] filteredNodeContents(TypedNode node)
Checks nodecontents against either includeNode(TypedNode,TypedNode) or includeValue(TypedNode,Object).

Parameters:
node -

filterNodeContents

protected boolean filterNodeContents()

includeNode

protected boolean includeNode(TypedNode parent,
                              TypedNode node)
Should node be included in the displayed contents of parent?

Default returns true.

Parameters:
parent - is that passed to nodeContents(SViewer,TypedNode)

includeValue

protected boolean includeValue(TypedNode parent,
                               java.lang.Object value)
Should value be included in the displayed contents of parent?

Default returns true.

Parameters:
parent - is that passed to nodeContents(SViewer,TypedNode)

nodeRenderText

public java.lang.String nodeRenderText(TypedNode node)
The text to be rendered by the viewer for a node.

Default returns node type and title.

Parameters:
node - to be rendered

showRoot

public boolean showRoot()
Should the viewer display the root node of the tree?

Default returns true.


canChangeSelection

public boolean canChangeSelection()

emptyValueText

public java.lang.String emptyValueText()