JBoss Rich Faces SVN: r16854 - in root/ui-sandbox/trunk/components/datascroller/ui/src/main: java/org/richfaces and 3 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2010-04-30 12:39:57 -0400 (Fri, 30 Apr 2010)
New Revision: 16854
Added:
root/ui-sandbox/trunk/components/datascroller/ui/src/main/resources/META-INF/dataTable.faces-config.xml
Removed:
root/ui-sandbox/trunk/components/datascroller/ui/src/main/config/dataTable.faces-config.xml.xml
root/ui-sandbox/trunk/components/datascroller/ui/src/main/java/org/richfaces/component/html/
Modified:
root/ui-sandbox/trunk/components/datascroller/ui/src/main/config/faces-config.xml
root/ui-sandbox/trunk/components/datascroller/ui/src/main/java/org/richfaces/DataScrollerUtils.java
root/ui-sandbox/trunk/components/datascroller/ui/src/main/java/org/richfaces/component/UIDataScroller.java
root/ui-sandbox/trunk/components/datascroller/ui/src/main/java/org/richfaces/taglib/DatascrollerTagHandler.java
Log:
clear code
Deleted: root/ui-sandbox/trunk/components/datascroller/ui/src/main/config/dataTable.faces-config.xml.xml
===================================================================
--- root/ui-sandbox/trunk/components/datascroller/ui/src/main/config/dataTable.faces-config.xml.xml 2010-04-30 16:22:20 UTC (rev 16853)
+++ root/ui-sandbox/trunk/components/datascroller/ui/src/main/config/dataTable.faces-config.xml.xml 2010-04-30 16:39:57 UTC (rev 16854)
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<faces-config version="2.0" metadata-complete="false" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:cdk="http://richfaces.org/cdk/extensions" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <name>richfaces</name>
- <application>
- <system-event-listener>
- <system-event-listener-class>org.richfaces.event.DataTablePreRenderListener</system-event-listener-class>
- <system-event-class>javax.faces.event.PreRenderComponentEvent</system-event-class>
- </system-event-listener>
- </application>
-</faces-config>
Modified: root/ui-sandbox/trunk/components/datascroller/ui/src/main/config/faces-config.xml
===================================================================
--- root/ui-sandbox/trunk/components/datascroller/ui/src/main/config/faces-config.xml 2010-04-30 16:22:20 UTC (rev 16853)
+++ root/ui-sandbox/trunk/components/datascroller/ui/src/main/config/faces-config.xml 2010-04-30 16:39:57 UTC (rev 16854)
@@ -28,10 +28,9 @@
<component>
<component-type>org.richfaces.DataScroller</component-type>
- <component-class>org.richfaces.component.html.HtmlDataScroller</component-class>
+ <component-class>org.richfaces.component.UIDataScroller</component-class>
<component-extension>
<cdk:generate xmlns:cdk="http://richfaces.org/cdk/extensions">false</cdk:generate>
</component-extension>
</component>
-
</faces-config>
\ No newline at end of file
Modified: root/ui-sandbox/trunk/components/datascroller/ui/src/main/java/org/richfaces/DataScrollerUtils.java
===================================================================
--- root/ui-sandbox/trunk/components/datascroller/ui/src/main/java/org/richfaces/DataScrollerUtils.java 2010-04-30 16:22:20 UTC (rev 16853)
+++ root/ui-sandbox/trunk/components/datascroller/ui/src/main/java/org/richfaces/DataScrollerUtils.java 2010-04-30 16:39:57 UTC (rev 16854)
@@ -66,7 +66,6 @@
public static List<UIDataScroller> findDataScrollers(UIComponent dataTable) {
List <UIDataScroller> datascrollers = new ArrayList<UIDataScroller>();
-
Map<String, UIComponent> facets = dataTable.getFacets();
Set<Entry<String, UIComponent>> entries = facets.entrySet();
@@ -75,7 +74,6 @@
}
UIComponent parent = findParentContainer(dataTable);
-
if(parent != null) {
findBelow(parent, datascrollers);
}
@@ -87,6 +85,7 @@
protected static void findBelow(UIComponent component, List<UIDataScroller> result) {
if((component instanceof UIDataScroller) && component.isRendered()) {
result.add((UIDataScroller)component);
+
} else {
for(UIComponent child: component.getChildren()) {
if(!(child instanceof NamingContainer)) {
@@ -94,5 +93,6 @@
}
}
}
+
}
}
Modified: root/ui-sandbox/trunk/components/datascroller/ui/src/main/java/org/richfaces/component/UIDataScroller.java
===================================================================
--- root/ui-sandbox/trunk/components/datascroller/ui/src/main/java/org/richfaces/component/UIDataScroller.java 2010-04-30 16:22:20 UTC (rev 16853)
+++ root/ui-sandbox/trunk/components/datascroller/ui/src/main/java/org/richfaces/component/UIDataScroller.java 2010-04-30 16:39:57 UTC (rev 16854)
@@ -52,8 +52,7 @@
private Integer page;
protected enum PropertyKeys {
- boundaryControls, data, fastControls, fastStep, forComponent, handleValue, inactiveStyle, selectStyle,
- inactiveStyleClass, selectStyleClass, scrollerListener, lastPageMode, maxPages, pageIndexVar, pagesVar, renderIfSinglePage,
+ boundaryControls, fastControls, fastStep, forComponent, inactiveStyle, selectStyle, inactiveStyleClass, selectStyleClass, scrollerListener, lastPageMode, maxPages, pageIndexVar, pagesVar, renderIfSinglePage,
style, styleClass, stepControls
}
@@ -66,6 +65,46 @@
getStateHelper().put(PropertyKeys.lastPageMode, lastPageMode);
}
+ public int getFastStep() {
+ return (Integer)getStateHelper().eval(PropertyKeys.fastStep, 0);
+ }
+
+ public void setFastStep(int fastStep) {
+ getStateHelper().put(PropertyKeys.fastStep, fastStep);
+ }
+
+ public String getFor() {
+ return (String)getStateHelper().eval(PropertyKeys.forComponent);
+ }
+
+ public void setFor(String f) {
+ getStateHelper().put(PropertyKeys.forComponent, f);
+ }
+
+ public int getMaxPages() {
+ return (Integer)getStateHelper().eval(PropertyKeys.maxPages,0);
+ }
+
+ public void setMaxPages(int maxPages) {
+ getStateHelper().put(PropertyKeys.maxPages, maxPages);
+ }
+
+ public String getBoundaryControls() {
+ return (String)getStateHelper().eval(PropertyKeys.boundaryControls, "show");
+ }
+
+ public void setBoundaryControls(String boundaryControls) {
+ getStateHelper().put(PropertyKeys.boundaryControls, boundaryControls);
+ }
+
+ public String getFastControls() {
+ return (String)getStateHelper().eval(PropertyKeys.fastControls, "show");
+ }
+
+ public void setFastControls(String fastControls) {
+ getStateHelper().put(PropertyKeys.fastControls, fastControls);
+ }
+
public void addScrollerListener(DataScrollerListener listener) {
addFacesListener(listener);
}
Modified: root/ui-sandbox/trunk/components/datascroller/ui/src/main/java/org/richfaces/taglib/DatascrollerTagHandler.java
===================================================================
--- root/ui-sandbox/trunk/components/datascroller/ui/src/main/java/org/richfaces/taglib/DatascrollerTagHandler.java 2010-04-30 16:22:20 UTC (rev 16853)
+++ root/ui-sandbox/trunk/components/datascroller/ui/src/main/java/org/richfaces/taglib/DatascrollerTagHandler.java 2010-04-30 16:39:57 UTC (rev 16854)
@@ -58,16 +58,10 @@
private final TagAttribute page;
- /**
- * @param attribute
- */
public PageMapper(TagAttribute attribute) {
page = attribute;
}
- /* (non-Javadoc)
- * @see com.sun.facelets.tag.Metadata#applyMetadata(com.sun.facelets.FaceletContext, java.lang.Object)
- */
public void applyMetadata(FaceletContext ctx, Object instance) {
UIDataScroller datascroller = (UIDataScroller) instance;
ValueExpression ve = page.getValueExpression(ctx, int.class);
Added: root/ui-sandbox/trunk/components/datascroller/ui/src/main/resources/META-INF/dataTable.faces-config.xml
===================================================================
--- root/ui-sandbox/trunk/components/datascroller/ui/src/main/resources/META-INF/dataTable.faces-config.xml (rev 0)
+++ root/ui-sandbox/trunk/components/datascroller/ui/src/main/resources/META-INF/dataTable.faces-config.xml 2010-04-30 16:39:57 UTC (rev 16854)
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<faces-config version="2.0" metadata-complete="false" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:cdk="http://richfaces.org/cdk/extensions" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <name>richfaces</name>
+ <application>
+ <system-event-listener>
+ <system-event-listener-class>org.richfaces.event.DataTablePreRenderListener</system-event-listener-class>
+ <system-event-class>javax.faces.event.PreRenderComponentEvent</system-event-class>
+ </system-event-listener>
+ </application>
+</faces-config>
14 years, 8 months
JBoss Rich Faces SVN: r16852 - root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2010-04-30 12:20:42 -0400 (Fri, 30 Apr 2010)
New Revision: 16852
Added:
root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/DataTableColumnsIterator.java
root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/DataTableDataIterator.java
root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/DataTableFixedChildrenIterator.java
root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/DataTableIteratorBase.java
Log:
Added: root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/DataTableColumnsIterator.java
===================================================================
--- root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/DataTableColumnsIterator.java (rev 0)
+++ root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/DataTableColumnsIterator.java 2010-04-30 16:20:42 UTC (rev 16852)
@@ -0,0 +1,56 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * 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.Iterator;
+
+import javax.faces.component.UIComponent;
+
+import org.richfaces.component.Column;
+
+/**
+ * Iterator for all children table columns.
+ *
+ * @author asmirnov
+ *
+ */
+class DataTableColumnsIterator extends DataTableIteratorBase<UIComponent> {
+
+ protected Iterator<UIComponent> childrenIterator;
+
+ public DataTableColumnsIterator(UIComponent dataTable) {
+ this.childrenIterator = dataTable.getChildren().iterator();
+ }
+
+ protected UIComponent nextItem() {
+ while (childrenIterator != null && childrenIterator.hasNext()) {
+ UIComponent child = childrenIterator.next();
+ if (child instanceof javax.faces.component.UIColumn || child instanceof Column) {
+ return child;
+ }
+ }
+
+ // TODO nick - free childrenIterator field
+
+ return null;
+ }
+
+}
Added: root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/DataTableDataIterator.java
===================================================================
--- root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/DataTableDataIterator.java (rev 0)
+++ root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/DataTableDataIterator.java 2010-04-30 16:20:42 UTC (rev 16852)
@@ -0,0 +1,82 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * 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.Iterator;
+
+import javax.faces.component.UIComponent;
+
+import org.richfaces.component.Column;
+
+class DataTableDataIterator extends DataTableIteratorBase<UIComponent> {
+
+ private Iterator<UIComponent> facetsIterator;
+
+ private Iterator<UIComponent> childrenIterator;
+
+ public DataTableDataIterator(UIDataTableBase dataTable) {
+ this.childrenIterator = dataTable.getChildren().iterator();
+ this.facetsIterator = dataTable.getFacets().values().iterator();
+ }
+
+ protected UIComponent nextItem() {
+
+ UIComponent nextColumn = null;
+ while (nextColumn == null && childrenIterator.hasNext()) {
+ UIComponent child = childrenIterator.next();
+ // TODO nick - why non-rendered children are filtered?
+ // TODO nick - should be (child instanceof UIColumn || child instanceof Column)?
+ if ((child instanceof UIColumn) || (child instanceof Column)) {
+ nextColumn = child;
+ } else if (checkAjaxComponent(child)) {
+ nextColumn = child;
+ }
+ }
+
+ // TODO nick - free childrenIterator
+
+ // ???
+ while (nextColumn == null && facetsIterator.hasNext()) {
+ UIComponent component = facetsIterator.next();
+ if (checkAjaxComponent(component)) {
+ nextColumn = component;
+ }
+ }
+
+ // TODO nick - free facetsIterator
+
+ return nextColumn;
+ }
+
+ protected Iterator<UIComponent> getFacetsIterator() {
+ return this.facetsIterator;
+ }
+
+ protected Iterator<UIComponent> getChildrenIterator() {
+ return this.childrenIterator;
+ }
+
+ // TODO nick - what's this for?
+ protected boolean checkAjaxComponent(UIComponent child) {
+ return false;
+ }
+
+}
Added: root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/DataTableFixedChildrenIterator.java
===================================================================
--- root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/DataTableFixedChildrenIterator.java (rev 0)
+++ root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/DataTableFixedChildrenIterator.java 2010-04-30 16:20:42 UTC (rev 16852)
@@ -0,0 +1,83 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * 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.Iterator;
+
+import javax.faces.component.UIComponent;
+
+
+class DataTableFixedChildrenIterator extends DataTableDataIterator {
+
+ private Iterator<UIComponent> currentColumnIterator;
+
+ public DataTableFixedChildrenIterator(UIDataTableBase dataTable) {
+ super(dataTable);
+ }
+
+ @Override
+ protected UIComponent nextItem() {
+ UIComponent next = null;
+
+ if (currentColumnIterator != null && currentColumnIterator.hasNext()) {
+ next = currentColumnIterator.next();
+ checkColumnIterator();
+ }
+
+ if (next == null) {
+ Iterator<UIComponent> childrenIterator = getChildrenIterator();
+ while (next == null && childrenIterator.hasNext()) {
+ UIComponent child = childrenIterator.next();
+ if ((child instanceof UIColumn) && child.isRendered()) {
+ currentColumnIterator = getChildFacetIterator(child);
+ next = nextItem();
+ } else if (checkAjaxComponent(child)) {
+ next = child;
+ }
+ }
+ }
+
+ if (next == null) {
+ next = getNextFacet();
+ }
+ return next;
+ }
+
+ protected UIComponent getNextFacet() {
+ Iterator<UIComponent> facetsIterator = getFacetsIterator();
+ // TODO nick - while -> if
+ while (facetsIterator.hasNext()) {
+ return facetsIterator.next();
+ }
+ return null;
+ }
+
+ protected void checkColumnIterator() {
+ if (!currentColumnIterator.hasNext()) {
+ currentColumnIterator = null;
+ }
+ }
+
+ protected Iterator<UIComponent> getChildFacetIterator(UIComponent component) {
+ return component.getFacets().values().iterator();
+ }
+
+}
Added: root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/DataTableIteratorBase.java
===================================================================
--- root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/DataTableIteratorBase.java (rev 0)
+++ root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/DataTableIteratorBase.java 2010-04-30 16:20:42 UTC (rev 16852)
@@ -0,0 +1,52 @@
+package org.richfaces.component;
+
+import java.util.Iterator;
+import java.util.NoSuchElementException;
+
+/**
+ * @author Anton Belevich
+ * @author Nick Belaevski
+ */
+// TODO nick - rename this class
+public abstract class DataTableIteratorBase<E> implements Iterator<E> {
+
+ private boolean isCompleted = false;
+
+ private E next = null;
+
+ private void setupNext() {
+ if (!isCompleted) {
+ if (next == null) {
+ next = nextItem();
+
+ if (next == null) {
+ isCompleted = true;
+ }
+ }
+ }
+ }
+
+ public boolean hasNext() {
+ setupNext();
+
+ return next != null;
+ }
+
+ public E next() {
+ setupNext();
+
+ if (next == null) {
+ throw new NoSuchElementException();
+ }
+
+ E result = next;
+ next = null;
+ return result;
+ }
+
+ public void remove() {
+ throw new UnsupportedOperationException("Iterator is read-only");
+ }
+
+ protected abstract E nextItem();
+}
14 years, 8 months
JBoss Rich Faces SVN: r16850 - in branches/enterprise/3.3.X/docs/userguide: en/src/main/docbook/modules and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: SeanRogers
Date: 2010-04-29 22:11:03 -0400 (Thu, 29 Apr 2010)
New Revision: 16850
Modified:
branches/enterprise/3.3.X/docs/userguide/en/src/main/docbook/modules/RFCarchitectover.xml
branches/enterprise/3.3.X/docs/userguide/pom.xml
Log:
Updated circular reference information
Modified: branches/enterprise/3.3.X/docs/userguide/en/src/main/docbook/modules/RFCarchitectover.xml
===================================================================
--- branches/enterprise/3.3.X/docs/userguide/en/src/main/docbook/modules/RFCarchitectover.xml 2010-04-30 00:06:15 UTC (rev 16849)
+++ branches/enterprise/3.3.X/docs/userguide/en/src/main/docbook/modules/RFCarchitectover.xml 2010-04-30 02:11:03 UTC (rev 16850)
@@ -191,15 +191,11 @@
</listitem>
<listitem>
<para>
- Certain components in the <property>RichFaces</property> framework allow data to be serialized and transferred from the server to the client. If the data model being used contains circular references, serialization of the data fails due to a stack overflow.
+ Certain components in the <property>RichFaces</property> framework allow data to be serialized and transferred from the server to the client. If the data model being used contains circular references, the references are partially serialized. Serialization of the data is done from the top-most object down, so all circular references back to parent objects are ignored when transferred to the client.
</para>
<para>
- Circular references are unsupported and should be avoided; however, <xref linkend="Avoiding_Circular_References" /> shows how to prevent a stack overflow due to circular references. Serialization of the data is done from the top-most object down, and circular references back to parent objects are ignored. Access to non-serialized references to parent objects is not available using this method.
+ Only the data required by the client should be serialized. Serializing excess data can lead to performance and memory issues if too much data is processed, or security issues if private data is exposed to end-users. Large amounts of data can be handled creating Data Transfer Objects (<acronym>DTO</acronym>) from entities and passing them as suggestion values. Alternatively a mapping framework or assembler can manage the required data.
</para>
- <example id="Avoiding_Circular_References">
- <title>Avoiding Circular References</title>
- <programlisting language="XML" role="XML">Code sample</programlisting>
- </example>
</listitem>
</itemizedlist>
</section>
Modified: branches/enterprise/3.3.X/docs/userguide/pom.xml
===================================================================
--- branches/enterprise/3.3.X/docs/userguide/pom.xml 2010-04-30 00:06:15 UTC (rev 16849)
+++ branches/enterprise/3.3.X/docs/userguide/pom.xml 2010-04-30 02:11:03 UTC (rev 16850)
@@ -620,7 +620,7 @@
org.richfaces.docs.common-resources
</groupId>
<artifactId>
- ${project.translation}
+ ${translation}
</artifactId>
<version>
${project.version}
14 years, 8 months
JBoss Rich Faces SVN: r16849 - in root/cdk/trunk/plugins: maven-javascript-plugin/src/main/java/org/mozilla/javascript and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2010-04-29 20:06:15 -0400 (Thu, 29 Apr 2010)
New Revision: 16849
Modified:
root/cdk/trunk/plugins/generator/pom.xml
root/cdk/trunk/plugins/maven-javascript-plugin/src/main/java/org/mozilla/javascript/Token.java
Log:
fix build
Modified: root/cdk/trunk/plugins/generator/pom.xml
===================================================================
--- root/cdk/trunk/plugins/generator/pom.xml 2010-04-29 22:28:26 UTC (rev 16848)
+++ root/cdk/trunk/plugins/generator/pom.xml 2010-04-30 00:06:15 UTC (rev 16849)
@@ -83,12 +83,12 @@
</resource>
</resources>
</build>
- <dependencies>
+ <dependencies><!--
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-guice</artifactId>
</dependency>
- <dependency>
+ --><dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</dependency>
Modified: root/cdk/trunk/plugins/maven-javascript-plugin/src/main/java/org/mozilla/javascript/Token.java
===================================================================
--- root/cdk/trunk/plugins/maven-javascript-plugin/src/main/java/org/mozilla/javascript/Token.java 2010-04-29 22:28:26 UTC (rev 16848)
+++ root/cdk/trunk/plugins/maven-javascript-plugin/src/main/java/org/mozilla/javascript/Token.java 2010-04-30 00:06:15 UTC (rev 16849)
@@ -59,12 +59,12 @@
// debug flags
public static final boolean printTrees = false;
+ static final boolean printICode = false;
static final boolean printNames = printTrees || printICode;
- static final boolean printICode = false;
// End of interpreter bytecodes
public final static int
- LAST_BYTECODE_TOKEN = REF_NS_NAME, TRY = 77, SEMI = 78, // semicolon
+ LAST_BYTECODE_TOKEN = 76, TRY = 77, SEMI = 78, // semicolon
LB = 79, // left and right brackets
RB = 80, LC = 81, // left and right curlies (braces)
RC = 82, LP = 83, // left and right parentheses
14 years, 8 months
JBoss Rich Faces SVN: r16848 - in root: ui/trunk/version-matrix and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2010-04-29 18:28:26 -0400 (Thu, 29 Apr 2010)
New Revision: 16848
Modified:
root/framework/trunk/pom.xml
root/ui/trunk/version-matrix/pom.xml
Log:
update test-jsf to 1.0.2
Modified: root/framework/trunk/pom.xml
===================================================================
--- root/framework/trunk/pom.xml 2010-04-29 17:16:49 UTC (rev 16847)
+++ root/framework/trunk/pom.xml 2010-04-29 22:28:26 UTC (rev 16848)
@@ -52,12 +52,12 @@
<dependency>
<groupId>org.jboss.test-jsf</groupId>
<artifactId>htmlunit-client</artifactId>
- <version>1.0.0</version>
+ <version>1.0.2</version>
</dependency>
<dependency>
<groupId>org.jboss.test-jsf</groupId>
<artifactId>jsf-mock</artifactId>
- <version>1.0.0</version>
+ <version>1.0.2</version>
</dependency>
</dependencies>
</dependencyManagement>
Modified: root/ui/trunk/version-matrix/pom.xml
===================================================================
--- root/ui/trunk/version-matrix/pom.xml 2010-04-29 17:16:49 UTC (rev 16847)
+++ root/ui/trunk/version-matrix/pom.xml 2010-04-29 22:28:26 UTC (rev 16848)
@@ -105,17 +105,17 @@
<dependency>
<groupId>org.jboss.test-jsf</groupId>
<artifactId>htmlunit-client</artifactId>
- <version>1.0.1-SNAPSHOT</version>
+ <version>1.0.2</version>
</dependency>
<dependency>
<groupId>org.jboss.test-jsf</groupId>
<artifactId>jsf-mock</artifactId>
- <version>1.0.1-SNAPSHOT</version>
+ <version>1.0.2</version>
</dependency>
<dependency>
<groupId>org.jboss.test-jsf</groupId>
<artifactId>jsf-test-stage</artifactId>
- <version>1.0.1-SNAPSHOT</version>
+ <version>1.0.2</version>
</dependency>
<dependency>
<groupId>junit</groupId>
@@ -255,4 +255,4 @@
</plugins>
</build>
-</project>
\ No newline at end of file
+</project>
14 years, 8 months
JBoss Rich Faces SVN: r16847 - in branches/enterprise/3.3.X/framework: api/src/main/java/org/ajax4jsf/javascript and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-04-29 13:16:49 -0400 (Thu, 29 Apr 2010)
New Revision: 16847
Modified:
branches/enterprise/3.3.X/framework/api/src/main/java/org/ajax4jsf/Messages.java
branches/enterprise/3.3.X/framework/api/src/main/java/org/ajax4jsf/javascript/ScriptUtils.java
branches/enterprise/3.3.X/framework/api/src/test/java/org/ajax4jsf/framework/util/javascript/ScriptUtilsTest.java
branches/enterprise/3.3.X/framework/impl/src/main/resources/org/ajax4jsf/messages.properties
Log:
https://jira.jboss.org/jira/browse/RFPL-540
Modified: branches/enterprise/3.3.X/framework/api/src/main/java/org/ajax4jsf/Messages.java
===================================================================
--- branches/enterprise/3.3.X/framework/api/src/main/java/org/ajax4jsf/Messages.java 2010-04-29 15:54:40 UTC (rev 16846)
+++ branches/enterprise/3.3.X/framework/api/src/main/java/org/ajax4jsf/Messages.java 2010-04-29 17:16:49 UTC (rev 16847)
@@ -365,7 +365,8 @@
public static final String DATASCROLLER_PAGE_MISSING = "DATASCROLLER_PAGE_MISSING";
public static final String DATASCROLLER_PAGES_DIFFERENT = "DATASCROLLER_PAGES_DIFFERENT";
public static final String COMPONENT_CONVERSION_ERROR = "COMPONENT_CONVERSION_ERROR";
-
+ public static final String JAVASCRIPT_CIRCULAR_REFERENCE = "JAVASCRIPT_CIRCULAR_REFERENCE";
+
public static void main(String[] args) {
String m = getMessage(INVALID_ATTRIBUTE_VALUE, "A", "B");
System.out.println(m);
Modified: branches/enterprise/3.3.X/framework/api/src/main/java/org/ajax4jsf/javascript/ScriptUtils.java
===================================================================
--- branches/enterprise/3.3.X/framework/api/src/main/java/org/ajax4jsf/javascript/ScriptUtils.java 2010-04-29 15:54:40 UTC (rev 16846)
+++ branches/enterprise/3.3.X/framework/api/src/main/java/org/ajax4jsf/javascript/ScriptUtils.java 2010-04-29 17:16:49 UTC (rev 16847)
@@ -24,13 +24,19 @@
import java.beans.PropertyDescriptor;
import java.io.UnsupportedEncodingException;
import java.lang.reflect.Array;
+import java.text.MessageFormat;
import java.util.Collection;
+import java.util.IdentityHashMap;
import java.util.Iterator;
import java.util.Map;
+import java.util.MissingResourceException;
import javax.faces.FacesException;
+import org.ajax4jsf.Messages;
import org.apache.commons.beanutils.PropertyUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
/**
* @author shura (latest modification by $Author: alexsmirnov $)
@@ -39,6 +45,8 @@
*/
public class ScriptUtils {
+ private static final Log LOG = LogFactory.getLog(ScriptUtils.class);
+
/**
* This is utility class, don't instantiate.
*/
@@ -52,10 +60,31 @@
* @return
*/
public static String toScript(Object obj) {
- if (null == obj) {
- return "null";
+ Map<Object, Boolean> cycleBusterMap = new IdentityHashMap<Object, Boolean>();
+ return toScript(obj, cycleBusterMap);
+ }
+
+ private static String toScript(Object obj, Map<Object, Boolean> cycleBusterMap) {
+ String result;
+ Boolean cycleBusterValue = cycleBusterMap.put(obj, Boolean.TRUE);
+
+ if (cycleBusterValue != null) {
+ if (LOG.isDebugEnabled()) {
+ String formattedMessage;
+ try {
+ formattedMessage = Messages.getMessage(Messages.JAVASCRIPT_CIRCULAR_REFERENCE, obj);
+ } catch (MissingResourceException e) {
+ //ignore exception: workaround for unit tests
+ formattedMessage = MessageFormat.format("Circular reference serializing object to JS: {0}", obj);
+ }
+
+ LOG.debug(formattedMessage);
+ }
+ result = "null";
+ } else if (null == obj) {
+ result = "null";
} else if (obj instanceof ScriptString) {
- return ((ScriptString) obj).toScript();
+ result = ((ScriptString) obj).toScript();
} else if (obj.getClass().isArray()) {
StringBuilder ret = new StringBuilder("[");
boolean first = true;
@@ -64,11 +93,11 @@
if (!first) {
ret.append(',');
}
- ret.append(toScript(element));
+ ret.append(toScript(element, cycleBusterMap));
first = false;
}
- return ret.append("] ").toString();
- } else if (obj instanceof Collection) {
+ result = ret.append("] ").toString();
+ } else if (obj instanceof Collection<?>) {
// Collections put as JavaScript array.
@SuppressWarnings("unchecked")
@@ -81,11 +110,11 @@
if (!first) {
ret.append(',');
}
- ret.append(toScript(element));
+ ret.append(toScript(element, cycleBusterMap));
first = false;
}
- return ret.append("] ").toString();
- } else if (obj instanceof Map) {
+ result = ret.append("] ").toString();
+ } else if (obj instanceof Map<?, ?>) {
// Maps put as JavaScript hash.
@SuppressWarnings("unchecked")
@@ -100,23 +129,23 @@
addEncodedString(ret, entry.getKey());
ret.append(":");
- ret.append(toScript(entry.getValue()));
+ ret.append(toScript(entry.getValue(), cycleBusterMap));
first = false;
}
- return ret.append("} ").toString();
+ result = ret.append("} ").toString();
} else if (obj instanceof Number || obj instanceof Boolean) {
// numbers and boolean put as-is, without conversion
- return obj.toString();
+ result = obj.toString();
} else if (obj instanceof String) {
// all other put as encoded strings.
StringBuilder ret = new StringBuilder();
addEncodedString(ret, obj);
- return ret.toString();
- } else if (obj instanceof Enum) {
+ result = ret.toString();
+ } else if (obj instanceof Enum<?>) {
// all other put as encoded strings.
StringBuilder ret = new StringBuilder();
addEncodedString(ret, obj);
- return ret.toString();
+ result = ret.toString();
} else if (obj.getClass().getName().startsWith("java.sql.")) {
StringBuilder ret = new StringBuilder("{");
boolean first = true;
@@ -139,37 +168,43 @@
addEncodedString(ret, key);
ret.append(":");
- ret.append(toScript(value));
+ ret.append(toScript(value, cycleBusterMap));
first = false;
}
- return ret.append("} ").toString();
- }
-
- // All other objects threaded as Java Beans.
- try {
- StringBuilder ret = new StringBuilder("{");
- PropertyDescriptor[] propertyDescriptors = PropertyUtils
- .getPropertyDescriptors(obj);
- boolean first = true;
- for (PropertyDescriptor propertyDescriptor : propertyDescriptors) {
- String key = propertyDescriptor.getName();
- if ("class".equals(key)) {
- continue;
+ result = ret.append("} ").toString();
+ } else {
+ // All other objects threaded as Java Beans.
+ try {
+ StringBuilder ret = new StringBuilder("{");
+ PropertyDescriptor[] propertyDescriptors = PropertyUtils
+ .getPropertyDescriptors(obj);
+ boolean first = true;
+ for (PropertyDescriptor propertyDescriptor : propertyDescriptors) {
+ String key = propertyDescriptor.getName();
+ if ("class".equals(key)) {
+ continue;
+ }
+ if (!first) {
+ ret.append(',');
+ }
+ addEncodedString(ret, key);
+ ret.append(":");
+ ret.append(toScript(PropertyUtils.getProperty(obj, key), cycleBusterMap));
+ first = false;
}
- if (!first) {
- ret.append(',');
- }
- addEncodedString(ret, key);
- ret.append(":");
- ret.append(toScript(PropertyUtils.getProperty(obj, key)));
- first = false;
+ result = ret.append("} ").toString();
+ } catch (Exception e) {
+ throw new FacesException(
+ "Error in conversion Java Object to JavaScript", e);
}
- return ret.append("} ").toString();
- } catch (Exception e) {
- throw new FacesException(
- "Error in conversion Java Object to JavaScript", e);
}
+
+ if (cycleBusterValue == null) {
+ cycleBusterMap.remove(obj);
+ }
+
+ return result;
}
public static void addEncodedString(StringBuilder buff, Object obj) {
Modified: branches/enterprise/3.3.X/framework/api/src/test/java/org/ajax4jsf/framework/util/javascript/ScriptUtilsTest.java
===================================================================
--- branches/enterprise/3.3.X/framework/api/src/test/java/org/ajax4jsf/framework/util/javascript/ScriptUtilsTest.java 2010-04-29 15:54:40 UTC (rev 16846)
+++ branches/enterprise/3.3.X/framework/api/src/test/java/org/ajax4jsf/framework/util/javascript/ScriptUtilsTest.java 2010-04-29 17:16:49 UTC (rev 16847)
@@ -23,34 +23,37 @@
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.TreeMap;
import java.util.TreeSet;
+import junit.framework.TestCase;
+
import org.ajax4jsf.javascript.ScriptUtils;
-import junit.framework.TestCase;
-
/**
* @author shura
- *
+ *
*/
public class ScriptUtilsTest extends TestCase {
/**
* @author shura
- *
+ *
*/
public static class Bean {
-
+
int _integer;
boolean _bool;
Object _foo;
-
+
public Bean() {
}
+
/**
* @param ineger
* @param bool
@@ -61,44 +64,103 @@
this._bool = bool;
this._foo = foo;
}
+
/**
* @return the bool
*/
public boolean isBool() {
return this._bool;
}
+
/**
- * @param bool the bool to set
+ * @param bool
+ * the bool to set
*/
public void setBool(boolean bool) {
this._bool = bool;
}
+
/**
* @return the ineger
*/
public int getInteger() {
return this._integer;
}
+
/**
- * @param ineger the ineger to set
+ * @param ineger
+ * the ineger to set
*/
public void setInteger(int ineger) {
this._integer = ineger;
}
+
/**
* @return the foo
*/
public Object getFoo() {
return this._foo;
}
+
/**
- * @param foo the foo to set
+ * @param foo
+ * the foo to set
*/
public void setFoo(Object foo) {
this._foo = foo;
}
}
+ public static class ReferencedBean {
+
+ private String name;
+
+ private ReferenceHolderBean parent;
+
+ public ReferencedBean(String name, ReferenceHolderBean parent) {
+ super();
+ this.name = name;
+ this.parent = parent;
+ }
+
+ public ReferenceHolderBean getParent() {
+ return parent;
+ }
+
+ public String getName() {
+ return name;
+ }
+ }
+
+ public static class ReferenceHolderBean {
+
+ private String name;
+
+ private Object reference;
+
+ public ReferenceHolderBean(String name) {
+ super();
+ this.name = name;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public Object getReference() {
+ return reference;
+ }
+
+ public void setReference(Object reference) {
+ this.reference = reference;
+ }
+
+ }
+
+ private static String dehydrate(String s) {
+ return s != null ? s.replaceAll("\\s", "") : s;
+ }
+
/**
* @param name
*/
@@ -107,7 +169,8 @@
}
/**
- * Test method for {@link org.ajax4jsf.javascript.ScriptUtils#toScript(java.lang.Object)}.
+ * Test method for
+ * {@link org.ajax4jsf.javascript.ScriptUtils#toScript(java.lang.Object)}.
*/
public void testStringToScript() {
Object obj = "foo";
@@ -115,42 +178,49 @@
}
/**
- * Test method for {@link org.ajax4jsf.javascript.ScriptUtils#toScript(java.lang.Object)}.
+ * Test method for
+ * {@link org.ajax4jsf.javascript.ScriptUtils#toScript(java.lang.Object)}.
*/
public void testArrayToScript() {
- int[] obj = {1,2,3,4,5};
+ int[] obj = { 1, 2, 3, 4, 5 };
assertEquals("[1,2,3,4,5] ", ScriptUtils.toScript(obj));
}
public void testSqlDate() {
- java.sql.Time obj = new java.sql.Time(1);
- assertNotNull(ScriptUtils.toScript(obj));
+ java.sql.Time obj = new java.sql.Time(1);
+ assertNotNull(ScriptUtils.toScript(obj));
- java.sql.Date obj1 = new java.sql.Date(1);
- assertNotNull(ScriptUtils.toScript(obj1));
+ java.sql.Date obj1 = new java.sql.Date(1);
+ assertNotNull(ScriptUtils.toScript(obj1));
}
-
+
/**
- * Test method for {@link org.ajax4jsf.javascript.ScriptUtils#toScript(java.lang.Object)}.
+ * Test method for
+ * {@link org.ajax4jsf.javascript.ScriptUtils#toScript(java.lang.Object)}.
*/
public void testTwoDimentionalArrayToScript() {
- int[][] obj = {{1,2},{3,4}};
+ int[][] obj = { { 1, 2 }, { 3, 4 } };
assertEquals("[[1,2] ,[3,4] ] ", ScriptUtils.toScript(obj));
}
/**
- * Test method for {@link org.ajax4jsf.javascript.ScriptUtils#toScript(java.lang.Object)}.
+ * Test method for
+ * {@link org.ajax4jsf.javascript.ScriptUtils#toScript(java.lang.Object)}.
*/
public void testTwoDimentionalStringArrayToScript() {
- String[][] obj = {{"one","two"},{"three","four"}};
- assertEquals("[['one','two'] ,['three','four'] ] ", ScriptUtils.toScript(obj));
+ String[][] obj = { { "one", "two" }, { "three", "four" } };
+ assertEquals("[['one','two'] ,['three','four'] ] ", ScriptUtils
+ .toScript(obj));
Map<String, Object> map = new TreeMap<String, Object>();
map.put("a", obj);
map.put("b", "c");
- assertEquals("{'a':[['one','two'] ,['three','four'] ] ,'b':'c'} ", ScriptUtils.toScript(map));
+ assertEquals("{'a':[['one','two'] ,['three','four'] ] ,'b':'c'} ",
+ ScriptUtils.toScript(map));
}
+
/**
- * Test method for {@link org.ajax4jsf.javascript.ScriptUtils#toScript(java.lang.Object)}.
+ * Test method for
+ * {@link org.ajax4jsf.javascript.ScriptUtils#toScript(java.lang.Object)}.
*/
public void testListToScript() {
List<Integer> obj = new ArrayList<Integer>();
@@ -163,7 +233,8 @@
}
/**
- * Test method for {@link org.ajax4jsf.javascript.ScriptUtils#toScript(java.lang.Object)}.
+ * Test method for
+ * {@link org.ajax4jsf.javascript.ScriptUtils#toScript(java.lang.Object)}.
*/
public void testSetToScript() {
Set<Integer> obj = new TreeSet<Integer>();
@@ -174,35 +245,47 @@
obj.add(new Integer(5));
assertEquals("[1,2,3,4,5] ", ScriptUtils.toScript(obj));
}
+
/**
- * Test method for {@link org.ajax4jsf.javascript.ScriptUtils#toScript(java.lang.Object)}.
+ * Test method for
+ * {@link org.ajax4jsf.javascript.ScriptUtils#toScript(java.lang.Object)}.
*/
public void testObjectArrayToScript() {
- Bean[] obj = {new Bean(1,true,"foo"),new Bean(2,false,"bar")};
- assertEquals("[{'bool':true,'foo':'foo',\'integer\':1} ,{'bool':false,'foo':'bar','integer':2} ] ", ScriptUtils.toScript(obj));
+ Bean[] obj = { new Bean(1, true, "foo"), new Bean(2, false, "bar") };
+ assertEquals(
+ "[{'bool':true,'foo':'foo',\'integer\':1} ,{'bool':false,'foo':'bar','integer':2} ] ",
+ ScriptUtils.toScript(obj));
}
/**
- * Test method for {@link org.ajax4jsf.javascript.ScriptUtils#toScript(java.lang.Object)}.
+ * Test method for
+ * {@link org.ajax4jsf.javascript.ScriptUtils#toScript(java.lang.Object)}.
*/
public void testObjectListToScript() {
- Bean[] array = {new Bean(1,true,"foo"),new Bean(2,false,"bar")};
+ Bean[] array = { new Bean(1, true, "foo"), new Bean(2, false, "bar") };
List<Bean> obj = Arrays.asList(array);
- assertEquals("[{'bool':true,'foo':'foo',\'integer\':1} ,{'bool':false,'foo':'bar','integer':2} ] ", ScriptUtils.toScript(obj));
+ assertEquals(
+ "[{'bool':true,'foo':'foo',\'integer\':1} ,{'bool':false,'foo':'bar','integer':2} ] ",
+ ScriptUtils.toScript(obj));
}
-
+
/**
- * Test method for {@link org.ajax4jsf.javascript.ScriptUtils#toScript(java.lang.Object)}.
+ * Test method for
+ * {@link org.ajax4jsf.javascript.ScriptUtils#toScript(java.lang.Object)}.
*/
public void testMapToScript() {
TreeMap<String, String> obj = new TreeMap<String, String>();
obj.put("a", "foo");
obj.put("b", "bar");
obj.put("c", "baz");
- assertEquals("{'a':'foo','b':'bar','c':'baz'} ", ScriptUtils.toScript(obj));
+ assertEquals("{'a':'foo','b':'bar','c':'baz'} ", ScriptUtils
+ .toScript(obj));
}
+
/**
- * Test method for {@link org.ajax4jsf.javascript.ScriptUtils#addEncodedString(java.lang.StringBuffer, java.lang.Object)}.
+ * Test method for
+ * {@link org.ajax4jsf.javascript.ScriptUtils#addEncodedString(java.lang.StringBuffer, java.lang.Object)}
+ * .
*/
public void testAddEncodedString() {
StringBuilder buff = new StringBuilder();
@@ -211,7 +294,9 @@
}
/**
- * Test method for {@link org.ajax4jsf.javascript.ScriptUtils#addEncoded(java.lang.StringBuffer, java.lang.Object)}.
+ * Test method for
+ * {@link org.ajax4jsf.javascript.ScriptUtils#addEncoded(java.lang.StringBuffer, java.lang.Object)}
+ * .
*/
public void testAddEncoded() {
StringBuilder buff = new StringBuilder();
@@ -219,5 +304,55 @@
assertEquals("foo\\\"\\\'", buff.toString());
}
+ public void testCircularReferenceBeans() throws Exception {
+ ReferenceHolderBean parent = new ReferenceHolderBean("parent");
+ ReferencedBean child = new ReferencedBean("child", parent);
+
+ assertEquals(dehydrate("{'name': 'child', 'parent': {'name': 'parent', 'reference': null}}"),
+ dehydrate(ScriptUtils.toScript(child)));
+ }
+
+ public void testCircularReferenceViaProperty() throws Exception {
+ ReferenceHolderBean parent = new ReferenceHolderBean("parent");
+ ReferencedBean child = new ReferencedBean("child", parent);
+
+ parent.setReference(child);
+
+ assertEquals(dehydrate("{'name': 'parent', 'reference': {'name': 'child', 'parent': null}}"),
+ dehydrate(ScriptUtils.toScript(parent)));
+ }
+ public void testCircularReferenceViaArray() throws Exception {
+ ReferenceHolderBean parent = new ReferenceHolderBean("parent");
+ ReferencedBean child = new ReferencedBean("child", parent);
+
+ parent.setReference(new Object[] {child});
+
+ assertEquals(dehydrate("{'name': 'parent', 'reference': [{'name': 'child', 'parent': null}]}"),
+ dehydrate(ScriptUtils.toScript(parent)));
+ }
+
+ public void testCircularReferenceViaCollection() throws Exception {
+ ReferenceHolderBean parent = new ReferenceHolderBean("parent");
+ ReferencedBean child = new ReferencedBean("child", parent);
+
+ Collection<Object> set = new ArrayList<Object>();
+ set.add(child);
+ parent.setReference(set);
+
+ assertEquals(dehydrate("{'name': 'parent', 'reference': [{'name': 'child', 'parent': null}]}"),
+ dehydrate(ScriptUtils.toScript(parent)));
+ }
+
+ public void testCircularReferenceViaMap() throws Exception {
+ ReferenceHolderBean parent = new ReferenceHolderBean("parent");
+ ReferencedBean child = new ReferencedBean("child", parent);
+
+ Map<String, Object> map = new HashMap<String, Object>();
+ map.put("key", child);
+ parent.setReference(map);
+
+ assertEquals(dehydrate("{'name': 'parent', 'reference': {'key': {'name': 'child', 'parent': null}}}"),
+ dehydrate(ScriptUtils.toScript(parent)));
+ }
}
Modified: branches/enterprise/3.3.X/framework/impl/src/main/resources/org/ajax4jsf/messages.properties
===================================================================
--- branches/enterprise/3.3.X/framework/impl/src/main/resources/org/ajax4jsf/messages.properties 2010-04-29 15:54:40 UTC (rev 16846)
+++ branches/enterprise/3.3.X/framework/impl/src/main/resources/org/ajax4jsf/messages.properties 2010-04-29 17:16:49 UTC (rev 16847)
@@ -259,4 +259,5 @@
INVALID_VALUE="Component {0} has invalid value expression {1}"
DATASCROLLER_PAGE_MISSING=Datascroller {0}: The requested page #{1} isn''t found in the model containing {2} pages. Paging is reset to page #{3}
DATASCROLLER_PAGES_DIFFERENT=Datascroller components attached to component\: {0} have different values of ''page'' attribute \: {1}
-COMPONENT_CONVERSION_ERROR=Component {0}\: conversion error occurred for value {1}
\ No newline at end of file
+COMPONENT_CONVERSION_ERROR=Component {0}\: conversion error occurred for value {1}
+JAVASCRIPT_CIRCULAR_REFERENCE=Circular reference occurred during serialization of {0} object to JavaScript. Such references are not currently supported and will be nullified.
\ No newline at end of file
14 years, 8 months
JBoss Rich Faces SVN: r16846 - root/ui-sandbox/trunk/components/tables/ui/src/test/java/org/richfaces/component.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2010-04-29 11:54:40 -0400 (Thu, 29 Apr 2010)
New Revision: 16846
Modified:
root/ui-sandbox/trunk/components/tables/ui/src/test/java/org/richfaces/component/IteratorBaseTest.java
root/ui-sandbox/trunk/components/tables/ui/src/test/java/org/richfaces/component/UIDataTableBaseTest.java
Log:
refactoring
Modified: root/ui-sandbox/trunk/components/tables/ui/src/test/java/org/richfaces/component/IteratorBaseTest.java
===================================================================
--- root/ui-sandbox/trunk/components/tables/ui/src/test/java/org/richfaces/component/IteratorBaseTest.java 2010-04-29 15:53:41 UTC (rev 16845)
+++ root/ui-sandbox/trunk/components/tables/ui/src/test/java/org/richfaces/component/IteratorBaseTest.java 2010-04-29 15:54:40 UTC (rev 16846)
@@ -42,7 +42,7 @@
private static final List<String> strings = Collections.unmodifiableList(Arrays.asList("a", "b", "c"));
- private static class IteratorImpl<E> extends IteratorBase<E> {
+ private static class IteratorImpl<E> extends DataTableIteratorBase<E> {
private Iterator<E> iterator;
Modified: root/ui-sandbox/trunk/components/tables/ui/src/test/java/org/richfaces/component/UIDataTableBaseTest.java
===================================================================
--- root/ui-sandbox/trunk/components/tables/ui/src/test/java/org/richfaces/component/UIDataTableBaseTest.java 2010-04-29 15:53:41 UTC (rev 16845)
+++ root/ui-sandbox/trunk/components/tables/ui/src/test/java/org/richfaces/component/UIDataTableBaseTest.java 2010-04-29 15:54:40 UTC (rev 16846)
@@ -146,7 +146,7 @@
*/
@Test
public void testDataChildren() {
- Assert.assertTrue(table.dataChildren() instanceof DataIterator);
+ Assert.assertTrue(table.dataChildren() instanceof DataTableDataIterator);
}
/**
@@ -154,7 +154,7 @@
*/
@Test
public void testFixedChildren() {
- Assert.assertTrue(table.fixedChildren() instanceof FixedChildrenIterator);
+ Assert.assertTrue(table.fixedChildren() instanceof DataTableFixedChildrenIterator);
}
/**
@@ -202,7 +202,7 @@
*/
@Test
public void testColumns() {
- Assert.assertTrue(table.columns() instanceof ColumnsIterator);
+ Assert.assertTrue(table.columns() instanceof DataTableColumnsIterator);
}
/**
14 years, 8 months
JBoss Rich Faces SVN: r16845 - in root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces: component and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2010-04-29 11:53:41 -0400 (Thu, 29 Apr 2010)
New Revision: 16845
Removed:
root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/ColumnsIterator.java
root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/DataIterator.java
root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/FixedChildrenIterator.java
root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/IteratorBase.java
root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/behavior/
root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/state/
root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/facelets/
root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/TogglerBehaviorRenderer.java
Modified:
root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/SubtableFixedChildrenIterator.java
root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/UIColumn.java
root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/UIColumnGroup.java
root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/UIDataTable.java
root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/UIDataTableBase.java
root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/UISubTable.java
root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/html/HtmlColumn.java
root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/AbstractRowsRenderer.java
root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java
root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/ColumnGroupRenderer.java
root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/HeaderEncodeStrategy.java
root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/SubTableRenderer.java
root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/ToggleControlRendererBase.java
Log:
remove odd classes, small refactoring
Deleted: root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/ColumnsIterator.java
===================================================================
--- root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/ColumnsIterator.java 2010-04-29 14:11:41 UTC (rev 16844)
+++ root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/ColumnsIterator.java 2010-04-29 15:53:41 UTC (rev 16845)
@@ -1,56 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * 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.Iterator;
-
-import javax.faces.component.UIComponent;
-
-import org.richfaces.component.Column;
-
-/**
- * Iterator for all children table columns.
- *
- * @author asmirnov
- *
- */
-class ColumnsIterator extends IteratorBase<UIComponent> {
-
- protected Iterator<UIComponent> childrenIterator;
-
- public ColumnsIterator(UIComponent dataTable) {
- this.childrenIterator = dataTable.getChildren().iterator();
- }
-
- protected UIComponent nextItem() {
- while (childrenIterator != null && childrenIterator.hasNext()) {
- UIComponent child = childrenIterator.next();
- if (child instanceof javax.faces.component.UIColumn || child instanceof Column) {
- return child;
- }
- }
-
- // TODO nick - free childrenIterator field
-
- return null;
- }
-
-}
Deleted: root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/DataIterator.java
===================================================================
--- root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/DataIterator.java 2010-04-29 14:11:41 UTC (rev 16844)
+++ root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/DataIterator.java 2010-04-29 15:53:41 UTC (rev 16845)
@@ -1,83 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * 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.Iterator;
-
-import javax.faces.component.UIComponent;
-
-import org.richfaces.component.Column;
-
-//TODO nick - rename to include component name
-class DataIterator extends IteratorBase<UIComponent> {
-
- private Iterator<UIComponent> facetsIterator;
-
- private Iterator<UIComponent> childrenIterator;
-
- public DataIterator(UIDataTableBase dataTable) {
- this.childrenIterator = dataTable.getChildren().iterator();
- this.facetsIterator = dataTable.getFacets().values().iterator();
- }
-
- protected UIComponent nextItem() {
-
- UIComponent nextColumn = null;
- while (nextColumn == null && childrenIterator.hasNext()) {
- UIComponent child = childrenIterator.next();
- // TODO nick - why non-rendered children are filtered?
- // TODO nick - should be (child instanceof UIColumn || child instanceof Column)?
- if ((child instanceof UIColumn) || (child instanceof Column)) {
- nextColumn = child;
- } else if (checkAjaxComponent(child)) {
- nextColumn = child;
- }
- }
-
- // TODO nick - free childrenIterator
-
- // ???
- while (nextColumn == null && facetsIterator.hasNext()) {
- UIComponent component = facetsIterator.next();
- if (checkAjaxComponent(component)) {
- nextColumn = component;
- }
- }
-
- // TODO nick - free facetsIterator
-
- return nextColumn;
- }
-
- protected Iterator<UIComponent> getFacetsIterator() {
- return this.facetsIterator;
- }
-
- protected Iterator<UIComponent> getChildrenIterator() {
- return this.childrenIterator;
- }
-
- // TODO nick - what's this for?
- protected boolean checkAjaxComponent(UIComponent child) {
- return false;
- }
-
-}
Deleted: root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/FixedChildrenIterator.java
===================================================================
--- root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/FixedChildrenIterator.java 2010-04-29 14:11:41 UTC (rev 16844)
+++ root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/FixedChildrenIterator.java 2010-04-29 15:53:41 UTC (rev 16845)
@@ -1,83 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * 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.Iterator;
-
-import javax.faces.component.UIComponent;
-
-
-class FixedChildrenIterator extends DataIterator {
-
- private Iterator<UIComponent> currentColumnIterator;
-
- public FixedChildrenIterator(UIDataTableBase dataTable) {
- super(dataTable);
- }
-
- @Override
- protected UIComponent nextItem() {
- UIComponent next = null;
-
- if (currentColumnIterator != null && currentColumnIterator.hasNext()) {
- next = currentColumnIterator.next();
- checkColumnIterator();
- }
-
- if (next == null) {
- Iterator<UIComponent> childrenIterator = getChildrenIterator();
- while (next == null && childrenIterator.hasNext()) {
- UIComponent child = childrenIterator.next();
- if ((child instanceof UIColumn) && child.isRendered()) {
- currentColumnIterator = getChildFacetIterator(child);
- next = nextItem();
- } else if (checkAjaxComponent(child)) {
- next = child;
- }
- }
- }
-
- if (next == null) {
- next = getNextFacet();
- }
- return next;
- }
-
- protected UIComponent getNextFacet() {
- Iterator<UIComponent> facetsIterator = getFacetsIterator();
- // TODO nick - while -> if
- while (facetsIterator.hasNext()) {
- return facetsIterator.next();
- }
- return null;
- }
-
- protected void checkColumnIterator() {
- if (!currentColumnIterator.hasNext()) {
- currentColumnIterator = null;
- }
- }
-
- protected Iterator<UIComponent> getChildFacetIterator(UIComponent component) {
- return component.getFacets().values().iterator();
- }
-
-}
Deleted: root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/IteratorBase.java
===================================================================
--- root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/IteratorBase.java 2010-04-29 14:11:41 UTC (rev 16844)
+++ root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/IteratorBase.java 2010-04-29 15:53:41 UTC (rev 16845)
@@ -1,52 +0,0 @@
-package org.richfaces.component;
-
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-
-/**
- * @author Anton Belevich
- * @author Nick Belaevski
- */
-// TODO nick - rename this class
-public abstract class IteratorBase<E> implements Iterator<E> {
-
- private boolean isCompleted = false;
-
- private E next = null;
-
- private void setupNext() {
- if (!isCompleted) {
- if (next == null) {
- next = nextItem();
-
- if (next == null) {
- isCompleted = true;
- }
- }
- }
- }
-
- public boolean hasNext() {
- setupNext();
-
- return next != null;
- }
-
- public E next() {
- setupNext();
-
- if (next == null) {
- throw new NoSuchElementException();
- }
-
- E result = next;
- next = null;
- return result;
- }
-
- public void remove() {
- throw new UnsupportedOperationException("Iterator is read-only");
- }
-
- protected abstract E nextItem();
-}
Modified: root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/SubtableFixedChildrenIterator.java
===================================================================
--- root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/SubtableFixedChildrenIterator.java 2010-04-29 14:11:41 UTC (rev 16844)
+++ root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/SubtableFixedChildrenIterator.java 2010-04-29 15:53:41 UTC (rev 16845)
@@ -27,7 +27,7 @@
* @author asmirnov
*
*/
-public class SubtableFixedChildrenIterator extends FixedChildrenIterator {
+public class SubtableFixedChildrenIterator extends DataTableFixedChildrenIterator {
public SubtableFixedChildrenIterator(UIDataTableBase dataTable) {
super(dataTable);
Modified: root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/UIColumn.java
===================================================================
--- root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/UIColumn.java 2010-04-29 14:11:41 UTC (rev 16844)
+++ root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/UIColumn.java 2010-04-29 15:53:41 UTC (rev 16845)
@@ -36,6 +36,8 @@
protected enum PropertyKeys {
filter, filterValue, comparator, sortOrder
}
+
+
public void setSortOrder(SortOrder sortOrder) {
getStateHelper().put(PropertyKeys.sortOrder, sortOrder);
}
Modified: root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/UIColumnGroup.java
===================================================================
--- root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/UIColumnGroup.java 2010-04-29 14:11:41 UTC (rev 16844)
+++ root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/UIColumnGroup.java 2010-04-29 15:53:41 UTC (rev 16845)
@@ -40,7 +40,7 @@
public Iterator<UIComponent> columns() {
- return new ColumnsIterator(this);
+ return new DataTableColumnsIterator(this);
}
public void setBreakBefore(boolean newBreakBefore) {
Modified: root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/UIDataTable.java
===================================================================
--- root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/UIDataTable.java 2010-04-29 14:11:41 UTC (rev 16844)
+++ root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/UIDataTable.java 2010-04-29 15:53:41 UTC (rev 16845)
@@ -21,6 +21,7 @@
sortingExpression
}
+
public void setSortingListener(MethodExpression sortingExpression) {
//TODO nick - use addToggleListener() & MethodExpression wrapper in tag
getStateHelper().put(PropertyKeys.sortingExpression, sortingExpression);
Modified: root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/UIDataTableBase.java
===================================================================
--- root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/UIDataTableBase.java 2010-04-29 14:11:41 UTC (rev 16844)
+++ root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/UIDataTableBase.java 2010-04-29 15:53:41 UTC (rev 16845)
@@ -47,18 +47,19 @@
filterVar, sortPriority, sortMode, first, rows, noDataLabel
}
+
public Iterator<UIComponent> columns() {
- return new ColumnsIterator(this);
+ return new DataTableColumnsIterator(this);
}
@Override
protected Iterator<UIComponent> fixedChildren() {
- return new FixedChildrenIterator(this);
+ return new DataTableFixedChildrenIterator(this);
}
@Override
protected Iterator<UIComponent> dataChildren() {
- return new DataIterator(this);
+ return new DataTableDataIterator(this);
}
public UIComponent getHeader() {
Modified: root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/UISubTable.java
===================================================================
--- root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/UISubTable.java 2010-04-29 14:11:41 UTC (rev 16844)
+++ root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/UISubTable.java 2010-04-29 15:53:41 UTC (rev 16845)
@@ -40,18 +40,17 @@
@ResourceDependency(name = "subtable.js")
public class UISubTable extends UIDataTableBase implements Column, Expandable {
- enum PropertyKeys {
- expandMode, expanded, toggleExpression
- }
-
public static final String MODE_AJAX = "ajax";
public static final String MODE_SERVER = "server";
public static final String MODE_CLIENT = "client";
+ enum PropertyKeys {
+ expandMode, expanded, toggleExpression
+ }
-
+
@Override
public void broadcast(FacesEvent event) throws AbortProcessingException {
super.broadcast(event);
Modified: root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/html/HtmlColumn.java
===================================================================
--- root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/html/HtmlColumn.java 2010-04-29 14:11:41 UTC (rev 16844)
+++ root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/html/HtmlColumn.java 2010-04-29 15:53:41 UTC (rev 16845)
@@ -26,14 +26,15 @@
public class HtmlColumn extends UIColumn {
+ public static final String COMPONENT_TYPE = "org.richfaces.Column";
+
+ public static final String COMPONENT_FAMILY = "org.richfaces.Column";
+
enum PropertyKeys {
breakBefore, rowspan, colspan, selfSorted, sortBy
}
+
- public static final String COMPONENT_TYPE = "org.richfaces.Column";
-
- public static final String COMPONENT_FAMILY = "org.richfaces.Column";
-
public int getColspan() {
return (Integer) getStateHelper().eval(PropertyKeys.colspan, Integer.MIN_VALUE);
}
Modified: root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/AbstractRowsRenderer.java
===================================================================
--- root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/AbstractRowsRenderer.java 2010-04-29 14:11:41 UTC (rev 16844)
+++ root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/AbstractRowsRenderer.java 2010-04-29 15:53:41 UTC (rev 16845)
@@ -26,6 +26,7 @@
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
+import javax.faces.view.facelets.FaceletException;
import org.ajax4jsf.model.DataVisitResult;
import org.ajax4jsf.model.DataVisitor;
@@ -37,13 +38,7 @@
*
*/
public abstract class AbstractRowsRenderer extends RendererBase implements DataVisitor {
- /*
- * public static final String[][] TABLE_EVENT_ATTRS = { //TODO nick - clarify new names for attributes
- * {"onclick","onRowClick"}, {"ondblclick","onRowDblClick"}, {"onmousemove","onRowMouseMove"},
- * {"onmouseup","onRowMouseUp"}, {"onmousedown","onRowMouseDown"}, {"onmouseover","onRowMouseOver"},
- * {"onmouseout","onRowMouseOut"} };
- */
-
+
public DataVisitResult process(FacesContext context, Object rowKey, Object argument) {
RowHolderBase holder = (RowHolderBase) argument;
Row row = holder.getRow();
@@ -51,7 +46,7 @@
try {
encodeRow(holder);
} catch (IOException e) {
- // TODO: anton - seems we need add throws IOException ???
+ throw new FaceletException(e);
}
holder.nextRow();
return DataVisitResult.CONTINUE;
@@ -88,14 +83,5 @@
public boolean getRendersChildren() {
return true;
}
-
- /*
- * protected void encodeRowEvents(FacesContext context, UIDataAdaptor table) throws IOException {
- *
- * RendererUtils utils2 = getUtils(); for (int i = 0; i < TABLE_EVENT_ATTRS.length; i++) { String[] attrs =
- * TABLE_EVENT_ATTRS[i]; utils2.encodeAttribute(context, table, attrs[1], attrs[0]); }
- *
- * }
- */
}
Modified: root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java
===================================================================
--- root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java 2010-04-29 14:11:41 UTC (rev 16844)
+++ root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java 2010-04-29 15:53:41 UTC (rev 16845)
@@ -2,11 +2,9 @@
import java.io.IOException;
import java.util.Iterator;
-import java.util.Map;
import javax.faces.application.ResourceDependencies;
import javax.faces.application.ResourceDependency;
-import javax.faces.component.UIColumn;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
Modified: root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/ColumnGroupRenderer.java
===================================================================
--- root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/ColumnGroupRenderer.java 2010-04-29 14:11:41 UTC (rev 16844)
+++ root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/ColumnGroupRenderer.java 2010-04-29 15:53:41 UTC (rev 16845)
@@ -46,100 +46,85 @@
return new RowHolder(context, parent.getClientId(context),(UIColumnGroup)component);
}
-
+
+ // ColumnGroup component doesn't have css styles
@Override
public String getCellSkinClass() {
- // TODO Auto-generated method stub
return null;
}
@Override
public String getColumnFooterCellSkinClass() {
- // TODO Auto-generated method stub
return null;
}
@Override
public String getColumnFooterFirstSkinClass() {
- // TODO Auto-generated method stub
return null;
}
@Override
public String getColumnFooterSkinClass() {
- // TODO Auto-generated method stub
return null;
}
@Override
public String getColumnHeaderCellSkinClass() {
- // TODO Auto-generated method stub
return null;
}
@Override
public String getColumnHeaderFirstSkinClass() {
- // TODO Auto-generated method stub
return null;
}
@Override
public String getColumnHeaderSkinClass() {
- // TODO Auto-generated method stub
return null;
}
@Override
public String getFirstRowSkinClass() {
- // TODO Auto-generated method stub
return null;
}
@Override
public String getFooterCellSkinClass() {
- // TODO Auto-generated method stub
return null;
}
@Override
public String getFooterFirstSkinClass() {
- // TODO Auto-generated method stub
return null;
}
@Override
public String getFooterSkinClass() {
- // TODO Auto-generated method stub
return null;
}
@Override
public String getHeaderCellSkinClass() {
- // TODO Auto-generated method stub
return null;
}
@Override
public String getHeaderFirstSkinClass() {
- // TODO Auto-generated method stub
return null;
}
@Override
public String getHeaderSkinClass() {
- // TODO Auto-generated method stub
return null;
}
@Override
public String getRowSkinClass() {
- // TODO Auto-generated method stub
return null;
}
@Override
public String getTableSkinClass() {
- // TODO Auto-generated method stub
return null;
}
Modified: root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/HeaderEncodeStrategy.java
===================================================================
--- root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/HeaderEncodeStrategy.java 2010-04-29 14:11:41 UTC (rev 16844)
+++ root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/HeaderEncodeStrategy.java 2010-04-29 15:53:41 UTC (rev 16845)
@@ -26,7 +26,7 @@
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
-//TODO - anton move to the api
+//TODO: anton - move to the api
public interface HeaderEncodeStrategy {
Modified: root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/SubTableRenderer.java
===================================================================
--- root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/SubTableRenderer.java 2010-04-29 14:11:41 UTC (rev 16844)
+++ root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/SubTableRenderer.java 2010-04-29 15:53:41 UTC (rev 16845)
@@ -121,7 +121,7 @@
@Override
public HeaderEncodeStrategy getHeaderEncodeStrategy(UIComponent column, String tableFacetName) {
- // TODO implement column header facet
+ // TODO: implement column header facet
return null;
}
Modified: root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/ToggleControlRendererBase.java
===================================================================
--- root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/ToggleControlRendererBase.java 2010-04-29 14:11:41 UTC (rev 16844)
+++ root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/ToggleControlRendererBase.java 2010-04-29 15:53:41 UTC (rev 16845)
@@ -13,10 +13,8 @@
import org.ajax4jsf.javascript.JSFunction;
import org.ajax4jsf.renderkit.RendererBase;
import org.ajax4jsf.renderkit.RendererUtils.HTML;
-import org.richfaces.component.Expandable;
import org.richfaces.component.UISubTable;
import org.richfaces.component.UIToggleControl;
-import org.richfaces.event.ToggleEvent;
/**
* @author Anton Belevich
Deleted: root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/TogglerBehaviorRenderer.java
===================================================================
--- root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/TogglerBehaviorRenderer.java 2010-04-29 14:11:41 UTC (rev 16844)
+++ root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/TogglerBehaviorRenderer.java 2010-04-29 15:53:41 UTC (rev 16845)
@@ -1,72 +0,0 @@
-package org.richfaces.renderkit;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.faces.component.UIComponent;
-import javax.faces.component.behavior.ClientBehavior;
-import javax.faces.component.behavior.ClientBehaviorContext;
-import javax.faces.context.FacesContext;
-import javax.faces.render.ClientBehaviorRenderer;
-import javax.faces.render.FacesBehaviorRenderer;
-import javax.faces.render.RenderKitFactory;
-
-import org.ajax4jsf.javascript.JSFunction;
-import org.ajax4jsf.renderkit.RendererUtils;
-import org.richfaces.component.behavior.ToggleBehavior;
-
-@FacesBehaviorRenderer(rendererType="org.richfaces.behavior.ToggleBehavior", renderKitId=RenderKitFactory.HTML_BASIC_RENDER_KIT)
-public class TogglerBehaviorRenderer extends ClientBehaviorRenderer {
-
- private String SCRIPT_NAME = "RichFaces.Event.callHandlerById";
-
- private String SCRIPT_EMPTY = "";
-
-// RichFaces.Event.callHandlerById('form1:j_idt6', 'RICH:sort', {state: 'expanded'});
- @Override
- public String getScript(ClientBehaviorContext behaviorContext, ClientBehavior behavior) {
-
- String script = SCRIPT_EMPTY;
-
- if(behavior instanceof ToggleBehavior) {
-
- ToggleBehavior toggleBehavior = (ToggleBehavior)behavior;
-
- UIComponent toggleComponent = findComponent(behaviorContext, toggleBehavior.getToggleComponentId());
- UIComponent toggleSource = findComponent(behaviorContext, toggleBehavior.getToggleSource());
-
-
- String toggleComponentId = toggleComponent.getClientId(behaviorContext.getFacesContext());
- String toggleSourceId = toggleSource.getClientId(behaviorContext.getFacesContext());
-
- String toggleEventType = toggleBehavior.getToggleEvent();
-
- JSFunction function = new JSFunction(SCRIPT_NAME);
- function.addParameter(toggleComponentId);
- function.addParameter(toggleEventType);
-
- Map <String, Object> data = new HashMap<String, Object>();
- function.addParameter(data);
- data.put("source", toggleSourceId);
-
- function.appendScript(new StringBuffer());
- script = function.toScript();
- }
-
- return script;
- }
-
- private UIComponent findComponent(ClientBehaviorContext behaviorContext, String id) {
- UIComponent component = behaviorContext.getComponent();
- //TODO: anton - check id == null!!!
- //TODO: anton - should found component implement marker interface e.g. ToggleAble ???
- return RendererUtils.getInstance().findComponentFor(component, id);
- }
-
- @Override
- public void decode(FacesContext context, UIComponent component, ClientBehavior behavior) {
- super.decode(context, component, behavior);
- }
-
-
-}
14 years, 8 months