Author: sergeyhalipov
Date: 2007-06-22 13:07:10 -0400 (Fri, 22 Jun 2007)
New Revision: 1279
Modified:
trunk/richfaces/tree/src/main/java/org/richfaces/renderkit/TreeRendererBase.java
Log:
http://jira.jboss.com/jira/browse/RF-86
Modified:
trunk/richfaces/tree/src/main/java/org/richfaces/renderkit/TreeRendererBase.java
===================================================================
---
trunk/richfaces/tree/src/main/java/org/richfaces/renderkit/TreeRendererBase.java 2007-06-22
16:52:30 UTC (rev 1278)
+++
trunk/richfaces/tree/src/main/java/org/richfaces/renderkit/TreeRendererBase.java 2007-06-22
17:07:10 UTC (rev 1279)
@@ -152,40 +152,26 @@
}
}
}
-
- MethodBinding adviseNodeOpened = tree.getAdviseNodeOpened();
- if (null != adviseNodeOpened) {
- Boolean nodeOpened = (Boolean) adviseNodeOpened.invoke(context, new Object[]
{tree});
- if (null != nodeOpened) {
- if (nodeOpened.booleanValue()) {
- if (!componentState.isExpanded(rowKey)) {
- componentState.expandNode(rowKey);
+ else {
+ tree.setStateAdvisor(new TreeStateAdvisor() {
+ public Boolean adviseNodeOpened(UITree tree) {
+ MethodBinding adviseNodeOpened = tree.getAdviseNodeOpened();
+ if (null != adviseNodeOpened) {
+ return (Boolean) adviseNodeOpened.invoke(FacesContext.getCurrentInstance(), new
Object[] {tree});
}
+ return null;
}
- else {
- if (componentState.isExpanded((TreeRowKey)rowKey)) {
- componentState.collapseNode(rowKey);
+
+ public Boolean adviseNodeSelected(UITree tree) {
+ MethodBinding adviseNodeSelected = tree.getAdviseNodeSelected();
+ if (null != adviseNodeSelected) {
+ return (Boolean) adviseNodeSelected.invoke(FacesContext.getCurrentInstance(), new
Object [] {tree});
}
+ return null;
}
- }
+ });
+ processAdvisors(context, rowKey);
}
-
- MethodBinding adviseNodeSelected = tree.getAdviseNodeSelected();
- if (null != adviseNodeSelected) {
- Boolean nodeSelected = (Boolean) adviseNodeSelected.invoke(context, new Object []
{tree});
- if (null != nodeSelected) {
- if (nodeSelected.booleanValue()) {
- if (!componentState.isSelected(rowKey)) {
- componentState.setSelected(rowKey);
- }
- }
- else {
- if (componentState.isSelected(rowKey)) {
- componentState.setSelected(null);
- }
- }
- }
- }
}
}