Package org.openxava.web.editors
Class TreeView
- java.lang.Object
-
- org.openxava.web.editors.TreeView
-
public class TreeView extends java.lang.Object
- Author:
- Federico Alcántara
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getIdProperties()
java.lang.String
getIdSeparator()
int
getKeyIncrement()
java.lang.String
getNodeFullPath(java.lang.Object object)
Returns the complete path of the node including the node name.java.lang.String
getNodeName(java.lang.Object object)
Returns the node name as it is used in the pathint
getNodeOrder(java.lang.Object object)
If the property orderProperty of @TreeView annotation is defined, returns the order of the object within its parent; otherwise returns 0.java.lang.String
getNodePath(java.lang.Object object)
Returns the parent path of the node.java.lang.String
getOrderProperty()
java.lang.String
getPathProperty()
java.lang.String
getPathSeparator()
ITreeViewReader
getTreeViewReaderImpl()
Creates the implementation of TreeView readerboolean
isEntityObject()
boolean
isOrderDefined()
protected void
parseTreeView(Tree path, java.lang.Class nodeClass, java.lang.Class parentClass, java.lang.String collectionName)
Parse the @TreeView annotation.protected void
setEntityObject(boolean entityObject)
protected void
setIdProperties(java.lang.String idProperties)
protected void
setIdSeparator(java.lang.String idSeparator)
protected void
setKeyIncrement(int keyIncrement)
void
setNodeOrder(java.lang.Object object, int value)
Changes the order of the node within its parent.void
setNodePath(java.lang.Object object, java.lang.String value)
Sets the node path.protected void
setOrderProperty(java.lang.String orderProperty)
protected void
setPathProperty(java.lang.String pathProperty)
protected void
setPathSeparator(java.lang.String pathSeparator)
-
-
-
Constructor Detail
-
TreeView
public TreeView()
-
TreeView
public TreeView(Tree path, java.lang.Class nodeClass, java.lang.Class parent, java.lang.String collectionName, java.lang.String treeViewReaderName) throws java.lang.Exception
- Throws:
java.lang.Exception
-
-
Method Detail
-
parseTreeView
protected void parseTreeView(Tree path, java.lang.Class nodeClass, java.lang.Class parentClass, java.lang.String collectionName) throws java.lang.Exception
Parse the @TreeView annotation.- Parameters:
nodeClass
- Object to be parsed.- Throws:
java.lang.Exception
-
getNodeName
public java.lang.String getNodeName(java.lang.Object object)
Returns the node name as it is used in the path- Parameters:
object
- Object to be inspected.- Returns:
- The node name. It can be compound with multiple values (when you have multiple id, for example).
-
getNodePath
public java.lang.String getNodePath(java.lang.Object object) throws java.lang.Exception
Returns the parent path of the node.- Parameters:
object
- Object to be inspected.- Returns:
- The path excluding the node name.
- Throws:
java.lang.Exception
-
setNodePath
public void setNodePath(java.lang.Object object, java.lang.String value) throws java.lang.Exception
Sets the node path.- Parameters:
object
- Object to be updated.value
- New path to be used.- Throws:
java.lang.Exception
-
getNodeFullPath
public java.lang.String getNodeFullPath(java.lang.Object object) throws java.lang.Exception
Returns the complete path of the node including the node name.- Parameters:
object
- Object to be inspected.- Returns:
- Complete path.
- Throws:
java.lang.Exception
-
getNodeOrder
public int getNodeOrder(java.lang.Object object)
If the property orderProperty of @TreeView annotation is defined, returns the order of the object within its parent; otherwise returns 0.- Parameters:
object
- Object to be inspected.- Returns:
- Current order or zero.
-
setNodeOrder
public void setNodeOrder(java.lang.Object object, int value)
Changes the order of the node within its parent. Ignored if orderProperty is not defined.- Parameters:
object
- Object to be updated.value
- New order to be applied.
-
getPathProperty
public java.lang.String getPathProperty()
- Returns:
- the pathProperty
-
setPathProperty
protected void setPathProperty(java.lang.String pathProperty)
- Parameters:
pathProperty
- the pathProperty to set
-
setIdProperties
protected void setIdProperties(java.lang.String idProperties)
- Parameters:
idProperties
- the idProperties to set
-
getIdProperties
public java.lang.String getIdProperties()
- Returns:
- the idProperties
-
getOrderProperty
public java.lang.String getOrderProperty()
- Returns:
- the orderProperty
-
setOrderProperty
protected void setOrderProperty(java.lang.String orderProperty)
- Parameters:
orderProperty
- the orderProperty to set
-
getKeyIncrement
public int getKeyIncrement()
- Returns:
- the keyIncrement
-
setKeyIncrement
protected void setKeyIncrement(int keyIncrement)
- Parameters:
keyIncrement
- the keyIncrement to set
-
setPathSeparator
protected void setPathSeparator(java.lang.String pathSeparator)
- Parameters:
pathSeparator
- the pathSeparator to set
-
getPathSeparator
public java.lang.String getPathSeparator()
- Returns:
- the pathSeparator
-
setEntityObject
protected void setEntityObject(boolean entityObject)
- Parameters:
entityObject
- the entityObject to set
-
isEntityObject
public boolean isEntityObject()
- Returns:
- the entityObject
-
isOrderDefined
public boolean isOrderDefined()
-
setIdSeparator
protected void setIdSeparator(java.lang.String idSeparator)
- Parameters:
idSeparator
- the idSeparator to set
-
getIdSeparator
public java.lang.String getIdSeparator()
- Returns:
- the idSeparator
-
getTreeViewReaderImpl
public ITreeViewReader getTreeViewReaderImpl()
Creates the implementation of TreeView reader- Returns:
- Object implementing the ITreeViewReader
- Throws:
java.lang.Exception
-
-