Author: nbelaevski
Date: 2009-03-23 20:35:31 -0400 (Mon, 23 Mar 2009)
New Revision: 13130
Modified:
trunk/ui/tree/src/main/java/org/richfaces/component/UITree.java
Log:
https://jira.jboss.org/jira/browse/RF-6560
Modified: trunk/ui/tree/src/main/java/org/richfaces/component/UITree.java
===================================================================
--- trunk/ui/tree/src/main/java/org/richfaces/component/UITree.java 2009-03-24 00:29:41
UTC (rev 13129)
+++ trunk/ui/tree/src/main/java/org/richfaces/component/UITree.java 2009-03-24 00:35:31
UTC (rev 13130)
@@ -1069,10 +1069,19 @@
* @return row key
*/
public Object getTreeNodeRowKey(TreeNode node) {
- return ((AbstractTreeDataModel) getExtendedDataModel()).getTreeNodeRowKey(node);
+ return getTreeNodeRowKey((Object) node);
}
/**
+ * Return row key for generic model's tree node
+ *
+ * @return row key
+ */
+ public Object getTreeNodeRowKey(Object node) {
+ return ((AbstractTreeDataModel) getExtendedDataModel()).getTreeNodeRowKey(node);
+ }
+
+ /**
* Collect current tree node state including node selection and expanded nodes list
*
* @param transferQueuedNodes whether to collect queued expanded nodes states or not
@@ -1162,17 +1171,34 @@
public Object removeNode(Object rowKey) {
return removeNode(getFacesContext(), rowKey);
}
+
/**
* Add node to tree
*
+ * @param parentRowKey parent node row key
+ * @param newNode inserted node
+ * @param id inserted node parent's local identifier
+ * @param state inserted tree node state. Optional
+ *
+ * @since 3.3.1
+ */
+ public void addNode(Object parentRowKey, Object newNode, Object id, Object state) {
+ addNode(getFacesContext(), parentRowKey, newNode, id, state);
+ }
+
+ /**
+ * Add node to tree
+ *
* @param context JSF context
* @param parentRowKey parent node row key
* @param newNode inserted node
* @param id inserted node parent's local identifier
* @param state inserted tree node state. Optional
+ *
+ * @since 3.3.1
*/
- public void addNode(FacesContext context, Object parentRowKey, TreeNode newNode, Object
id, Object state) {
+ public void addNode(FacesContext context, Object parentRowKey, Object newNode, Object
id, Object state) {
if (newNode != null) {
Object storedKey = getRowKey();
try {
@@ -1201,11 +1227,24 @@
/**
* Add node to tree
*
+ * @param context JSF context
* @param parentRowKey parent node row key
* @param newNode inserted node
* @param id inserted node parent's local identifier
* @param state inserted tree node state. Optional
*/
+ public void addNode(FacesContext context, Object parentRowKey, TreeNode newNode, Object
id, Object state) {
+ addNode(context, parentRowKey, (Object) newNode, id, state);
+ }
+
+ /**
+ * Add node to tree
+ *
+ * @param parentRowKey parent node row key
+ * @param newNode inserted node
+ * @param id inserted node parent's local identifier
+ * @param state inserted tree node state. Optional
+ */
public void addNode(Object parentRowKey, TreeNode draggedNode, Object id, Object state)
{
addNode(getFacesContext(), parentRowKey, draggedNode, id, state);
}