Author: alessio.soldano(a)jboss.com
Date: 2013-01-26 19:22:48 -0500 (Sat, 26 Jan 2013)
New Revision: 464
Modified:
webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/ClientConversationBean.java
webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/LazyLoadWiseTreeElement.java
webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/SimpleWiseTreeElement.java
webgui/branches/cdi-jsf/src/main/webapp/index.xhtml
Log:
Adding lazy load functionality in gui tree
Modified:
webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/ClientConversationBean.java
===================================================================
---
webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/ClientConversationBean.java 2013-01-26
23:58:27 UTC (rev 463)
+++
webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/ClientConversationBean.java 2013-01-27
00:22:48 UTC (rev 464)
@@ -43,6 +43,7 @@
import org.jboss.wise.core.client.builder.WSDynamicClientBuilder;
import org.jboss.wise.core.client.factories.WSDynamicClientFactory;
import org.jboss.wise.gui.treeElement.GroupWiseTreeElement;
+import org.jboss.wise.gui.treeElement.LazyLoadWiseTreeElement;
import org.jboss.wise.gui.treeElement.WiseTreeElement;
import org.jboss.wise.gui.treeElement.WiseTreeElementBuilder;
import org.richfaces.component.UITree;
@@ -138,6 +139,14 @@
}
}
+ public void lazyLoadChild(LazyLoadWiseTreeElement el) {
+ try {
+ el.resolveReference();
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+
private static TreeNodeImpl convertOperationParametersToGui(WSMethod wsMethod,
WSDynamicClient client) {
WiseTreeElementBuilder builder = new WiseTreeElementBuilder(client);
TreeNodeImpl rootElement = new TreeNodeImpl();
Modified:
webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/LazyLoadWiseTreeElement.java
===================================================================
---
webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/LazyLoadWiseTreeElement.java 2013-01-26
23:58:27 UTC (rev 463)
+++
webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/LazyLoadWiseTreeElement.java 2013-01-27
00:22:48 UTC (rev 464)
@@ -67,6 +67,7 @@
if (!isResolved()) {
WiseTreeElement ref = treeTypesMap.get(this.classType);
WiseTreeElement component = (WiseTreeElement) ref.clone();
+ component.setName(this.getName());
addChild(component.getId(), component);
setResolved(true);
}
Modified:
webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/SimpleWiseTreeElement.java
===================================================================
---
webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/SimpleWiseTreeElement.java 2013-01-26
23:58:27 UTC (rev 463)
+++
webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/SimpleWiseTreeElement.java 2013-01-27
00:22:48 UTC (rev 464)
@@ -110,7 +110,6 @@
element.setName(this.name);
element.setNil(this.nil);
element.setClassType(this.classType);
- element.setValue(this.value);
element.setRemovable(this.isRemovable());
element.setNillable(this.isNillable());
return element;
Modified: webgui/branches/cdi-jsf/src/main/webapp/index.xhtml
===================================================================
--- webgui/branches/cdi-jsf/src/main/webapp/index.xhtml 2013-01-26 23:58:27 UTC (rev 463)
+++ webgui/branches/cdi-jsf/src/main/webapp/index.xhtml 2013-01-27 00:22:48 UTC (rev 464)
@@ -77,6 +77,13 @@
<!-- <h:graphicImage styleClass="minus"
value="images/small/Minus.png" rendered="#{node.removable}" />
-->
</a4j:commandLink>
</rich:treeNode>
+ <rich:treeNode type="lazy">
+ <h:outputText value="#{node.type} ..." />
+ <h:outputText value=" " />
+ <a4j:commandLink name="Load"
action="#{clientConversationBean.lazyLoadChild(node)}"
reRender="richTree" rendered="#{not node.resolved}">
+ load
+ </a4j:commandLink>
+ </rich:treeNode>
<rich:treeNode type="complex">
<h:outputText value="#{node.type} : #{node.name} " />
<h:selectBooleanCheckbox value="#{node.notNil}"
disabled="#{node.notNillable}" />