Author: alessio.soldano(a)jboss.com
Date: 2013-07-03 12:51:11 -0400 (Wed, 03 Jul 2013)
New Revision: 573
Added:
webgui/trunk/src/main/java/org/jboss/wise/gui/treeElement/IDGenerator.java
Modified:
webgui/trunk/src/main/java/org/jboss/wise/gui/treeElement/ComplexWiseTreeElement.java
webgui/trunk/src/main/java/org/jboss/wise/gui/treeElement/GroupWiseTreeElement.java
webgui/trunk/src/main/java/org/jboss/wise/gui/treeElement/LazyLoadWiseTreeElement.java
webgui/trunk/src/main/java/org/jboss/wise/gui/treeElement/ParameterizedWiseTreeElement.java
webgui/trunk/src/main/java/org/jboss/wise/gui/treeElement/SimpleWiseTreeElement.java
webgui/trunk/src/main/java/org/jboss/wise/gui/treeElement/WiseTreeElementBuilder.java
webgui/trunk/src/main/webapp/step3.xhtml
Log:
[WISE-205] Reducing ajax messages size by using shorter ids for gui elements and shorter
labels
Modified:
webgui/trunk/src/main/java/org/jboss/wise/gui/treeElement/ComplexWiseTreeElement.java
===================================================================
---
webgui/trunk/src/main/java/org/jboss/wise/gui/treeElement/ComplexWiseTreeElement.java 2013-07-03
12:36:16 UTC (rev 572)
+++
webgui/trunk/src/main/java/org/jboss/wise/gui/treeElement/ComplexWiseTreeElement.java 2013-07-03
16:51:11 UTC (rev 573)
@@ -27,7 +27,6 @@
import javax.xml.datatype.XMLGregorianCalendar;
import org.jboss.wise.core.exception.WiseRuntimeException;
-import org.jboss.wise.core.utils.IDGenerator;
import org.jboss.wise.core.utils.ReflectionUtils;
/**
Modified:
webgui/trunk/src/main/java/org/jboss/wise/gui/treeElement/GroupWiseTreeElement.java
===================================================================
---
webgui/trunk/src/main/java/org/jboss/wise/gui/treeElement/GroupWiseTreeElement.java 2013-07-03
12:36:16 UTC (rev 572)
+++
webgui/trunk/src/main/java/org/jboss/wise/gui/treeElement/GroupWiseTreeElement.java 2013-07-03
16:51:11 UTC (rev 573)
@@ -21,8 +21,6 @@
import java.util.Iterator;
import java.util.LinkedList;
-import org.jboss.wise.core.utils.IDGenerator;
-
/**
* This tree element is for arrays and collections of elements
*
Added: webgui/trunk/src/main/java/org/jboss/wise/gui/treeElement/IDGenerator.java
===================================================================
--- webgui/trunk/src/main/java/org/jboss/wise/gui/treeElement/IDGenerator.java
(rev 0)
+++ webgui/trunk/src/main/java/org/jboss/wise/gui/treeElement/IDGenerator.java 2013-07-03
16:51:11 UTC (rev 573)
@@ -0,0 +1,35 @@
+/*
+ * 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 java.util.concurrent.atomic.AtomicInteger;
+
+/**
+ * An ID generator returning short values (unique on the same VM).
+ * This backed by an atomic integer.
+ *
+ * @author alessio.soldano(a)jboss.com
+ *
+ */
+public class IDGenerator {
+
+ private static AtomicInteger idCounter = new AtomicInteger();
+
+ public static final String nextVal() {
+ return String.valueOf(idCounter.getAndIncrement());
+ }
+}
Modified:
webgui/trunk/src/main/java/org/jboss/wise/gui/treeElement/LazyLoadWiseTreeElement.java
===================================================================
---
webgui/trunk/src/main/java/org/jboss/wise/gui/treeElement/LazyLoadWiseTreeElement.java 2013-07-03
12:36:16 UTC (rev 572)
+++
webgui/trunk/src/main/java/org/jboss/wise/gui/treeElement/LazyLoadWiseTreeElement.java 2013-07-03
16:51:11 UTC (rev 573)
@@ -20,8 +20,6 @@
import java.util.Iterator;
import java.util.Map;
-import org.jboss.wise.core.utils.IDGenerator;
-
/**
* This tree element is for storing lazy load references to other elements;
* required because in some uncommon scenario, the parameter trees might
Modified:
webgui/trunk/src/main/java/org/jboss/wise/gui/treeElement/ParameterizedWiseTreeElement.java
===================================================================
---
webgui/trunk/src/main/java/org/jboss/wise/gui/treeElement/ParameterizedWiseTreeElement.java 2013-07-03
12:36:16 UTC (rev 572)
+++
webgui/trunk/src/main/java/org/jboss/wise/gui/treeElement/ParameterizedWiseTreeElement.java 2013-07-03
16:51:11 UTC (rev 573)
@@ -27,8 +27,6 @@
import org.jboss.wise.core.client.WSDynamicClient;
import org.jboss.wise.core.exception.WiseRuntimeException;
-import org.jboss.wise.core.utils.IDGenerator;
-
/**
* A tree element to handle JAXBElement<T>.
*
Modified:
webgui/trunk/src/main/java/org/jboss/wise/gui/treeElement/SimpleWiseTreeElement.java
===================================================================
---
webgui/trunk/src/main/java/org/jboss/wise/gui/treeElement/SimpleWiseTreeElement.java 2013-07-03
12:36:16 UTC (rev 572)
+++
webgui/trunk/src/main/java/org/jboss/wise/gui/treeElement/SimpleWiseTreeElement.java 2013-07-03
16:51:11 UTC (rev 573)
@@ -22,7 +22,6 @@
import java.net.URLEncoder;
import org.jboss.wise.core.exception.WiseRuntimeException;
-import org.jboss.wise.core.utils.IDGenerator;
import org.jboss.wise.core.utils.JavaUtils;
import sun.misc.BASE64Encoder;
Modified:
webgui/trunk/src/main/java/org/jboss/wise/gui/treeElement/WiseTreeElementBuilder.java
===================================================================
---
webgui/trunk/src/main/java/org/jboss/wise/gui/treeElement/WiseTreeElementBuilder.java 2013-07-03
12:36:16 UTC (rev 572)
+++
webgui/trunk/src/main/java/org/jboss/wise/gui/treeElement/WiseTreeElementBuilder.java 2013-07-03
16:51:11 UTC (rev 573)
@@ -34,7 +34,6 @@
import org.jboss.logging.Logger;
import org.jboss.wise.core.client.WSDynamicClient;
import org.jboss.wise.core.exception.WiseRuntimeException;
-import org.jboss.wise.core.utils.IDGenerator;
import org.jboss.wise.core.utils.ReflectionUtils;
/**
Modified: webgui/trunk/src/main/webapp/step3.xhtml
===================================================================
--- webgui/trunk/src/main/webapp/step3.xhtml 2013-07-03 12:36:16 UTC (rev 572)
+++ webgui/trunk/src/main/webapp/step3.xhtml 2013-07-03 16:51:11 UTC (rev 573)
@@ -12,44 +12,34 @@
<div>
<i>#{clientConversationBean.currentOperationFullName}</i>
</div>
- <a4j:outputPanel id="parInputPanel"
ajaxRendered="true"> <!-- The tree must live within a ajaxRendered
outputPanel in order for properly refreshing! -->
- <rich:tree id="richTree" var="node"
value="#{clientConversationBean.inputTree}" nodeType="#{node.kind}"
binding="#{clientConversationBean.inTree}">
+ <a4j:outputPanel id="parInputPanel">
+ <rich:tree id="rt" var="node"
value="#{clientConversationBean.inputTree}" nodeType="#{node.kind}"
binding="#{clientConversationBean.inTree}">
<rich:treeNode type="simple">
<h:outputText value="#{node.type} : #{node.name} "
/>
- <h:selectBooleanCheckbox id="foo-chk"
value="#{node.notNil}" disabled="#{node.notNillable}" >
+ <h:selectBooleanCheckbox id="n_cb"
value="#{node.notNil}" disabled="#{node.notNillable}" >
<f:ajax />
</h:selectBooleanCheckbox>
- <h:inputText value="#{node.value}" id="foo"
label="" rendered="#{node.type!='boolean' and
node.type!='Boolean'}" columns="10" >
- <f:ajax event="valueChange"
render="foo-chk"
listener="#{clientConversationBean.onInputFocus(node)}" />
+ <h:inputText value="#{node.value}" id="n"
label="" rendered="#{node.type!='boolean' and
node.type!='Boolean'}" columns="10" >
+ <f:ajax event="valueChange" render="n_cb"
listener="#{clientConversationBean.onInputFocus(node)}" />
</h:inputText>
<h:selectOneMenu value="#{node.value}"
rendered="#{node.type=='boolean' or node.type=='Boolean'}">
<f:selectItem itemValue="true"
itemLabel="true" />
<f:selectItem itemValue="false"
itemLabel="false" />
</h:selectOneMenu>
- <a4j:commandLink
action="#{clientConversationBean.removeChild(node)}"
rerender="richTree" rendered="#{node.removable}">
- Remove
- </a4j:commandLink>
+ <a4j:commandLink
action="#{clientConversationBean.removeChild(node)}" render="rt"
rendered="#{node.removable}">Remove</a4j:commandLink>
</rich:treeNode>
<rich:treeNode type="group"
expanded="#{node.expanded}">
<h:outputText value="[#{node.type}]"
styleClass="tipoCampo" />
<h:selectBooleanCheckbox value="#{node.notNil}"
disabled="true" />
<h:outputText value=" " />
- <a4j:commandLink name="Add"
action="#{clientConversationBean.addChild(node)}"
reRender="richTree">
- Add
- </a4j:commandLink>
- <a4j:commandLink
action="#{clientConversationBean.removeChild(node)}"
rerender="richTree" rendered="#{node.removable}">
- Remove
- </a4j:commandLink>
+ <a4j:commandLink name="Add"
action="#{clientConversationBean.addChild(node)}"
render="rt">Add</a4j:commandLink>
+ <a4j:commandLink
action="#{clientConversationBean.removeChild(node)}" render="rt"
rendered="#{node.removable}">Remove</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>
- <a4j:commandLink
action="#{clientConversationBean.removeChild(node)}"
rerender="richTree" rendered="#{node.removable}">
- Remove
- </a4j:commandLink>
+ <a4j:commandLink name="Load"
action="#{clientConversationBean.lazyLoadChild(node)}" render="rt"
rendered="#{not node.resolved}">Load</a4j:commandLink>
+ <a4j:commandLink
action="#{clientConversationBean.removeChild(node)}" render="rt"
rendered="#{node.removable}">Remove</a4j:commandLink>
</rich:treeNode>
<rich:treeNode type="complex"
expanded="#{node.expanded}">
<h:outputText value="#{node.type} : #{node.name} "
/>
@@ -57,79 +47,67 @@
<f:ajax />
</h:selectBooleanCheckbox>
<h:outputText value=" " />
- <a4j:commandLink
action="#{clientConversationBean.removeChild(node)}"
rerender="richTree" rendered="#{node.removable}">
- Remove
- </a4j:commandLink>
+ <a4j:commandLink
action="#{clientConversationBean.removeChild(node)}" render="rt"
rendered="#{node.removable}">Remove</a4j:commandLink>
</rich:treeNode>
<rich:treeNode type="Parameterized"
expanded="#{node.expanded}">
<h:outputText value="{#{node.namespace}} " />
<h:selectBooleanCheckbox value="#{node.notNil}"
disabled="true" />
</rich:treeNode>
<rich:treeNode type="XMLGregorianCalendar">
- <h:outputText value="#{node.type} : #{node.name}
" styleClass="tipoCampo" />
- <h:selectBooleanCheckbox id="foo2-chk"
value="#{node.notNil}" disabled="#{node.notNillable}" >
+ <h:outputText value="#{node.type} : #{node.name} "
styleClass="tipoCampo" />
+ <h:selectBooleanCheckbox id="n2_cb"
value="#{node.notNil}" disabled="#{node.notNillable}" >
<f:ajax />
</h:selectBooleanCheckbox>
- <rich:calendar id="foo2"
value="#{node.valueDate}" popup="true" showInput="true"
enableManualInput="false" >
- <f:ajax event="change" render="foo2-chk"
listener="#{clientConversationBean.onInputFocus(node)}" />
+ <rich:calendar id="n2"
value="#{node.valueDate}" popup="true" showInput="true"
enableManualInput="false" >
+ <f:ajax event="change" render="n2_cb"
listener="#{clientConversationBean.onInputFocus(node)}" />
</rich:calendar>
- <a4j:commandLink
action="#{clientConversationBean.removeChild(node)}"
rerender="richTree" rendered="#{node.removable}">
- Remove
- </a4j:commandLink>
+ <a4j:commandLink
action="#{clientConversationBean.removeChild(node)}" render="rt"
rendered="#{node.removable}">Remove</a4j:commandLink>
</rich:treeNode>
<rich:treeNode type="Duration">
<h:outputText value="#{node.type} : #{node.name} "
styleClass="tipoCampo" />
- <h:selectBooleanCheckbox id="foo3-chk"
value="#{node.notNil}" disabled="#{node.notNillable}" >
+ <h:selectBooleanCheckbox id="n3_cb"
value="#{node.notNil}" disabled="#{node.notNillable}" >
<f:ajax />
</h:selectBooleanCheckbox>
- <h:inputText id="foo3"
value="#{node.value}">
- <f:ajax event="valueChange"
render="foo3-chk"
listener="#{clientConversationBean.onInputFocus(node)}" />
+ <h:inputText id="n3"
value="#{node.value}">
+ <f:ajax event="valueChange" render="n3_cb"
listener="#{clientConversationBean.onInputFocus(node)}" />
</h:inputText>
<h:outputText value="(MilliSeconds)"
target="_blank" />
<h:outputText value=" " />
- <a4j:commandLink
action="#{clientConversationBean.removeChild(node)}"
rerender="richTree" rendered="#{node.removable}">
- Remove
- </a4j:commandLink>
+ <a4j:commandLink
action="#{clientConversationBean.removeChild(node)}" render="rt"
rendered="#{node.removable}">Remove</a4j:commandLink>
</rich:treeNode>
<rich:treeNode type="qname">
<h:outputText value="#{node.type} : #{node.name} "
styleClass="tipoCampo" />
- <h:selectBooleanCheckbox id="foo4-chk"
value="#{node.notNil}" disabled="#{node.notNillable}" >
+ <h:selectBooleanCheckbox id="n4_cb"
value="#{node.notNil}" disabled="#{node.notNillable}" >
<f:ajax />
</h:selectBooleanCheckbox>
- <h:inputText id="foo4"
value="#{node.nameSpace}">
- <f:ajax event="valueChange"
render="foo4-chk"
listener="#{clientConversationBean.onInputFocus(node)}" />
+ <h:inputText id="n4"
value="#{node.nameSpace}">
+ <f:ajax event="valueChange" render="n4_cb"
listener="#{clientConversationBean.onInputFocus(node)}" />
</h:inputText>
<h:outputText value=" : " />
<h:inputText value="#{node.localPart}" />
<h:outputText value=" " />
- <a4j:commandLink
action="#{clientConversationBean.removeChild(node)}"
rerender="richTree" rendered="#{node.removable}">
- Remove
- </a4j:commandLink>
+ <a4j:commandLink
action="#{clientConversationBean.removeChild(node)}" render="rt"
rendered="#{node.removable}">Remove</a4j:commandLink>
</rich:treeNode>
<rich:treeNode type="Enumeration">
<h:outputText value="#{node.type} : #{node.name} "
styleClass="tipoCampo" />
- <h:selectBooleanCheckbox id="foo5-chk"
value="#{node.notNil}" disabled="#{node.notNillable}" >
+ <h:selectBooleanCheckbox id="n5_cb"
value="#{node.notNil}" disabled="#{node.notNillable}" >
<f:ajax />
</h:selectBooleanCheckbox>
- <h:selectOneMenu id="foo5"
value="#{node.value}" onfocus="document.getElementById(this.id +
'-chk').checked=true">
+ <h:selectOneMenu id="n5"
value="#{node.value}" onfocus="document.getElementById(this.id +
'_cb').checked=true">
<f:selectItems value="#{node.validValue}" />
</h:selectOneMenu>
<h:outputText value=" " />
- <a4j:commandLink
action="#{clientConversationBean.removeChild(node)}"
rerender="richTree" rendered="#{node.removable}">
- Remove
- </a4j:commandLink>
+ <a4j:commandLink
action="#{clientConversationBean.removeChild(node)}" render="rt"
rendered="#{node.removable}">Remove</a4j:commandLink>
</rich:treeNode>
<rich:treeNode type="byteArray">
<h:outputText value="#{node.type} : #{node.name} "
/>
- <h:selectBooleanCheckbox id="foo6-chk"
value="#{node.notNil}" disabled="#{node.notNillable}" >
+ <h:selectBooleanCheckbox id="n6_cb"
value="#{node.notNil}" disabled="#{node.notNillable}" >
<f:ajax />
</h:selectBooleanCheckbox>
- <h:inputText value="#{node.value}" id="foo6"
>
- <f:ajax event="valueChange"
render="foo6-chk"
listener="#{clientConversationBean.onInputFocus(node)}" />
+ <h:inputText value="#{node.value}" id="n6"
>
+ <f:ajax event="valueChange" render="n6_cb"
listener="#{clientConversationBean.onInputFocus(node)}" />
</h:inputText>
- <a4j:commandLink
action="#{clientConversationBean.removeChild(node)}"
rerender="richTree" rendered="#{node.removable}">
- Remove
- </a4j:commandLink>
+ <a4j:commandLink
action="#{clientConversationBean.removeChild(node)}" render="rt"
rendered="#{node.removable}">Remove</a4j:commandLink>
</rich:treeNode>
</rich:tree>
</a4j:outputPanel>