Author: alessio.soldano(a)jboss.com
Date: 2013-02-01 04:04:23 -0500 (Fri, 01 Feb 2013)
New Revision: 479
Removed:
webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/EmptyWiseTreeElement.java
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/WiseTreeElement.java
webgui/branches/cdi-jsf/src/main/webapp/index.xhtml
Log:
Proper support null results and use of return types
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-31
17:08:55 UTC (rev 478)
+++
webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/ClientConversationBean.java 2013-02-01
09:04:23 UTC (rev 479)
@@ -44,7 +44,6 @@
import org.jboss.wise.core.client.factories.WSDynamicClientFactory;
import org.jboss.wise.core.exception.InvocationException;
import org.jboss.wise.core.exception.WiseRuntimeException;
-import org.jboss.wise.gui.treeElement.EmptyWiseTreeElement;
import org.jboss.wise.gui.treeElement.GroupWiseTreeElement;
import org.jboss.wise.gui.treeElement.LazyLoadWiseTreeElement;
import org.jboss.wise.gui.treeElement.WiseTreeElement;
@@ -203,16 +202,13 @@
}
}
for (Entry<String, Object> res : result.getResult().entrySet()) {
- Object resObj = res.getValue();
final String key = res.getKey();
if (!key.startsWith(WSMethod.TYPE_PREFIX)) {
- WiseTreeElement wte;
- if (resObj != null) {
- wte = builder.buildTreeFromType(resTypes.get(WSMethod.TYPE_PREFIX + key), key,
resObj, true);
- } else {
- wte = new EmptyWiseTreeElement("result"); // TODO!! remove this and treat
other elements now that return types are available
+ Type type = resTypes.get(WSMethod.TYPE_PREFIX + key);
+ if (type != void.class && type != Void.class) {
+ WiseTreeElement wte = builder.buildTreeFromType(type, key, res.getValue(), true);
+ rootElement.addChild(wte.getId(), wte);
}
- rootElement.addChild(wte.getId(), wte);
}
}
return rootElement;
Deleted:
webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/EmptyWiseTreeElement.java
===================================================================
---
webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/EmptyWiseTreeElement.java 2013-01-31
17:08:55 UTC (rev 478)
+++
webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/EmptyWiseTreeElement.java 2013-02-01
09:04:23 UTC (rev 479)
@@ -1,68 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2012, Red Hat, Inc. and/or its affiliates, and individual
- * contributors by the @authors tag. See the copyright.txt in the
- * distribution for a full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.wise.gui.treeElement;
-
-import org.jboss.wise.core.utils.IDGenerator;
-
-/**
- * @author Alessio Soldano, alessio.soldano(a)jboss.com
- *
- */
-public class EmptyWiseTreeElement extends WiseTreeElement {
-
- private static final long serialVersionUID = 1L;
-
- public EmptyWiseTreeElement() {
- super(true);
- this.kind = EMPTY;
- this.id = IDGenerator.nextVal();
- }
-
- public EmptyWiseTreeElement(String name) {
- super(true);
- this.kind = EMPTY;
- this.id = IDGenerator.nextVal();
- this.name = name;
- }
-
- /**
- * Returns the String value of the instance corresponding to this element.
- *
- * @return The value
- */
- public String getValue() {
- return null;
- }
-
- public WiseTreeElement clone() {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Gets the value for this element parsing a given object instance. This is
- * to be used to set the element value after the service invocation.
- *
- * @param obj
- */
- public void parseObject(Object obj) {
- throw new UnsupportedOperationException();
- }
-
- public Object toObject() {
- return null;
- }
-}
Modified:
webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/WiseTreeElement.java
===================================================================
---
webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/WiseTreeElement.java 2013-01-31
17:08:55 UTC (rev 478)
+++
webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/WiseTreeElement.java 2013-02-01
09:04:23 UTC (rev 479)
@@ -37,7 +37,6 @@
public static final String BYTE_ARRAY = "byteArray";
public static final String COMPLEX = "complex";
public static final String DURATION = "Duration";
- public static final String EMPTY = "empty";
public static final String ENUMERATION = "Enumeration";
public static final String GROUP = "group";
public static final String LAZY = "lazy";
Modified: webgui/branches/cdi-jsf/src/main/webapp/index.xhtml
===================================================================
--- webgui/branches/cdi-jsf/src/main/webapp/index.xhtml 2013-01-31 17:08:55 UTC (rev 478)
+++ webgui/branches/cdi-jsf/src/main/webapp/index.xhtml 2013-02-01 09:04:23 UTC (rev 479)
@@ -222,6 +222,13 @@
<rich:treeNode type="group">
<h:outputText value="#{node.prototype.type}[#{node.size}]"
/>
</rich:treeNode>
+ <rich:treeNode type="lazy">
+ <h:outputText value="#{node.type} ..." />
+ <h:outputText value=" " />
+ <a4j:commandLink name="Load"
action="#{clientConversationBean.lazyLoadChild(node)}"
reRender="richResTree" rendered="#{not node.resolved}">
+ load
+ </a4j:commandLink>
+ </rich:treeNode>
<rich:treeNode type="complex">
<h:outputText value="#{node.type} : #{node.name}" />
</rich:treeNode>
@@ -230,9 +237,6 @@
rendered="#{node.notNil}" />
<h:outputText value="#{node.type} : #{node.name} = ***NIL***"
rendered="#{node.nil}" />
</rich:treeNode>
- <rich:treeNode type="empty">
- <h:outputText value="#{node.name} = ***NIL***" />
- </rich:treeNode>
</rich:tree>
</h:form>
</rich:panel>