Package io.guise.framework.platform.web
Class WebTreeControlDepictor<C extends TreeControl>
java.lang.Object
io.guise.framework.platform.AbstractDepictor<C>
io.guise.framework.platform.AbstractComponentDepictor<C>
io.guise.framework.platform.web.AbstractWebComponentDepictor<C>
io.guise.framework.platform.web.AbstractDecoratedWebComponentDepictor<C>
io.guise.framework.platform.web.WebTreeControlDepictor<C>
- Type Parameters:
C
- The type of component being depicted.
- All Implemented Interfaces:
ComponentDepictor<C>
,Depictor<C>
,WebComponentDepictor<C>
,WebDepictor<C>
public class WebTreeControlDepictor<C extends TreeControl>
extends AbstractDecoratedWebComponentDepictor<C>
Strategy for rendering a tree component as an XHTML
<div>
element.- Author:
- Garret Wilson
-
Nested Class Summary
Nested classes/interfaces inherited from class io.guise.framework.platform.AbstractComponentDepictor
AbstractComponentDepictor.DepictedCompositeComponentListener
Nested classes/interfaces inherited from class io.guise.framework.platform.AbstractDepictor
AbstractDepictor.DepictedPropertyChangeListener
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
The resource bundle key for the tree node expanded image URI.static final String
The resource bundle key for the tree node collapsed image URI.static final String
The resource bundle key for the tree node leaf image URI.Fields inherited from class io.guise.framework.platform.web.AbstractWebComponentDepictor
BODY_END_PATTERN, BODY_START_PATTERN
Fields inherited from class io.guise.framework.platform.AbstractComponentDepictor
childPropertyChangeListener
Fields inherited from interface io.guise.framework.platform.Depictor
GENERAL_PROPERTY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
Depicts any child components.getTreeNode
(long treeNodeID) Determines the tree node associated with the given ID.long
getTreeNodeID
(TreeNodeModel<?> treeNode) Determines the ID of the given tree node in this view.getTreeNodeStyleIDs
(TreeModel treeModel, TreeNodeModel<T> treeNode, String prefix, String suffix) Retrieves the style IDs for a tree node.void
processEvent
(PlatformEvent event) Processes an event from the platform.protected <T> void
updateTreeNodeChildViews
(TreeModel treeModel, TreeNodeModel<T> treeNode) Updates the views of a tree node's children, if any.protected <T> void
updateTreeNodeView
(TreeModel treeModel, TreeNodeModel<T> treeNode) Updates the view of a tree node.Methods inherited from class io.guise.framework.platform.web.AbstractDecoratedWebComponentDepictor
depictBegin, depictEnd, getBodyLocalName, getBodyNamespaceURI, isEmptyBodyElementAllowed, writeDecoratorBegin, writeDecoratorEnd
Methods inherited from class io.guise.framework.platform.web.AbstractWebComponentDepictor
addFlowStyleIDs, decorateID, depict, depictBody, getBackgroundColor, getBaseStyleIDs, getBodyStyleIDs, getBodyStyles, getColor, getDepictContext, getDepictName, getLabelStyles, getLabelStyles, getLabelStyles, getLocalName, getNamespaceURI, getOuterStyles, getPlatform, hasLabelContent, hasLabelContent, hasLabelContent, hasLabelContent, isEmptyElementAllowed, isMouseListener, writeBodyIDClassAttributes, writeClassAttribute, writeDirectionAttribute, writeDirectionAttribute, writeErrorMessage, writeFloatClear, writeIDAttribute, writeIDClassAttributes, writeLabel, writeLabelContent, writeLabelContent, writeLabelContent, writeLabelContent, writeLabelContent, writeLabelContent, writeParameterInputs, writeStyleAttribute, writeText
Methods inherited from class io.guise.framework.platform.AbstractComponentDepictor
depictChild, depictedObjectPropertyChange, getDepictedCompositeComponentListener, getErrorMessage, installed, uninstalled
Methods inherited from class io.guise.framework.platform.AbstractDepictor
getDepictedObject, getDepictedPropertyChangeListener, getIgnoredProperties, getModifiedProperties, getSession, isDepicted, setDepicted, setPropertyModified
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.guise.framework.platform.Depictor
getDepictedObject, getSession, installed, isDepicted, setDepicted, uninstalled
-
Field Details
-
TREE_NODE_COLLAPSED_IMAGE_RESOURCE_KEY
The resource bundle key for the tree node expanded image URI.- See Also:
-
TREE_NODE_EXPANDED_IMAGE_RESOURCE_KEY
The resource bundle key for the tree node collapsed image URI.- See Also:
-
TREE_NODE_LEAF_IMAGE_RESOURCE_KEY
The resource bundle key for the tree node leaf image URI.- See Also:
-
-
Constructor Details
-
WebTreeControlDepictor
public WebTreeControlDepictor()Default constructor using the XHTML<div>
element.
-
-
Method Details
-
getTreeNodeID
Determines the ID of the given tree node in this view. If the tree node has no ID assigned, one will be generated.- Parameters:
treeNode
- The tree node for which an ID should be returned.- Returns:
- The unique ID of the given tree node.
-
getTreeNode
Determines the tree node associated with the given ID.- Parameters:
treeNodeID
- An ID assigned to a tree node.- Returns:
- The tree node associated with the given ID, or
null
if there is no tree node associated with the ID.
-
processEvent
Description copied from class:AbstractComponentDepictor
Processes an event from the platform.This implementation handles
PlatformFocusEvent
.- Specified by:
processEvent
in interfaceDepictor<C extends TreeControl>
- Overrides:
processEvent
in classAbstractComponentDepictor<C extends TreeControl>
- Parameters:
event
- The event to be processed.
-
getTreeNodeStyleIDs
protected <T> Set<String> getTreeNodeStyleIDs(TreeModel treeModel, TreeNodeModel<T> treeNode, String prefix, String suffix) Retrieves the style IDs for a tree node.- Type Parameters:
T
- The type of value contained in the tree node. This version returns the base tree node style IDGuiseCSSStyleConstants.TREE_NODE_CLASS
with the given prefix/suffix, if any, along with styles representing the expanded or collapsed state and whether the node is a leaf.- Parameters:
treeModel
- The component model.treeNode
- The tree node.prefix
- The prefix that needs to be added to the base style, ornull
if there is no prefix to add.suffix
- The suffix that needs to be added to the base style, ornull
if there is no suffix to add.- Returns:
- The style IDs for the tree node.
-
depictChildren
Description copied from class:AbstractComponentDepictor
Depicts any child components.- Overrides:
depictChildren
in classAbstractComponentDepictor<C extends TreeControl>
- Throws:
IOException
- if there is an error updating the child depictions.
-
updateTreeNodeView
protected <T> void updateTreeNodeView(TreeModel treeModel, TreeNodeModel<T> treeNode) throws IOException Updates the view of a tree node.- Type Parameters:
T
- The type of value contained in the tree node.- Parameters:
treeModel
- The component model.treeNode
- The tree node.- Throws:
IOException
- if there is an error updating the tree node view.
-
updateTreeNodeChildViews
protected <T> void updateTreeNodeChildViews(TreeModel treeModel, TreeNodeModel<T> treeNode) throws IOException Updates the views of a tree node's children, if any.- Type Parameters:
T
- The type of value contained in the tree node.- Parameters:
treeModel
- The component model.treeNode
- The tree node the views of the children of which should be updated.- Throws:
IOException
- if there is an error updating the child tree node views.
-