LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.view.web.struts
Class LyStrutsTreeNode

java.lang.Object
  extended by leon.view.graphic.LyGraphicalObject
      extended by leon.view.web.LyWebObject
          extended by leon.view.web.struts.LyStrutsTreeNode
All Implemented Interfaces:
LyGraphicalComponent, LyGraphicalTreeNode, LyViewComponent, LyFreeInterface, LySetColorInterface, LySetFontInterface, LySetHiddenInterface, LySetImageInterface, LySetLabelInterface, LySetSelectedInterface, LySetValidityInterface, LyWebComponent

public class LyStrutsTreeNode
extends LyWebObject
implements LyGraphicalTreeNode

This class implements the TreeNode object (as described in the dtd) for web viewer.

TREE_NODE: Tree node
A tree node can contain a set of nodes (this node is then called parent node of those last nodes). It is possible to assign a label and several images to a tree node, and to indicate if it is selected, valid or open. It is also possible to indicate the font and the different colors of the node.

See Also:
LyTreeNode

Field Summary
static java.lang.String __VERSION
           
 
Fields inherited from class leon.view.web.LyWebObject
WEB_COMPONENT_ID, WEB_CONTROLLER_ID, WEB_SESSION_ID
 
Constructor Summary
LyStrutsTreeNode(LyTreeNode treeNode)
          Class constructor of a Tree Node object for the struts target.
 
Method Summary
 void addImage(LyImage image, int pos)
          (non-Javadoc).
 void addTreeNode(LyTreeNode treeNode, int pos)
          Inserts a sub-component treeNodes at given position.
 void computeTreeNodeValidity(LyComponent node)
          Computes the sub-tree validity.
 java.lang.String getBeginning()
          Gets the begining of the HTML representation of the node (its parent representation).
 java.lang.String getLastFrameName()
          Gets the last frame name where this tree node where generated.
 LyTree getParentTree()
          Gets parent tree instance.
 boolean hasChildSelected()
          Indicates if this node has at least one descendant selected.
 void prepareBeginning(LyStrutsTreeNode parent, boolean isLast)
          Prepare the begining of the HTML representation of the node (its parent representation).
 void removeImage(LyImage image)
          (non-Javadoc).
 void removeTreeNode(LyTreeNode treeNode)
          Removes a sub-component treeNodes.
 void setColor(java.lang.String color)
          (non-Javadoc).
 void setExpandable(boolean expandable)
          (non-Javadoc).
 void setFont(java.lang.String font)
          (non-Javadoc).
 void setForegroundColor(java.lang.String color)
          (non-Javadoc).
 void setHidden(boolean hidden)
          (non-Javadoc).
 void setImage(java.lang.String key)
          (non-Javadoc).
 void setLabel(java.lang.String label)
          (non-Javadoc).
 void setOpen(boolean open)
          (non-Javadoc).
 void setSelected(boolean status)
          (non-Javadoc).
 void setTooltip(java.lang.String tooltip)
          Updates attribute tooltip to the given value.
 void setValidity(LyTreeNode.Validity validity)
          (non-Javadoc).
 void updateValidityFromView()
          Updates the tree node validity from the view component.
 void writeHtml(LyWebPageWriter pw)
          (non-Javadoc).
 void writeNode(LyWebPageWriter pw, LyStrutsTreeNode parent, boolean isLast, LyTree.SelectionMode selectionMode, LyTree.SelectionType selectionType)
          Writes the HTML representation of this node.
 
Methods inherited from class leon.view.web.LyWebObject
addFileScript, decodeUrl, displayUpPage, encodeUrl, encodeUrlXhtml, expandUrl, free, getDisabledImageUrl, getFontSize, getFontString, getFontString, getFontString, getHexColor, getHexColor, getHtmlEntitiesString, getHtmlString, getImageSize, getImageSize, getImageUrl, getJavascriptString, getLyFont, getMessage, getRootUrl, getRootURL, getScrollHeightForSplitter, getUrl, getWebViewManager, refresh, replaceUrl, replaceUrl, setUpdating, updateRefreshInfo, writeJson
 
Methods inherited from class leon.view.graphic.LyGraphicalObject
expand, getBounds, getChildrenBounds, getController, getEnv, getEnvironment, getIdCode, getIntResource, getMessage, getResource, getString, getString, getString, getViewComponent, getViewManager, isFreed, isFreeing, isImageAnimated, processDemand, processDemand, testResource, translate
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface leon.view.graphic.LyGraphicalComponent
free, getViewComponent
 

Field Detail

__VERSION

public static final java.lang.String __VERSION
See Also:
Constant Field Values
Constructor Detail

LyStrutsTreeNode

public LyStrutsTreeNode(LyTreeNode treeNode)
Class constructor of a Tree Node object for the struts target.

Parameters:
treeNode - the generic Tree Node defined for every type of view targets
Method Detail

addTreeNode

public void addTreeNode(LyTreeNode treeNode,
                        int pos)
Description copied from interface: LyGraphicalTreeNode
Inserts a sub-component treeNodes at given position.

Specified by:
addTreeNode in interface LyGraphicalTreeNode
Parameters:
treeNode - The treeNodes to add to treeNodes list.
pos - Position where the sub-component is inserted.

removeTreeNode

public void removeTreeNode(LyTreeNode treeNode)
Description copied from interface: LyGraphicalTreeNode
Removes a sub-component treeNodes.

Specified by:
removeTreeNode in interface LyGraphicalTreeNode
Parameters:
treeNode - The treeNodes to remove to treeNodes list.

setSelected

public void setSelected(boolean status)
(non-Javadoc).

Specified by:
setSelected in interface LyGraphicalTreeNode
Specified by:
setSelected in interface LySetSelectedInterface
Parameters:
status - Boolean indicating if attribute selected is set or unset.
See Also:
LySetSelectedInterface.setSelected(boolean)

setOpen

public void setOpen(boolean open)
(non-Javadoc).

Specified by:
setOpen in interface LyGraphicalTreeNode
Parameters:
open - Boolean indicating if attribute open is set or unset.
See Also:
LyGraphicalTreeNode.setOpen(boolean)

writeHtml

public void writeHtml(LyWebPageWriter pw)
(non-Javadoc).

Specified by:
writeHtml in interface LyWebComponent
Parameters:
pw - the page writer
See Also:
LyWebComponent.writeHtml(leon.view.web.LyWebPageWriter)

getBeginning

public java.lang.String getBeginning()
Gets the begining of the HTML representation of the node (its parent representation).

Returns:
the HTML representation of its parent node

prepareBeginning

public void prepareBeginning(LyStrutsTreeNode parent,
                             boolean isLast)
Prepare the begining of the HTML representation of the node (its parent representation).

Parameters:
parent - the parent node of this node
isLast - true is this node is the last of the britherhood, false otherwise

getParentTree

public LyTree getParentTree()
Gets parent tree instance.

Returns:
parent tree instance

getLastFrameName

public java.lang.String getLastFrameName()
Gets the last frame name where this tree node where generated.

Overrides:
getLastFrameName in class LyWebObject
Returns:
the frame name

writeNode

public void writeNode(LyWebPageWriter pw,
                      LyStrutsTreeNode parent,
                      boolean isLast,
                      LyTree.SelectionMode selectionMode,
                      LyTree.SelectionType selectionType)
Writes the HTML representation of this node.

Parameters:
pw - the page writer
parent - the parent of this node, null it this is the root
isLast - indicates if this node is the last of the brotherhood or not
selectionMode - the selection mode
selectionType - the selection type

hasChildSelected

public boolean hasChildSelected()
Indicates if this node has at least one descendant selected.

Returns:
true if at least one child, child of child, etc. is selected, false otherwise

updateValidityFromView

public void updateValidityFromView()
Updates the tree node validity from the view component.


computeTreeNodeValidity

public void computeTreeNodeValidity(LyComponent node)
Computes the sub-tree validity.

Parameters:
node - current node

setLabel

public void setLabel(java.lang.String label)
(non-Javadoc).

Specified by:
setLabel in interface LyGraphicalTreeNode
Specified by:
setLabel in interface LySetLabelInterface
Parameters:
label - New value of label.
See Also:
LySetLabelInterface.setLabel(java.lang.String)

setHidden

public void setHidden(boolean hidden)
(non-Javadoc).

Specified by:
setHidden in interface LyGraphicalTreeNode
Specified by:
setHidden in interface LySetHiddenInterface
Parameters:
hidden - Boolean indicating if attribute hidden is set or unset.
See Also:
LySetHiddenInterface.setHidden(boolean)

setImage

public void setImage(java.lang.String key)
(non-Javadoc).

Specified by:
setImage in interface LyGraphicalTreeNode
Specified by:
setImage in interface LySetImageInterface
Parameters:
key - New value of image.
See Also:
LySetImageInterface.setImage(java.lang.String)

setColor

public void setColor(java.lang.String color)
(non-Javadoc).

Specified by:
setColor in interface LyGraphicalTreeNode
Specified by:
setColor in interface LySetColorInterface
Parameters:
color - New value of color.
See Also:
LySetColorInterface.setColor(java.lang.String)

setFont

public void setFont(java.lang.String font)
(non-Javadoc).

Specified by:
setFont in interface LyGraphicalTreeNode
Specified by:
setFont in interface LySetFontInterface
Parameters:
font - New value of font.
See Also:
LySetFontInterface.setFont(java.lang.String)

setForegroundColor

public void setForegroundColor(java.lang.String color)
(non-Javadoc).

See Also:
leon.view.graphic.LyGraphicalTreeNode#setForegroundColor(java.lang.String)

addImage

public void addImage(LyImage image,
                     int pos)
(non-Javadoc).

Specified by:
addImage in interface LyGraphicalTreeNode
Parameters:
image - The images to add to images list.
pos - Position where the sub-component is inserted.
See Also:
LyGraphicalTreeNode.addImage(leon.view.LyImage, int)

removeImage

public void removeImage(LyImage image)
(non-Javadoc).

Specified by:
removeImage in interface LyGraphicalTreeNode
Parameters:
image - The images to remove to images list.
See Also:
LyGraphicalTreeNode.removeImage(leon.view.LyImage)

setValidity

public void setValidity(LyTreeNode.Validity validity)
(non-Javadoc).

Specified by:
setValidity in interface LyGraphicalTreeNode
Specified by:
setValidity in interface LySetValidityInterface
Parameters:
validity - New value of validity.
See Also:
leon.view.setinterface.LySetValidityInterface#setValidity(java.lang.String)

setExpandable

public void setExpandable(boolean expandable)
(non-Javadoc).

Specified by:
setExpandable in interface LyGraphicalTreeNode
Parameters:
expandable - Boolean indicating if attribute expandable is set or unset.
See Also:
LyGraphicalTreeNode.setExpandable(boolean)

setTooltip

public void setTooltip(java.lang.String tooltip)
Description copied from interface: LyGraphicalTreeNode
Updates attribute tooltip to the given value.

Specified by:
setTooltip in interface LyGraphicalTreeNode
Parameters:
tooltip - New value of tooltip.

(c) January 2013 - W4 S.A.

Website: W4 S.A., contact us: support@w4global.com