JBoss Rich Faces SVN: r1178 - trunk/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: vkorluzhenko
Date: 2007-06-14 07:27:14 -0400 (Thu, 14 Jun 2007)
New Revision: 1178
Modified:
trunk/docs/userguide/en/src/main/docbook/included/dataFilterSlider.xml
trunk/docs/userguide/en/src/main/docbook/included/dataTable.xml
trunk/docs/userguide/en/src/main/docbook/included/datascroller.xml
trunk/docs/userguide/en/src/main/docbook/included/dragIndicator.xml
trunk/docs/userguide/en/src/main/docbook/included/dragSupport.xml
trunk/docs/userguide/en/src/main/docbook/included/dropDownMenu.xml
trunk/docs/userguide/en/src/main/docbook/included/dropSupport.xml
trunk/docs/userguide/en/src/main/docbook/included/gmap.xml
trunk/docs/userguide/en/src/main/docbook/included/inputNumberSlider.xml
trunk/docs/userguide/en/src/main/docbook/included/inputNumberSpinner.xml
trunk/docs/userguide/en/src/main/docbook/included/modalPanel.xml
trunk/docs/userguide/en/src/main/docbook/included/paint2D.xml
trunk/docs/userguide/en/src/main/docbook/included/panel.xml
trunk/docs/userguide/en/src/main/docbook/included/panelBar.xml
trunk/docs/userguide/en/src/main/docbook/included/separator.xml
trunk/docs/userguide/en/src/main/docbook/included/simpleTogglePanel.xml
trunk/docs/userguide/en/src/main/docbook/included/spacer.xml
trunk/docs/userguide/en/src/main/docbook/included/suggestionBox.xml
trunk/docs/userguide/en/src/main/docbook/included/tabPanel.xml
trunk/docs/userguide/en/src/main/docbook/included/togglePanel.xml
trunk/docs/userguide/en/src/main/docbook/included/toolBar.xml
trunk/docs/userguide/en/src/main/docbook/included/tree.xml
Log:
added links to examples
Modified: trunk/docs/userguide/en/src/main/docbook/included/dataFilterSlider.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/dataFilterSlider.xml 2007-06-14 11:25:07 UTC (rev 1177)
+++ trunk/docs/userguide/en/src/main/docbook/included/dataFilterSlider.xml 2007-06-14 11:27:14 UTC (rev 1178)
@@ -103,5 +103,8 @@
the <emphasis role="italic"><property>"onSlide"</property></emphasis> attribute
(<emphasis role="italic"><property>"onChange"</property></emphasis> is its alias). When
the attribute definition = true, submission on this event is defined.</para>
+ <para>
+ <ulink url="http://livedemo.exadel.com/richfaces-demo/richfaces/dataFilterSlider.jsf?...">Here</ulink> you can see the example of <rich:dataFilterSlider> usage and sources for the given example.
+ </para>
</section>
</section>
\ No newline at end of file
Modified: trunk/docs/userguide/en/src/main/docbook/included/dataTable.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/dataTable.xml 2007-06-14 11:25:07 UTC (rev 1177)
+++ trunk/docs/userguide/en/src/main/docbook/included/dataTable.xml 2007-06-14 11:27:14 UTC (rev 1178)
@@ -87,6 +87,9 @@
lot's of ajaxKeys with strings indices that are to be updated. A resulting output on the client
contains only required strings and they are updated in the tree, even when update is specified for
the whole table.</para>
+ <para>
+ <ulink url="http://livedemo.exadel.com/richfaces-demo/richfaces/dataTable.jsf?c=dataT...">Here</ulink> you can see the example of <rich:dataTable> usage and sources for the given example.
+ </para>
</section>
<section>
<title>Look-and-Feel Customization</title>
Modified: trunk/docs/userguide/en/src/main/docbook/included/datascroller.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/datascroller.xml 2007-06-14 11:25:07 UTC (rev 1177)
+++ trunk/docs/userguide/en/src/main/docbook/included/datascroller.xml 2007-06-14 11:27:14 UTC (rev 1178)
@@ -106,6 +106,9 @@
<para>The screenshot shows one controller from each group.</para>
<para>For the <property>"fastforward"</property>/<property>"rewind"</property> controls customization the additional <emphasis role="italic"><property>"fastStep"</property></emphasis> attribute is used.
The attribute indicates pages quantity to switch onto when fast scrolling is used. </para>
+ <para>
+ <ulink url="http://livedemo.exadel.com/richfaces-demo/richfaces/dataTableScroller.jsf...">Here</ulink> you can see the example of <rich:dataScroller> usage and sources for the given example.
+ </para>
</section>
<section>
<title>Look-and-Feel Customization</title>
Modified: trunk/docs/userguide/en/src/main/docbook/included/dragIndicator.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/dragIndicator.xml 2007-06-14 11:25:07 UTC (rev 1177)
+++ trunk/docs/userguide/en/src/main/docbook/included/dragIndicator.xml 2007-06-14 11:27:14 UTC (rev 1178)
@@ -133,6 +133,9 @@
textDragged type. An icon is redefined for iconsDragged with the help of the drop zone
<emphasis role="italic"><property>"typeMapping"</property></emphasis> attribute
defined with the <emphasis role="bold"><property><rich:dndParam></property></emphasis>component.</para>
+ <para>
+ <ulink url="http://livedemo.exadel.com/richfaces-demo/richfaces/dragSupport.jsf?c=dra...">Here</ulink> you can see the example of <rich:dragIndicator> usage and sources for the given example.
+ </para>
</section>
</section>
</section>
\ No newline at end of file
Modified: trunk/docs/userguide/en/src/main/docbook/included/dragSupport.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/dragSupport.xml 2007-06-14 11:25:07 UTC (rev 1177)
+++ trunk/docs/userguide/en/src/main/docbook/included/dragSupport.xml 2007-06-14 11:27:14 UTC (rev 1178)
@@ -180,6 +180,9 @@
<para>Developers can use their own custom JavaScript functions to handle
these events.</para>
+ <para>
+ <ulink url="http://livedemo.exadel.com/richfaces-demo/richfaces/dragSupport.jsf?c=dra...">Here</ulink> you can see the example of <rich:dragSupport> usage and sources for the given example.
+ </para>
</section>
<section>
Modified: trunk/docs/userguide/en/src/main/docbook/included/dropDownMenu.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/dropDownMenu.xml 2007-06-14 11:25:07 UTC (rev 1177)
+++ trunk/docs/userguide/en/src/main/docbook/included/dropDownMenu.xml 2007-06-14 11:27:14 UTC (rev 1178)
@@ -238,6 +238,9 @@
</imageobject>
</mediaobject>
</figure>
+ <para>
+ <ulink url="http://livedemo.exadel.com/richfaces-demo/richfaces/dropDownMenu.jsf?c=dr...">Here</ulink> you can see the example of <rich:dropDownMenu> usage and sources for the given example.
+ </para>
</section>
<section>
Modified: trunk/docs/userguide/en/src/main/docbook/included/dropSupport.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/dropSupport.xml 2007-06-14 11:25:07 UTC (rev 1177)
+++ trunk/docs/userguide/en/src/main/docbook/included/dropSupport.xml 2007-06-14 11:27:14 UTC (rev 1178)
@@ -218,6 +218,9 @@
<para>Developers can use their own custom JavaScript functions to handle
these events.</para>
+ <para>
+ <ulink url="http://livedemo.exadel.com/richfaces-demo/richfaces/dragSupport.jsf?c=dro...">Here</ulink> you can see the example of <rich:dropSupport> usage and sources for the given example.
+ </para>
</section>
<section>
Modified: trunk/docs/userguide/en/src/main/docbook/included/gmap.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/gmap.xml 2007-06-14 11:25:07 UTC (rev 1177)
+++ trunk/docs/userguide/en/src/main/docbook/included/gmap.xml 2007-06-14 11:27:14 UTC (rev 1178)
@@ -142,8 +142,11 @@
<listitem>
etc.
</listitem>
- </itemizedlist>
- </section>
+ </itemizedlist>
+ <para>
+ <ulink url="http://livedemo.exadel.com/richfaces-demo/richfaces/gmap.jsf?c=gmap">Here</ulink> you can see the example of <rich:gmap> usage and sources for the given example.
+ </para>
+ </section>
<section>
<title>Look-and-Feel Customization</title>
<para><property>Gmap</property> component isn't tied to skin parameters, as there is no
Modified: trunk/docs/userguide/en/src/main/docbook/included/inputNumberSlider.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/inputNumberSlider.xml 2007-06-14 11:25:07 UTC (rev 1177)
+++ trunk/docs/userguide/en/src/main/docbook/included/inputNumberSlider.xml 2007-06-14 11:27:14 UTC (rev 1178)
@@ -124,7 +124,10 @@
<listitem>
etc.
</listitem>
- </itemizedlist>
+ </itemizedlist>
+ <para>
+ <ulink url="http://livedemo.exadel.com/richfaces-demo/richfaces/inputNumberSlider.jsf...">Here</ulink> you can see the example of <rich:inputNumberSlider> usage and sources for the given example.
+ </para>
</section>
<section>
<title>Look-and-Feel Customization</title>
Modified: trunk/docs/userguide/en/src/main/docbook/included/inputNumberSpinner.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/inputNumberSpinner.xml 2007-06-14 11:25:07 UTC (rev 1177)
+++ trunk/docs/userguide/en/src/main/docbook/included/inputNumberSpinner.xml 2007-06-14 11:27:14 UTC (rev 1178)
@@ -115,7 +115,10 @@
<listitem>
etc.
</listitem>
- </itemizedlist>
+ </itemizedlist>
+ <para>
+ <ulink url="http://livedemo.exadel.com/richfaces-demo/richfaces/inputNumberSpinner.js...">Here</ulink> you can see the example of <rich:inputNumberSpinner> usage and sources for the given example.
+ </para>
</section>
<section>
<title>Look-and-Feel Customization</title>
Modified: trunk/docs/userguide/en/src/main/docbook/included/modalPanel.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/modalPanel.xml 2007-06-14 11:25:07 UTC (rev 1177)
+++ trunk/docs/userguide/en/src/main/docbook/included/modalPanel.xml 2007-06-14 11:27:14 UTC (rev 1178)
@@ -217,7 +217,9 @@
handling in such a way that your own parameters could also be obtained: </para>
<programlisting role="JAVA">onshow="alert(event.parameters.param1)"</programlisting>
<para> Here, during modalPanel opening the value of a passing parameter is output. </para>
-
+ <para>
+ <ulink url="http://livedemo.exadel.com/richfaces-demo/richfaces/modalPanel.jsf?c=moda...">Here</ulink> you can see the example of <rich:modalPanel> usage and sources for the given example.
+ </para>
</section>
<section>
Modified: trunk/docs/userguide/en/src/main/docbook/included/paint2D.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/paint2D.xml 2007-06-14 11:25:07 UTC (rev 1177)
+++ trunk/docs/userguide/en/src/main/docbook/included/paint2D.xml 2007-06-14 11:27:14 UTC (rev 1178)
@@ -121,6 +121,9 @@
<rich:paint2D paint="#{paint2D.paint}" data="#{paint2DModel.data}"/>
...
]]></programlisting>
+ <para>
+ <ulink url="http://livedemo.exadel.com/richfaces-demo/richfaces/paint2D.jsf?c=paint2d">Here</ulink> you can see the example of <rich:paint2D> usage and sources for the given example.
+ </para>
</section>
<section>
Modified: trunk/docs/userguide/en/src/main/docbook/included/panel.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/panel.xml 2007-06-14 11:25:07 UTC (rev 1177)
+++ trunk/docs/userguide/en/src/main/docbook/included/panel.xml 2007-06-14 11:27:14 UTC (rev 1178)
@@ -139,7 +139,10 @@
<listitem>
etc.
</listitem>
- </itemizedlist>
+ </itemizedlist>
+ <para>
+ <ulink url="http://livedemo.exadel.com/richfaces-demo/richfaces/panel.jsf?c=panel">Here</ulink> you can see the example of <rich:panel> usage and sources for the given example.
+ </para>
</section>
<section>
<title>Look-and-Feel Customization</title>
Modified: trunk/docs/userguide/en/src/main/docbook/included/panelBar.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/panelBar.xml 2007-06-14 11:25:07 UTC (rev 1177)
+++ trunk/docs/userguide/en/src/main/docbook/included/panelBar.xml 2007-06-14 11:27:14 UTC (rev 1178)
@@ -77,6 +77,9 @@
role="italic"><property>"height"</property></emphasis> (both are 100% on default) attributes stand apart.</para>
<para>Style attributes are described further.</para>
<para><property>panelBar</property> could contain any number of child <property>panelBarItem</property> components inside, which content is uploaded onto the client and headers are controls to open the corresponding child element.</para>
+ <para>
+ <ulink url="http://livedemo.exadel.com/richfaces-demo/richfaces/panelBar.jsf?c=panelBar">Here</ulink> you can see the example of <rich:panelBar> usage and sources for the given example.
+ </para>
</section>
<section>
<title>Look-and-Feel Customization</title>
Modified: trunk/docs/userguide/en/src/main/docbook/included/separator.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/separator.xml 2007-06-14 11:25:07 UTC (rev 1177)
+++ trunk/docs/userguide/en/src/main/docbook/included/separator.xml 2007-06-14 11:27:14 UTC (rev 1178)
@@ -94,7 +94,10 @@
<listitem>
etc.
</listitem>
- </itemizedlist>
+ </itemizedlist>
+ <para>
+ <ulink url="http://livedemo.exadel.com/richfaces-demo/richfaces/separator.jsf?c=separ...">Here</ulink> you can see the example of <rich:separator> usage and sources for the given example.
+ </para>
</section>
<section>
<title>Look-and-Feel Customization</title>
Modified: trunk/docs/userguide/en/src/main/docbook/included/simpleTogglePanel.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/simpleTogglePanel.xml 2007-06-14 11:25:07 UTC (rev 1177)
+++ trunk/docs/userguide/en/src/main/docbook/included/simpleTogglePanel.xml 2007-06-14 11:27:14 UTC (rev 1178)
@@ -110,6 +110,9 @@
</imageobject>
</mediaobject>
</figure>
+ <para>
+ <ulink url="http://livedemo.exadel.com/richfaces-demo/richfaces/simpleTogglePanel.jsf...">Here</ulink> you can see the example of <rich:simpleTogglePanel> usage and sources for the given example.
+ </para>
</section>
<section>
<title>Look-and-Feel Customization</title>
Modified: trunk/docs/userguide/en/src/main/docbook/included/spacer.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/spacer.xml 2007-06-14 11:25:07 UTC (rev 1177)
+++ trunk/docs/userguide/en/src/main/docbook/included/spacer.xml 2007-06-14 11:27:14 UTC (rev 1178)
@@ -78,7 +78,10 @@
<listitem>
etc.
</listitem>
- </itemizedlist>
+ </itemizedlist>
+ <para>
+ <ulink url="http://livedemo.exadel.com/richfaces-demo/richfaces/spacer.jsf?c=spacer">Here</ulink> you can see the example of <rich:spacer> usage and sources for the given example.
+ </para>
</section>
<section>
<title>Look-and-Feel Customization</title>
Modified: trunk/docs/userguide/en/src/main/docbook/included/suggestionBox.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/suggestionBox.xml 2007-06-14 11:25:07 UTC (rev 1177)
+++ trunk/docs/userguide/en/src/main/docbook/included/suggestionBox.xml 2007-06-14 11:27:14 UTC (rev 1178)
@@ -153,5 +153,9 @@
<para>In addition to these attributes common for AJAX action components and limiting requests
quantity and frequency, <property>suggestionBox</property> has one more its own attribute limiting
requests (the <emphasis role="italic"><property>"minChars"</property></emphasis> attribute). The attribute defines characters quantity inputted into a field after which AJAX requests are called to perform suggestion.</para>
+ <para>
+ <ulink url="http://livedemo.exadel.com/richfaces-demo/richfaces/suggestionBox.jsf?c=s...">Here</ulink> you can see the example of <rich:suggestionBox> usage and sources for the given example.
+ </para>
+
</section>
</section>
\ No newline at end of file
Modified: trunk/docs/userguide/en/src/main/docbook/included/tabPanel.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/tabPanel.xml 2007-06-14 11:25:07 UTC (rev 1177)
+++ trunk/docs/userguide/en/src/main/docbook/included/tabPanel.xml 2007-06-14 11:27:14 UTC (rev 1178)
@@ -136,7 +136,10 @@
<listitem>
etc.
</listitem>
- </itemizedlist>
+</itemizedlist>
+ <para>
+ <ulink url="http://livedemo.exadel.com/richfaces-demo/richfaces/tabPanel.jsf?c=tabPanel">Here</ulink> you can see the example of <rich:tabPanel> usage and sources for the given example.
+ </para>
</section>
<section>
<title>Look-and-Feel Customization</title>
@@ -149,7 +152,8 @@
<listitem>to redefine corresponding skin parameters</listitem>
<listitem>to add <emphasis
role="italic"><property>style classes</property></emphasis> used by the tabPanel to your page stylesheets</listitem>
- </itemizedlist>
+ </itemizedlist>
+
</section>
<section>
<title>Definition custom style classes:</title>
Modified: trunk/docs/userguide/en/src/main/docbook/included/togglePanel.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/togglePanel.xml 2007-06-14 11:25:07 UTC (rev 1177)
+++ trunk/docs/userguide/en/src/main/docbook/included/togglePanel.xml 2007-06-14 11:27:14 UTC (rev 1178)
@@ -121,6 +121,9 @@
...
]]></programlisting>
<para>The example shows a <property>togglePanel</property> initial state when the second facet (panelB) is rendered and successive switching from the first to the second happens.</para>
+ <para>
+ <ulink url="http://livedemo.exadel.com/richfaces-demo/richfaces/togglePanel.jsf?c=tog...">Here</ulink> you can see the example of <rich:togglePanel> usage and sources for the given example.
+ </para>
</section>
<section>
<title>Look-and-Feel Customization</title>
Modified: trunk/docs/userguide/en/src/main/docbook/included/toolBar.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/toolBar.xml 2007-06-14 11:25:07 UTC (rev 1177)
+++ trunk/docs/userguide/en/src/main/docbook/included/toolBar.xml 2007-06-14 11:27:14 UTC (rev 1178)
@@ -98,6 +98,9 @@
<para>Moreover, for <property>toolBar</property> style
<emphasis role="italic"><property>"width"</property></emphasis> and <emphasis role="italic"><property>"height"</property></emphasis> attributes
are placed above all.</para>
+ <para>
+ <ulink url="http://livedemo.exadel.com/richfaces-demo/richfaces/toolBar.jsf?c=toolBar">Here</ulink> you can see the example of <rich:toolBar> usage and sources for the given example.
+ </para>
</section>
<section>
<title>Look-and-Feel Customization</title>
Modified: trunk/docs/userguide/en/src/main/docbook/included/tree.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/tree.xml 2007-06-14 11:25:07 UTC (rev 1177)
+++ trunk/docs/userguide/en/src/main/docbook/included/tree.xml 2007-06-14 11:27:14 UTC (rev 1178)
@@ -132,7 +132,10 @@
...
</rich:tree>
...
- ]]></programlisting></para>
+]]></programlisting></para>
+ <para>
+ <ulink url="http://livedemo.exadel.com/richfaces-demo/richfaces/tree.jsf?c=tree">Here</ulink> you can see the example of <rich:tree> usage and sources for the given example.
+ </para>
</section>
<section>
<title>Built-In Drag and Drop</title>
@@ -211,6 +214,8 @@
<listitem>ondragend - drag end event (drop event)</listitem>
<listitem>ondragenter - dragged element appearing on tree event</listitem>
</itemizedlist>
+
+
</section>
<section>
<title>Look-and-Feel Customization</title>
17 years, 7 months
JBoss Rich Faces SVN: r1177 - trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/controls/grid.
by richfaces-svn-commits@lists.jboss.org
Author: maksimkaszynski
Date: 2007-06-14 07:25:07 -0400 (Thu, 14 Jun 2007)
New Revision: 1177
Modified:
trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/controls/grid/GridBody.js
Log:
distroyed cache
Modified: trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/controls/grid/GridBody.js
===================================================================
--- trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/controls/grid/GridBody.js 2007-06-14 09:51:36 UTC (rev 1176)
+++ trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/controls/grid/GridBody.js 2007-06-14 11:25:07 UTC (rev 1177)
@@ -445,7 +445,7 @@
startRow: options.startRow,
switchType: options.switchType
};
- options = this.processCashedValues(options);
+ //options = this.processCashedValues(options);
if(options.count > 0) {
// Make timer to handle quick clicks on scrollbar arrows
setTimeout(function() {
@@ -457,10 +457,10 @@
this.grid.dataModel.loadRows(options);
}.bind(this), 10);
}
- else {
+ /*else {
this.invalidate(opt);
this.updateStarted = false;
- }
+ }*/
}
else {
this.updateStarted = false;
17 years, 7 months
JBoss Rich Faces SVN: r1176 - trunk/sandbox.
by richfaces-svn-commits@lists.jboss.org
Author: sergeyhalipov
Date: 2007-06-14 05:51:36 -0400 (Thu, 14 Jun 2007)
New Revision: 1176
Modified:
trunk/sandbox/pom.xml
Log:
Latest common-collections added to dependences
Modified: trunk/sandbox/pom.xml
===================================================================
--- trunk/sandbox/pom.xml 2007-06-13 18:15:16 UTC (rev 1175)
+++ trunk/sandbox/pom.xml 2007-06-14 09:51:36 UTC (rev 1176)
@@ -248,6 +248,11 @@
<version>2.0</version>
<scope>provided</scope>
</dependency>
+ <dependency>
+ <groupId>commons-collections</groupId>
+ <artifactId>commons-collections</artifactId>
+ <version>3.2</version>
+ </dependency>
</dependencies>
<modules>
<module>scrollable-grid</module>
@@ -256,4 +261,4 @@
<module>panelmenu</module>
<module>calendar</module>
</modules>
-</project>
\ No newline at end of file
+</project>
17 years, 7 months
JBoss Rich Faces SVN: r1174 - trunk/sandbox/panelmenu/src/test/java/org/richfaces/component.
by richfaces-svn-commits@lists.jboss.org
Author: sergeyhalipov
Date: 2007-06-13 13:41:15 -0400 (Wed, 13 Jun 2007)
New Revision: 1174
Added:
trunk/sandbox/panelmenu/src/test/java/org/richfaces/component/PanelMenuComponentTest.java
Removed:
trunk/sandbox/panelmenu/src/test/java/org/richfaces/component/JSFComponentTest.java
Log:
JUnit tests for panel menu.
Deleted: trunk/sandbox/panelmenu/src/test/java/org/richfaces/component/JSFComponentTest.java
===================================================================
--- trunk/sandbox/panelmenu/src/test/java/org/richfaces/component/JSFComponentTest.java 2007-06-13 17:26:01 UTC (rev 1173)
+++ trunk/sandbox/panelmenu/src/test/java/org/richfaces/component/JSFComponentTest.java 2007-06-13 17:41:15 UTC (rev 1174)
@@ -1,32 +0,0 @@
-package org.richfaces.component;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-import javax.faces.component.UIComponent;
-
-/**
- * Unit test for simple Component.
- */
-public class JSFComponentTest
- extends TestCase
-{
- /**
- * Create the test case
- *
- * @param testName name of the test case
- */
- public JSFComponentTest( String testName )
- {
- super( testName );
- }
-
-
- /**
- * Rigourous Test :-)
- */
- public void testComponent()
- {
- assertTrue( true );
- }
-}
Copied: trunk/sandbox/panelmenu/src/test/java/org/richfaces/component/PanelMenuComponentTest.java (from rev 1149, trunk/sandbox/panelmenu/src/test/java/org/richfaces/component/JSFComponentTest.java)
===================================================================
--- trunk/sandbox/panelmenu/src/test/java/org/richfaces/component/PanelMenuComponentTest.java (rev 0)
+++ trunk/sandbox/panelmenu/src/test/java/org/richfaces/component/PanelMenuComponentTest.java 2007-06-13 17:41:15 UTC (rev 1174)
@@ -0,0 +1,297 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces 3.0 - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.component;
+
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
+import javax.faces.component.UIForm;
+import javax.faces.component.html.HtmlForm;
+import javax.servlet.http.HttpServletResponse;
+
+import org.ajax4jsf.framework.resource.InternetResource;
+import org.ajax4jsf.framework.resource.InternetResourceBuilder;
+import org.ajax4jsf.framework.resource.ResourceBuilderImpl;
+import org.ajax4jsf.framework.util.image.ImageInfo;
+import org.ajax4jsf.tests.AbstractAjax4JsfTestCase;
+import org.apache.commons.lang.StringUtils;
+import org.richfaces.component.UIPanelMenu;
+import org.richfaces.component.UIPanelMenuGroup;
+import org.richfaces.component.UIPanelMenuItem;
+
+import com.gargoylesoftware.htmlunit.Page;
+import com.gargoylesoftware.htmlunit.html.HtmlElement;
+import com.gargoylesoftware.htmlunit.html.HtmlPage;
+import com.gargoylesoftware.htmlunit.html.HtmlScript;
+
+/**
+ * Unit test for simple Component.
+ */
+public class PanelMenuComponentTest extends AbstractAjax4JsfTestCase {
+ private static Set javaScripts = new HashSet();
+
+ private String[] imageResources = new String[]{
+ "org.richfaces.renderkit.html.iconimages.PanelMenuIconChevron",
+ "org.richfaces.renderkit.html.iconimages.PanelMenuIconChevronDown",
+ "org.richfaces.renderkit.html.iconimages.PanelMenuIconChevronUp",
+ "org.richfaces.renderkit.html.iconimages.PanelMenuIconDisc",
+ "org.richfaces.renderkit.html.iconimages.PanelMenuIconGrid",
+ "org.richfaces.renderkit.html.iconimages.PanelMenuIconSpacer",
+ "org.richfaces.renderkit.html.iconimages.PanelMenuIconTriangle",
+ "org.richfaces.renderkit.html.iconimages.PanelMenuIconTriangleDown",
+ "org.richfaces.renderkit.html.iconimages.PanelMenuIconTriangleUp"
+ };
+
+ static {
+ javaScripts.add("org.ajax4jsf.framework.ajax.AjaxScript");
+ javaScripts.add("org.ajax4jsf.framework.resource.PrototypeScript");
+ javaScripts.add("org/richfaces/renderkit/html/scripts/utils.js");
+ javaScripts.add("org/richfaces/renderkit/html/scripts/panelMenu.js");
+ }
+
+ /**
+ * Create the test case
+ *
+ * @param testName name of the test case
+ */
+ public PanelMenuComponentTest( String testName )
+ {
+ super( testName );
+ }
+
+ private UIForm form;
+ private UIPanelMenu panelMenu;
+ private UIPanelMenuGroup group1;
+ private UIPanelMenuGroup group2;
+ private UIPanelMenuItem item1;
+ private UIPanelMenuItem item2;
+
+ public void setUp() throws Exception {
+ super.setUp();
+
+ application.addComponent("org.richfaces.panelMenu", "org.richfaces.component.html.HtmlPanelMenu");
+ application.addComponent("org.richfaces.panelMenuGroup", "org.richfaces.component.html.HtmlPanelMenuGroup");
+ application.addComponent("org.richfaces.panelMenuItem", "org.richfaces.component.html.HtmlPanelMenuItem");
+
+ form = new HtmlForm();
+ form.setId("form");
+ facesContext.getViewRoot().getChildren().add(form);
+
+ panelMenu = (UIPanelMenu)application.createComponent("org.richfaces.panelMenu");
+ panelMenu.setId("panelMenu");
+ form.getChildren().add(panelMenu);
+
+ group1 = (UIPanelMenuGroup)application.createComponent("org.richfaces.panelMenuGroup");
+ group1.setId("group1");
+ group1.setDisabled(true);
+ panelMenu.getChildren().add(group1);
+
+ group2 = (UIPanelMenuGroup)application.createComponent("org.richfaces.panelMenuGroup");
+ group2.setId("group2");
+ panelMenu.getChildren().add(group2);
+
+ item1 = (UIPanelMenuItem)application.createComponent("org.richfaces.panelMenuItem");
+ item1.setId("item1");
+ group1.getChildren().add(item1);
+
+ item2 = (UIPanelMenuItem)application.createComponent("org.richfaces.panelMenuItem");
+ item2.setId("item2");
+ item2.setDisabled(true);
+ group2.getChildren().add(item2);
+
+ // Items for testing standard icons.
+ UIPanelMenuItem item = (UIPanelMenuItem)application.createComponent("org.richfaces.panelMenuItem");
+ item.setIcon("triangle");
+ group2.getChildren().add(item);
+
+ item = (UIPanelMenuItem)application.createComponent("org.richfaces.panelMenuItem");
+ item.setIcon("spacer");
+ group2.getChildren().add(item);
+
+ item = (UIPanelMenuItem)application.createComponent("org.richfaces.panelMenuItem");
+ item.setIcon("triangleDown");
+ group2.getChildren().add(item);
+
+ item = (UIPanelMenuItem)application.createComponent("org.richfaces.panelMenuItem");
+ item.setIcon("triangleUp");
+ group2.getChildren().add(item);
+
+ item = (UIPanelMenuItem)application.createComponent("org.richfaces.panelMenuItem");
+ item.setIcon("chevron");
+ group2.getChildren().add(item);
+
+ item = (UIPanelMenuItem)application.createComponent("org.richfaces.panelMenuItem");
+ item.setIcon("chevronUp");
+ group2.getChildren().add(item);
+
+ item = (UIPanelMenuItem)application.createComponent("org.richfaces.panelMenuItem");
+ item.setIcon("chevronDown");
+ group2.getChildren().add(item);
+
+ item = (UIPanelMenuItem)application.createComponent("org.richfaces.panelMenuItem");
+ item.setIcon("disc");
+ group2.getChildren().add(item);
+
+ item = (UIPanelMenuItem)application.createComponent("org.richfaces.panelMenuItem");
+ item.setIcon("grid");
+ group2.getChildren().add(item);
+
+ }
+
+ public void tearDown() throws Exception {
+ super.tearDown();
+
+ item1 = null;
+ item2 = null;
+ group1 = null;
+ group2 = null;
+ form = null;
+ }
+
+ /**
+ * Test component rendering
+ *
+ * @throws Exception
+ */
+ public void testRender() throws Exception {
+ HtmlPage page = renderView();
+ assertNotNull(page);
+ System.out.println(page.asXml());
+
+ HtmlElement table = page.getHtmlElementById(panelMenu.getClientId(facesContext));
+ assertNotNull(table);
+ assertEquals("table", table.getNodeName());
+
+ HtmlElement firstGroupHide = page.getHtmlElementById("tablehide" + group1.getClientId(facesContext));
+ assertNotNull(firstGroupHide);
+ assertEquals("table", firstGroupHide.getNodeName());
+
+ String styleClass = firstGroupHide.getAttributeValue("class");
+ assertTrue(styleClass.contains("dr-pmenu-group"));
+ assertTrue(styleClass.contains("rich-pmenu-group"));
+ assertTrue(styleClass.contains("rich-pmenu-disabled-element"));
+
+ HtmlElement leftIcon = page.getHtmlElementById("leftIcon" + group1.getClientId(facesContext));
+ assertNotNull(leftIcon);
+ assertEquals("td", leftIcon.getNodeName());
+
+ HtmlElement rightIcon = page.getHtmlElementById("rightIcon" + group1.getClientId(facesContext));
+ assertNotNull(rightIcon);
+ assertEquals("td", rightIcon.getNodeName());
+
+ HtmlElement firstItemHide = page.getHtmlElementById("tablehide" + item1.getClientId(facesContext));
+ assertNotNull(firstItemHide);
+ assertEquals("table", firstItemHide.getNodeName());
+
+ styleClass = firstItemHide.getAttributeValue("class");
+ assertTrue(styleClass.contains("dr-pmenu-item"));
+ assertTrue(styleClass.contains("rich-pmenu-item"));
+
+ leftIcon = page.getHtmlElementById("leftIcon" + item1.getClientId(facesContext));
+ assertNotNull(leftIcon);
+ assertEquals("td", leftIcon.getNodeName());
+
+ rightIcon = page.getHtmlElementById("rightIcon" + item1.getClientId(facesContext));
+ assertNotNull(rightIcon);
+ assertEquals("td", rightIcon.getNodeName());
+
+ HtmlElement secondItemHide = page.getHtmlElementById("tablehide" + item2.getClientId(facesContext));
+ assertNotNull(secondItemHide);
+ assertEquals("table", secondItemHide.getNodeName());
+
+ styleClass = secondItemHide.getAttributeValue("class");
+ assertTrue(styleClass.contains("rich-pmenu-disabled-element"));
+ }
+
+ /**
+ * Test style rendering
+ *
+ * @throws Exception
+ */
+ public void testRenderStyle() throws Exception {
+ HtmlPage view = renderView();
+ assertNotNull(view);
+ List links = view.getDocumentElement().getHtmlElementsByTagName("link");
+ assertEquals(1, links.size());
+ HtmlElement link = (HtmlElement) links.get(0);
+ assertTrue(link.getAttributeValue("href").contains("css/panelMenu.xcss"));
+
+ InternetResourceBuilder builder = ResourceBuilderImpl.getInstance();
+ InternetResource resource = builder.getResource("org/richfaces/renderkit/html/css/panelMenu.xcss");
+ assertNotNull(resource);
+ String uri = "http:" + resource.getUri(facesContext, null);
+ Page page = webClient.getPage(uri);
+ assertTrue(page.getWebResponse().getStatusCode() == HttpServletResponse.SC_OK);
+ }
+
+ /**
+ * Test script rendering
+ *
+ * @throws Exception
+ */
+ public void testRenderScript() throws Exception {
+ HtmlPage page = renderView();
+ assertNotNull(page);
+ List scripts = page.getDocumentElement().getHtmlElementsByTagName("script");
+ for (Iterator it = scripts.iterator(); it.hasNext();) {
+ HtmlScript item = (HtmlScript) it.next();
+ String srcAttr = item.getSrcAttribute();
+
+ if (StringUtils.isNotBlank(srcAttr)) {
+ boolean found = false;
+ for (Iterator srcIt = javaScripts.iterator(); srcIt.hasNext();)
+ {
+ String src = (String) srcIt.next();
+
+ found = srcAttr.contains(src);
+ if (found) {
+ break;
+ }
+ }
+
+ assertTrue(found);
+ }
+ }
+ }
+
+ public void testRenderImages() throws Exception {
+ HtmlPage view = renderView();
+ assertNotNull(view);
+
+ InternetResourceBuilder builder = ResourceBuilderImpl.getInstance();
+
+ for (int i = 0; i < imageResources.length; i++) {
+ InternetResource resource = builder.getResource(imageResources[i]);
+ assertNotNull(resource);
+ String uri = "http:" + resource.getUri(facesContext, null);
+ Page page = webClient.getPage(uri);
+ assertTrue(page.getWebResponse().getStatusCode() == HttpServletResponse.SC_OK);
+ ImageInfo info = new ImageInfo();
+ info.setInput(page.getWebResponse().getContentAsStream());
+ //image recognizable?
+ assertTrue(info.check());
+ assertEquals(ImageInfo.FORMAT_GIF, info.getFormat());
+ }
+ }
+}
17 years, 7 months
JBoss Rich Faces SVN: r1173 - trunk/sandbox-samples/scrollable-grid-demo/src/main/webapp/WEB-INF.
by richfaces-svn-commits@lists.jboss.org
Author: maksimkaszynski
Date: 2007-06-13 13:26:01 -0400 (Wed, 13 Jun 2007)
New Revision: 1173
Modified:
trunk/sandbox-samples/scrollable-grid-demo/src/main/webapp/WEB-INF/faces-config.xml
Log:
added priority converter
Modified: trunk/sandbox-samples/scrollable-grid-demo/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- trunk/sandbox-samples/scrollable-grid-demo/src/main/webapp/WEB-INF/faces-config.xml 2007-06-13 17:23:02 UTC (rev 1172)
+++ trunk/sandbox-samples/scrollable-grid-demo/src/main/webapp/WEB-INF/faces-config.xml 2007-06-13 17:26:01 UTC (rev 1173)
@@ -263,7 +263,39 @@
</list-entries>
</managed-property>
</managed-bean>
- <lifecycle>
+
+ <managed-bean>
+ <managed-bean-name>PriorityConverter</managed-bean-name>
+ <managed-bean-class>org.richfaces.demo.converters.PriorityConverter</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ <managed-property>
+ <property-name>prioritiesList</property-name>
+ <list-entries>
+ <value>#{priority_blocker}</value>
+ <value>#{priority_critical}</value>
+ <value>#{priority_major}</value>
+ <value>#{priority_minor}</value>
+ <value>#{priority_cosmetic}</value>
+ </list-entries>
+ </managed-property>
+ </managed-bean>
+
+<lifecycle>
<phase-listener>org.richfaces.demo.benchmark.PhaseDemarcationNotifier</phase-listener>
- </lifecycle>
+ </lifecycle>
+
+ <!--
+
+ <converter>
+ <description>converter for issues status</description>
+ <converter-id>status_converter</converter-id>
+ <converter-class>org.richfaces.demo.converters.StatusConverter</converter-class>
+ </converter>
+ <converter>
+ <description>converter for issues priority</description>
+ <converter-id>priority_converter</converter-id>
+ <converter-class>org.richfaces.demo.converters.PriorityConverter</converter-class>
+ </converter>
+ -->
+
</faces-config>
17 years, 7 months
JBoss Rich Faces SVN: r1172 - trunk/sandbox/panelmenu/src/main/resources/org/richfaces/renderkit/html/css.
by richfaces-svn-commits@lists.jboss.org
Author: sergeyhalipov
Date: 2007-06-13 13:23:02 -0400 (Wed, 13 Jun 2007)
New Revision: 1172
Modified:
trunk/sandbox/panelmenu/src/main/resources/org/richfaces/renderkit/html/css/panelMenu.xcss
Log:
Fix some problems with name conversation.
Modified: trunk/sandbox/panelmenu/src/main/resources/org/richfaces/renderkit/html/css/panelMenu.xcss
===================================================================
--- trunk/sandbox/panelmenu/src/main/resources/org/richfaces/renderkit/html/css/panelMenu.xcss 2007-06-13 17:18:32 UTC (rev 1171)
+++ trunk/sandbox/panelmenu/src/main/resources/org/richfaces/renderkit/html/css/panelMenu.xcss 2007-06-13 17:23:02 UTC (rev 1172)
@@ -33,7 +33,7 @@
<u:style name="border-color" skin="panelBorderColor"/>
<u:style name="background-color" skin="headerBackgroundColor"/>
<u:style name="background-image" >
- <f:resource f:key="org.richfaces.renderkit.gradientImages.PanelMenuGroupGradient" />
+ <f:resource f:key="org.richfaces.renderkit.html.gradientimages.PanelMenuGroupGradient" />
</u:style>
</u:selector>
@@ -51,19 +51,19 @@
<u:style name="border-top-style" value="solid"/>
<u:style name="border-color" skin="subBorderColor"/>
<u:style name="background-image" >
- <f:resource f:key="org.richfaces.renderkit.gradientImages.PanelMenuItemGradient" />
+ <f:resource f:key="org.richfaces.renderkit.html.gradientimages.PanelMenuItemGradient" />
</u:style>
</u:selector>
<u:selector name=".dr-pmenu-group-tr">
<u:style name="background-image" >
- <f:resource f:key="org.richfaces.renderkit.gradientImages.PanelMenuGroupGradient" />
+ <f:resource f:key="org.richfaces.renderkit.html.gradientimages.PanelMenuGroupGradient" />
</u:style>
</u:selector>
<u:selector name=".dr-pmenu-item-tr">
<u:style name="background-image" >
- <f:resource f:key="org.richfaces.renderkit.gradientImages.PanelMenuItemGradient" />
+ <f:resource f:key="org.richfaces.renderkit.html.gradientimages.PanelMenuItemGradient" />
</u:style>
</u:selector>
17 years, 7 months
JBoss Rich Faces SVN: r1171 - trunk/sandbox-samples/scrollable-grid-demo/src/main/java/org/richfaces/demo/benchmark.
by richfaces-svn-commits@lists.jboss.org
Author: maksimkaszynski
Date: 2007-06-13 13:18:32 -0400 (Wed, 13 Jun 2007)
New Revision: 1171
Added:
trunk/sandbox-samples/scrollable-grid-demo/src/main/java/org/richfaces/demo/benchmark/PhaseDemarcationNotifier.java
trunk/sandbox-samples/scrollable-grid-demo/src/main/java/org/richfaces/demo/benchmark/RequestBenchMarkFilter.java
Log:
benchmarking filters
Added: trunk/sandbox-samples/scrollable-grid-demo/src/main/java/org/richfaces/demo/benchmark/PhaseDemarcationNotifier.java
===================================================================
--- trunk/sandbox-samples/scrollable-grid-demo/src/main/java/org/richfaces/demo/benchmark/PhaseDemarcationNotifier.java (rev 0)
+++ trunk/sandbox-samples/scrollable-grid-demo/src/main/java/org/richfaces/demo/benchmark/PhaseDemarcationNotifier.java 2007-06-13 17:18:32 UTC (rev 1171)
@@ -0,0 +1,50 @@
+/**
+ *
+ */
+package org.richfaces.demo.benchmark;
+
+import javax.faces.event.PhaseEvent;
+import javax.faces.event.PhaseId;
+import javax.faces.event.PhaseListener;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public class PhaseDemarcationNotifier implements PhaseListener {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 6533052212003582848L;
+ private final Log log = LogFactory.getLog(PhaseDemarcationNotifier.class);
+
+ /* (non-Javadoc)
+ * @see javax.faces.event.PhaseListener#afterPhase(javax.faces.event.PhaseEvent)
+ */
+ public void afterPhase(PhaseEvent event) {
+ if (log.isTraceEnabled()) {
+ log.trace("Phase end " + event.getPhaseId());
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see javax.faces.event.PhaseListener#beforePhase(javax.faces.event.PhaseEvent)
+ */
+ public void beforePhase(PhaseEvent event) {
+ if (log.isTraceEnabled()) {
+ log.trace("Phase start " + event.getPhaseId());
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see javax.faces.event.PhaseListener#getPhaseId()
+ */
+ public PhaseId getPhaseId() {
+ return PhaseId.ANY_PHASE;
+ }
+
+}
Added: trunk/sandbox-samples/scrollable-grid-demo/src/main/java/org/richfaces/demo/benchmark/RequestBenchMarkFilter.java
===================================================================
--- trunk/sandbox-samples/scrollable-grid-demo/src/main/java/org/richfaces/demo/benchmark/RequestBenchMarkFilter.java (rev 0)
+++ trunk/sandbox-samples/scrollable-grid-demo/src/main/java/org/richfaces/demo/benchmark/RequestBenchMarkFilter.java 2007-06-13 17:18:32 UTC (rev 1171)
@@ -0,0 +1,64 @@
+/**
+ *
+ */
+package org.richfaces.demo.benchmark;
+
+import java.io.IOException;
+
+import javax.servlet.Filter;
+import javax.servlet.FilterChain;
+import javax.servlet.FilterConfig;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import javax.servlet.http.HttpServletRequest;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public class RequestBenchMarkFilter implements Filter {
+
+ private Log log = LogFactory.getLog(RequestBenchMarkFilter.class);
+
+ /* (non-Javadoc)
+ * @see javax.servlet.Filter#destroy()
+ */
+ public void destroy() {
+ // TODO Auto-generated method stub
+
+ }
+
+ /* (non-Javadoc)
+ * @see javax.servlet.Filter#doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse, javax.servlet.FilterChain)
+ */
+ public void doFilter(ServletRequest request, ServletResponse response,
+ FilterChain chain) throws IOException, ServletException {
+
+ long startTime = System.currentTimeMillis();
+
+ chain.doFilter(request, response);
+
+ long endTime = System.currentTimeMillis();
+
+
+ log.debug("Request " +
+ ((HttpServletRequest) request).getRequestURL() +
+ "took " +
+ (endTime - startTime) +
+ "ms");
+
+ }
+
+ /* (non-Javadoc)
+ * @see javax.servlet.Filter#init(javax.servlet.FilterConfig)
+ */
+ public void init(FilterConfig arg0) throws ServletException {
+ // TODO Auto-generated method stub
+
+ }
+
+}
17 years, 7 months
JBoss Rich Faces SVN: r1170 - in trunk: sandbox/scrollable-grid/src/main/javascript and 7 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: maksimkaszynski
Date: 2007-06-13 13:18:10 -0400 (Wed, 13 Jun 2007)
New Revision: 1170
Added:
trunk/sandbox-samples/scrollable-grid-demo/src/main/java/org/richfaces/demo/benchmark/
Modified:
trunk/sandbox-samples/scrollable-grid-demo/src/main/java/org/richfaces/demo/datagrid/bean/ChannelDataModel2.java
trunk/sandbox-samples/scrollable-grid-demo/src/main/java/org/richfaces/demo/datagrid/model/Issue.java
trunk/sandbox-samples/scrollable-grid-demo/src/main/webapp/WEB-INF/faces-config.xml
trunk/sandbox-samples/scrollable-grid-demo/src/main/webapp/WEB-INF/web.xml
trunk/sandbox-samples/scrollable-grid-demo/src/main/webapp/pages/scrollable-grid.xhtml
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/DataModelCache.java
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/GridDataModel.java
trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/common/utils/Utils.js
trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/controls/grid/ScrollableGrid.js
trunk/sandbox/scrollable-grid/src/main/javascript/ClientUILib.js
Log:
fixed some bugs with data model
Modified: trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/DataModelCache.java
===================================================================
--- trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/DataModelCache.java 2007-06-13 17:11:30 UTC (rev 1169)
+++ trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/DataModelCache.java 2007-06-13 17:18:10 UTC (rev 1170)
@@ -113,7 +113,12 @@
}
public Object getRowData() {
- return gridDataModel.getRowData();
+ Object secondaryMapped = secondaryMapping.get(getRowKey());
+
+ if (secondaryMapped == null) {
+ secondaryMapped = super.getRowData();
+ }
+ return secondaryMapped;
}
public int getRowIndex() {
@@ -133,7 +138,7 @@
}
public boolean isRowAvailable() {
- return secondaryMapping.containsKey(getRowKey()) || gridDataModel.isRowAvailable();
+ return secondaryMapping.containsKey(getRowKey()) || super.isRowAvailable();
}
public List loadData(int startRow, int endRow, SortOrder sortOrder) {
@@ -154,6 +159,7 @@
public void setRowKey(Object key) {
gridDataModel.setRowKey(key);
+ super.setRowKey(key);
}
public void setWrappedData(Object arg0) {
Modified: trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/GridDataModel.java
===================================================================
--- trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/GridDataModel.java 2007-06-13 17:11:30 UTC (rev 1169)
+++ trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/GridDataModel.java 2007-06-13 17:18:10 UTC (rev 1170)
@@ -4,6 +4,7 @@
package org.richfaces.model;
import java.io.IOException;
+import java.io.Serializable;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -22,12 +23,34 @@
*/
public abstract class GridDataModel extends ExtendedDataModel {
+ private static class SimpleRowKey implements Serializable{
+
+ private static final long serialVersionUID = 1L;
+ private int i;
+
+ public SimpleRowKey(int i) {
+ super();
+ this.i = i;
+ }
+
+ public int intValue() {
+ return i;
+ }
+
+ public String toString() {
+ return String.valueOf(i);
+ }
+ }
+
+
private static final Log log = LogFactory.getLog(GridDataModel.class);
private Object rowKey;
private Map mapping;
+ private SortOrder lastSortOrder;
+
public Object getRowKey() {
return rowKey;
}
@@ -47,20 +70,21 @@
int startIndex = sequenceRange.getFirst();
int last = sequenceRange.getLast();
-
- List objects = loadData(startIndex, last, sequenceRange.getSortOrder());
+ lastSortOrder = sequenceRange.getSortOrder();
+
+ List objects = loadData(startIndex, last, lastSortOrder);
+
mapping = new HashMap();
for (int i = 0; i < objects.size(); i++,startIndex++) {
Object data = objects.get(i);
- Object key = null;
- if (data instanceof Entity) {
- Entity entity = (Entity) data;
- key = entity.getId();
- } else {
- key = new Integer(startIndex);
+ Object key = getId(data);
+
+ if (key == null) {
+ key = new SimpleRowKey(startIndex);
}
+
mapping.put(key, data);
visitor.process(context, key, argument);
@@ -72,11 +96,48 @@
}
}
-
+
+ /**
+ * Load range of data items from the source
+ * @param startRow
+ * @param endRow
+ * @param sortOrder
+ * @return
+ */
public abstract List loadData(int startRow, int endRow, SortOrder sortOrder);
- public abstract Object getObjectById(Object id);
+ /**
+ * This method is the reverse of getObjectId
+ * Default implementation returns null anyway
+ * @param id
+ * @return
+ */
+ public Object getObjectById(Object id) {
+
+ if (id instanceof SimpleRowKey) {
+ int i = ((SimpleRowKey) id).intValue();
+
+ List l = loadData(i, i + 1, lastSortOrder);
+
+ return l.get(0);
+
+ }
+
+ return null;
+ }
+ /**
+ * To get rid of Entity interface, method is introduced
+ * Implementations may override it to provide domain-specific searches
+ * Id should be serializable
+ * @param o
+ * @return
+ */
+ public Object getId(Object o) {
+ return null;
+ }
+
+
private Object loadAndMap(Object id) {
if (log.isTraceEnabled()) {
Modified: trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/common/utils/Utils.js
===================================================================
--- trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/common/utils/Utils.js 2007-06-13 17:11:30 UTC (rev 1169)
+++ trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/common/utils/Utils.js 2007-06-13 17:18:10 UTC (rev 1170)
@@ -2,6 +2,7 @@
DOM: {
copyAttributes : function(target, source, opts) {
+
//LOG.debug("copyAttributes");
var attrs = source.attributes;
@@ -80,6 +81,7 @@
},
_clearAttributes : function(node) {
+
var attrs = node.attributes;
if (node.clearAttributes) {
node.clearAttributes();
@@ -190,13 +192,6 @@
if(rowindex >= rowCount){
rowindex -= rowCount;
}
- //var id = baseid + ":f:" + rowindex;
- //var row = Utils.DOM.replaceNode(id, request);
- //id = baseid + ":n:" + rowindex;
- //row = Utils.DOM.replaceNode(id, request);
-
- //var suffixes =
-
[":f:", ":n:"].unbreakableEach(
function(suffix) {
var id = baseid + suffix + rowindex;
@@ -210,6 +205,7 @@
);
}
+
}
);
@@ -219,10 +215,25 @@
dataModel.eventDataReady.fire(localOptions);
}
}
-
-
};
-
+/*
+var _cAtt = Utils.DOM._clearAttributes;
+Utils.DOM._clearAttributes = function() {
+ return;
+ var d1 = new Date().getTime();
+ _cAtt.apply(Utils.DOM, arguments);
+ var d2 = new Date().getTime();
+ ClientUILib.log(ClientUILogger.INFO, "Utils.DOM._clearAttributes " + (d2 - d1) + "ms");
+};
+var cAtt = Utils.DOM._clearAttributes;
+Utils.DOM.copyAttributes = function() {
+ return;
+ var d1 = new Date().getTime();
+ cAtt.apply(Utils.DOM, arguments);
+ var d2 = new Date().getTime();
+ ClientUILib.log(ClientUILogger.INFO, "Utils.DOM.copyAttributes " + (d2 - d1) + "ms");
+};
+*/
Array.prototype.unbreakableEach = function(f) {
for (var i = 0; i < this.length; i++) {
f(this[i], i);
Modified: trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/controls/grid/ScrollableGrid.js
===================================================================
--- trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/controls/grid/ScrollableGrid.js 2007-06-13 17:11:30 UTC (rev 1169)
+++ trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/controls/grid/ScrollableGrid.js 2007-06-13 17:18:10 UTC (rev 1170)
@@ -25,6 +25,7 @@
];
this.init2 = this.init.bindAsEventListener(this);
+ this.startUpTime = new Date().getTime();
this.rowCallbacks = [];
@@ -38,19 +39,29 @@
var progress = new ClientUI.common.box.SplashBox(this.splash_id, null, 300, true);
this.setProgressCtrl(progress);
Event.observe(this.eventOnSort, "on sort", this.onSorted.bindAsEventListener(this));
- this.selectionManager = new ClientUI.controls.grid.SelectionManager(this);
+ if (this.options.selectionInput) {
+ this.selectionManager = new ClientUI.controls.grid.SelectionManager(this);
+ }
+
+ if (this.startUpTime) {
+ ClientUILib.log(ClientUILogger.ERROR, "Load Time'" + (new Date().getTime() - this.startUpTime) + "' ms");
+ }
},
onSortComplete : function(request, event, data){
var options = request.getJSON("options");
Utils.AJAX.updateRows(options,request,this,this.client_id, [this.updateSelectionCallBack]);
- this.selectionManager.restoreState();
+ if (this.selectionManager) {
+ this.selectionManager.restoreState();
+ }
},
onScrollComplete : function(request, event, data){
var options = this.dataModel.getCurrentOptions();
Utils.AJAX.updateRows(options,request,this,this.client_id, [this.updateSelectionCallBack]);
- this.selectionManager.restoreState();
+ if (this.selectionManager) {
+ this.selectionManager.restoreState();
+ }
},
onSorted: function(sortEvent) {
@@ -58,7 +69,9 @@
},
updateSelectionCallBack: function(argMap) {
- this.selectionManager.addListener(argMap.row, argMap.index);
+ if (this.selectionManager) {
+ this.selectionManager.addListener(argMap.row, argMap.index);
+ }
}
});
Modified: trunk/sandbox/scrollable-grid/src/main/javascript/ClientUILib.js
===================================================================
--- trunk/sandbox/scrollable-grid/src/main/javascript/ClientUILib.js 2007-06-13 17:11:30 UTC (rev 1169)
+++ trunk/sandbox/scrollable-grid/src/main/javascript/ClientUILib.js 2007-06-13 17:18:10 UTC (rev 1170)
@@ -203,7 +203,7 @@
}
};
-ClientUILib.load();
+ClientUILib.load(true);
// declare predefined packages
var ClientUI = {
Modified: trunk/sandbox-samples/scrollable-grid-demo/src/main/java/org/richfaces/demo/datagrid/bean/ChannelDataModel2.java
===================================================================
--- trunk/sandbox-samples/scrollable-grid-demo/src/main/java/org/richfaces/demo/datagrid/bean/ChannelDataModel2.java 2007-06-13 17:11:30 UTC (rev 1169)
+++ trunk/sandbox-samples/scrollable-grid-demo/src/main/java/org/richfaces/demo/datagrid/bean/ChannelDataModel2.java 2007-06-13 17:18:10 UTC (rev 1170)
@@ -5,6 +5,8 @@
import java.util.List;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.richfaces.demo.datagrid.model.Channel;
import org.richfaces.demo.datagrid.model.Issue;
import org.richfaces.demo.datagrid.model.Key;
@@ -17,6 +19,12 @@
*/
public class ChannelDataModel2 extends GridDataModel {
+ private final Log log = LogFactory.getLog(ChannelDataModel2.class);
+
+ public static final int BIG_QUERY_DELAY = 1000;
+
+ public static final int SMALL_QUERY_DELAY = 500;
+
private Channel channel;
/* (non-Javadoc)
@@ -24,6 +32,22 @@
*/
@Override
public Object getObjectById(Object id) {
+
+ if (log.isTraceEnabled()) {
+ log.trace(id);
+ }
+
+ log.info("sleeping " + SMALL_QUERY_DELAY + "ms");
+
+ try {
+ Thread.sleep(SMALL_QUERY_DELAY);
+ } catch (InterruptedException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+ log.info("Awoke from slumber");
+
return channel.findIssueByKey((Key) id);
}
@@ -32,6 +56,21 @@
*/
@Override
public List <Issue> loadData(int startRow, int endRow, SortOrder sortOrder) {
+
+ if (log.isTraceEnabled()){
+ log.trace("startRow=" + startRow + ", endRow=" + endRow + ",sortOrder=" + sortOrder);
+ }
+
+ log.info("sleeping " + BIG_QUERY_DELAY);
+
+ try {
+ Thread.sleep(BIG_QUERY_DELAY);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+
+ log.info("Awoke from slumber");
+
return channel.executeQuery(startRow, endRow, sortOrder);
}
Modified: trunk/sandbox-samples/scrollable-grid-demo/src/main/java/org/richfaces/demo/datagrid/model/Issue.java
===================================================================
--- trunk/sandbox-samples/scrollable-grid-demo/src/main/java/org/richfaces/demo/datagrid/model/Issue.java 2007-06-13 17:11:30 UTC (rev 1169)
+++ trunk/sandbox-samples/scrollable-grid-demo/src/main/java/org/richfaces/demo/datagrid/model/Issue.java 2007-06-13 17:18:10 UTC (rev 1170)
@@ -18,7 +18,7 @@
* @author Maksim Kaszynski
*
*/
-public class Issue implements Entity{
+public class Issue implements Serializable{
private static int issueIndex = 0;
private int index = ++issueIndex;
Modified: trunk/sandbox-samples/scrollable-grid-demo/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- trunk/sandbox-samples/scrollable-grid-demo/src/main/webapp/WEB-INF/faces-config.xml 2007-06-13 17:11:30 UTC (rev 1169)
+++ trunk/sandbox-samples/scrollable-grid-demo/src/main/webapp/WEB-INF/faces-config.xml 2007-06-13 17:18:10 UTC (rev 1170)
@@ -263,38 +263,7 @@
</list-entries>
</managed-property>
</managed-bean>
-
- <managed-bean>
- <managed-bean-name>PriorityConverter</managed-bean-name>
- <managed-bean-class>org.richfaces.demo.converters.PriorityConverter</managed-bean-class>
- <managed-bean-scope>session</managed-bean-scope>
- <managed-property>
- <property-name>prioritiesList</property-name>
- <list-entries>
- <value>#{priority_blocker}</value>
- <value>#{priority_critical}</value>
- <value>#{priority_major}</value>
- <value>#{priority_minor}</value>
- <value>#{priority_cosmetic}</value>
- </list-entries>
- </managed-property>
- </managed-bean>
-
- <!--
-
- <converter>
- <description>converter for issues status</description>
- <converter-id>status_converter</converter-id>
- <converter-class>org.richfaces.demo.converters.StatusConverter</converter-class>
- </converter>
-<lifecycle>
+ <lifecycle>
<phase-listener>org.richfaces.demo.benchmark.PhaseDemarcationNotifier</phase-listener>
- </lifecycle>
- <converter>
- <description>converter for issues priority</description>
- <converter-id>priority_converter</converter-id>
- <converter-class>org.richfaces.demo.converters.PriorityConverter</converter-class>
- </converter>
- -->
-
+ </lifecycle>
</faces-config>
Modified: trunk/sandbox-samples/scrollable-grid-demo/src/main/webapp/WEB-INF/web.xml
===================================================================
--- trunk/sandbox-samples/scrollable-grid-demo/src/main/webapp/WEB-INF/web.xml 2007-06-13 17:11:30 UTC (rev 1169)
+++ trunk/sandbox-samples/scrollable-grid-demo/src/main/webapp/WEB-INF/web.xml 2007-06-13 17:18:10 UTC (rev 1170)
@@ -21,11 +21,23 @@
<param-value>.xhtml</param-value>
</context-param>
<filter>
+ <display-name>Request Metrics</display-name>
+ <filter-name>metrics</filter-name>
+ <filter-class>org.richfaces.demo.benchmark.RequestBenchMarkFilter</filter-class>
+ </filter>
+ <filter>
<display-name>Ajax4jsf Filter</display-name>
<filter-name>ajax4jsf</filter-name>
<filter-class>org.ajax4jsf.Filter</filter-class>
</filter>
<filter-mapping>
+ <filter-name>metrics</filter-name>
+ <servlet-name>Faces Servlet</servlet-name>
+ <dispatcher>REQUEST</dispatcher>
+ <dispatcher>FORWARD</dispatcher>
+ <dispatcher>INCLUDE</dispatcher>
+ </filter-mapping>
+ <filter-mapping>
<filter-name>ajax4jsf</filter-name>
<servlet-name>Faces Servlet</servlet-name>
<dispatcher>REQUEST</dispatcher>
Modified: trunk/sandbox-samples/scrollable-grid-demo/src/main/webapp/pages/scrollable-grid.xhtml
===================================================================
--- trunk/sandbox-samples/scrollable-grid-demo/src/main/webapp/pages/scrollable-grid.xhtml 2007-06-13 17:11:30 UTC (rev 1169)
+++ trunk/sandbox-samples/scrollable-grid-demo/src/main/webapp/pages/scrollable-grid.xhtml 2007-06-13 17:18:10 UTC (rev 1170)
@@ -30,7 +30,8 @@
<sg:scrollable-grid value="#{dataModel2}"
var="issues"
frozenColCount="3"
- first="0"
+ first="0"
+ rows="40"
defaultRows="40"
width="800px"
height="500px">
17 years, 7 months
JBoss Rich Faces SVN: r1169 - trunk/sandbox-samples/scrollable-grid-demo/src/main/webapp/WEB-INF.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2007-06-13 13:11:30 -0400 (Wed, 13 Jun 2007)
New Revision: 1169
Modified:
trunk/sandbox-samples/scrollable-grid-demo/src/main/webapp/WEB-INF/faces-config.xml
Log:
Modified: trunk/sandbox-samples/scrollable-grid-demo/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- trunk/sandbox-samples/scrollable-grid-demo/src/main/webapp/WEB-INF/faces-config.xml 2007-06-13 17:11:12 UTC (rev 1168)
+++ trunk/sandbox-samples/scrollable-grid-demo/src/main/webapp/WEB-INF/faces-config.xml 2007-06-13 17:11:30 UTC (rev 1169)
@@ -9,7 +9,7 @@
<managed-bean-scope>application</managed-bean-scope>
<managed-property>
<property-name>id</property-name>
- <value>0</value>
+ <value>1</value>
</managed-property>
<managed-property>
<property-name>name</property-name>
@@ -23,7 +23,7 @@
<managed-bean-scope>application</managed-bean-scope>
<managed-property>
<property-name>id</property-name>
- <value>1</value>
+ <value>2</value>
</managed-property>
<managed-property>
<property-name>name</property-name>
@@ -37,7 +37,7 @@
<managed-bean-scope>application</managed-bean-scope>
<managed-property>
<property-name>id</property-name>
- <value>2</value>
+ <value>3</value>
</managed-property>
<managed-property>
<property-name>name</property-name>
@@ -51,7 +51,7 @@
<managed-bean-scope>application</managed-bean-scope>
<managed-property>
<property-name>id</property-name>
- <value>3</value>
+ <value>4</value>
</managed-property>
<managed-property>
<property-name>name</property-name>
@@ -65,7 +65,7 @@
<managed-bean-scope>application</managed-bean-scope>
<managed-property>
<property-name>id</property-name>
- <value>4</value>
+ <value>5</value>
</managed-property>
<managed-property>
<property-name>name</property-name>
@@ -79,7 +79,7 @@
<managed-bean-scope>application</managed-bean-scope>
<managed-property>
<property-name>id</property-name>
- <value>0</value>
+ <value>1</value>
</managed-property>
<managed-property>
<property-name>name</property-name>
@@ -93,7 +93,7 @@
<managed-bean-scope>application</managed-bean-scope>
<managed-property>
<property-name>id</property-name>
- <value>1</value>
+ <value>3</value>
</managed-property>
<managed-property>
<property-name>name</property-name>
@@ -107,7 +107,7 @@
<managed-bean-scope>application</managed-bean-scope>
<managed-property>
<property-name>id</property-name>
- <value>2</value>
+ <value>5</value>
</managed-property>
<managed-property>
<property-name>name</property-name>
@@ -121,7 +121,7 @@
<managed-bean-scope>application</managed-bean-scope>
<managed-property>
<property-name>id</property-name>
- <value>3</value>
+ <value>4</value>
</managed-property>
<managed-property>
<property-name>name</property-name>
@@ -135,7 +135,7 @@
<managed-bean-scope>application</managed-bean-scope>
<managed-property>
<property-name>id</property-name>
- <value>4</value>
+ <value>6</value>
</managed-property>
<managed-property>
<property-name>name</property-name>
@@ -143,6 +143,7 @@
</managed-property>
</managed-bean>
+
<managed-bean>
<managed-bean-name>imageStore</managed-bean-name>
<managed-bean-class>org.richfaces.demo.datagrid.service.ImageStore</managed-bean-class>
@@ -270,12 +271,12 @@
<managed-property>
<property-name>prioritiesList</property-name>
<list-entries>
+ <value>#{priority_blocker}</value>
+ <value>#{priority_critical}</value>
+ <value>#{priority_major}</value>
+ <value>#{priority_minor}</value>
<value>#{priority_cosmetic}</value>
- <value>#{priority_minor}</value>
- <value>#{priority_major}</value>
- <value>#{priority_critical}</value>
- <value>#{priority_blocker}</value>
- </list-entries>
+ </list-entries>
</managed-property>
</managed-bean>
@@ -286,7 +287,9 @@
<converter-id>status_converter</converter-id>
<converter-class>org.richfaces.demo.converters.StatusConverter</converter-class>
</converter>
-
+<lifecycle>
+ <phase-listener>org.richfaces.demo.benchmark.PhaseDemarcationNotifier</phase-listener>
+ </lifecycle>
<converter>
<description>converter for issues priority</description>
<converter-id>priority_converter</converter-id>
17 years, 7 months
JBoss Rich Faces SVN: r1168 - trunk/sandbox-samples/scrollable-grid-demo/src/main/java/org/richfaces/demo/converters.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2007-06-13 13:11:12 -0400 (Wed, 13 Jun 2007)
New Revision: 1168
Modified:
trunk/sandbox-samples/scrollable-grid-demo/src/main/java/org/richfaces/demo/converters/PriorityConverter.java
trunk/sandbox-samples/scrollable-grid-demo/src/main/java/org/richfaces/demo/converters/StatusConverter.java
Log:
new Converters
Modified: trunk/sandbox-samples/scrollable-grid-demo/src/main/java/org/richfaces/demo/converters/PriorityConverter.java
===================================================================
--- trunk/sandbox-samples/scrollable-grid-demo/src/main/java/org/richfaces/demo/converters/PriorityConverter.java 2007-06-13 16:53:21 UTC (rev 1167)
+++ trunk/sandbox-samples/scrollable-grid-demo/src/main/java/org/richfaces/demo/converters/PriorityConverter.java 2007-06-13 17:11:12 UTC (rev 1168)
@@ -17,7 +17,18 @@
*
*/
public class PriorityConverter implements Converter{
-
+
+ private final static int PRIORITY_BLOCKER = 1;
+
+ private final static int PRIORITY_CRITICAL = 2;
+
+ private final static int PRIORITY_MAJOR = 3;
+
+ private final static int PRIORITY_MINOR = 4;
+
+ private final static int PRIORITY_COSMETIC = 5;
+
+
public PriorityConverter() {
}
@@ -35,8 +46,27 @@
public Object getAsObject(FacesContext context, UIComponent component,
String value) throws ConverterException{
- int id = Integer.parseInt(value);
+ int pr_id = Integer.parseInt(value);
+ int id = -1;
+ switch (pr_id) {
+ case PRIORITY_BLOCKER:
+ id = 0;
+ break;
+ case PRIORITY_CRITICAL:
+ id = 1;
+ break;
+ case PRIORITY_MAJOR:
+ id = 2;
+ break;
+ case PRIORITY_MINOR:
+ id = 3;
+ break;
+ case PRIORITY_COSMETIC:
+ id = 4;
+ break;
+ }
+
Priority convertedValue = null;
try {
Modified: trunk/sandbox-samples/scrollable-grid-demo/src/main/java/org/richfaces/demo/converters/StatusConverter.java
===================================================================
--- trunk/sandbox-samples/scrollable-grid-demo/src/main/java/org/richfaces/demo/converters/StatusConverter.java 2007-06-13 16:53:21 UTC (rev 1167)
+++ trunk/sandbox-samples/scrollable-grid-demo/src/main/java/org/richfaces/demo/converters/StatusConverter.java 2007-06-13 17:11:12 UTC (rev 1168)
@@ -18,6 +18,16 @@
*/
public class StatusConverter implements Converter{
+ private final static int STATUS_OPEN = 1;
+
+ private final static int STATUS_INPROGRESS = 3;
+
+ private final static int STATUS_RESOLVED = 5;
+
+ private final static int STATUS_REOPENED = 4;
+
+ private final static int STATUS_CLOSED = 6;
+
private List statusList = new ArrayList<Status>();
@@ -33,9 +43,28 @@
String value) throws ConverterException{
Status convertedValue = null;
- int id = Integer.parseInt(value);
+ int st_id = Integer.parseInt(value);
+ int id = -1;
+ switch (st_id) {
+ case STATUS_OPEN:
+ id = 0;
+ break;
+ case STATUS_INPROGRESS:
+ id = 1;
+ break;
+ case STATUS_RESOLVED:
+ id = 2;
+ break;
+ case STATUS_REOPENED:
+ id = 3;
+ break;
+ case STATUS_CLOSED:
+ id = 4;
+ break;
+ }
+
try {
convertedValue = (Status)statusList.get(id);
} catch (IndexOutOfBoundsException e) {
17 years, 7 months