JBoss Rich Faces SVN: r15757 - in root/ui-sandbox/trunk/components/tables/ui/src: test and 4 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2009-10-25 17:34:24 -0400 (Sun, 25 Oct 2009)
New Revision: 15757
Added:
root/ui-sandbox/trunk/components/tables/ui/src/test/java/
root/ui-sandbox/trunk/components/tables/ui/src/test/java/org/
root/ui-sandbox/trunk/components/tables/ui/src/test/java/org/richfaces/
root/ui-sandbox/trunk/components/tables/ui/src/test/java/org/richfaces/component/
root/ui-sandbox/trunk/components/tables/ui/src/test/java/org/richfaces/component/IteratorBaseTest.java
Modified:
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
Log:
IteratorBase refactoring
Modified: 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 2009-10-25 20:17:50 UTC (rev 15756)
+++ root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/ColumnsIterator.java 2009-10-25 21:34:24 UTC (rev 15757)
@@ -40,7 +40,7 @@
this.childrenIterator = dataTable.getChildren().iterator();
}
- protected javax.faces.component.UIColumn nextComponent(){
+ protected javax.faces.component.UIColumn nextItem(){
while (childrenIterator != null && childrenIterator.hasNext()) {
UIComponent child = childrenIterator.next();
if(child instanceof javax.faces.component.UIColumn){
Modified: 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 2009-10-25 20:17:50 UTC (rev 15756)
+++ root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/DataIterator.java 2009-10-25 21:34:24 UTC (rev 15757)
@@ -36,7 +36,7 @@
this.facetsIterator = dataTable.getFacets().values().iterator();
}
- protected UIComponent nextComponent() {
+ protected UIComponent nextItem() {
UIComponent nextColumn = null;
while (nextColumn == null && childrenIterator.hasNext()) {
UIComponent child = childrenIterator.next();
Modified: 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 2009-10-25 20:17:50 UTC (rev 15756)
+++ root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/FixedChildrenIterator.java 2009-10-25 21:34:24 UTC (rev 15757)
@@ -34,7 +34,7 @@
}
@Override
- protected UIComponent nextComponent() {
+ protected UIComponent nextItem() {
UIComponent next = null;
if(currentColumnIterator != null && currentColumnIterator.hasNext()) {
@@ -48,7 +48,7 @@
UIComponent child = childrenIterator.next();
if((child instanceof UIColumn) && child.isRendered()) {
currentColumnIterator = getChildFacetIterator(child);
- next = nextComponent();
+ next = nextItem();
} else if(checkAjaxComponent(child)) {
next = child;
}
Modified: 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 2009-10-25 20:17:50 UTC (rev 15756)
+++ root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/IteratorBase.java 2009-10-25 21:34:24 UTC (rev 15757)
@@ -5,29 +5,41 @@
/**
* @author Anton Belevich
- *
+ * @author Nick Belaevski
*/
public abstract class IteratorBase<E> implements Iterator<E> {
- private boolean initialized = false;
+ private boolean isCompleted = false;
- private E next;
+ private E next = null;
+ private void setupNext() {
+ if (!isCompleted) {
+ if (next == null) {
+ next = nextItem();
- public boolean hasNext() {
- if(!initialized){
- next = nextComponent();
- initialized = true;
+ if (next == null) {
+ isCompleted = true;
+ }
+ }
}
- return null != next;
}
+
+ public boolean hasNext() {
+ setupNext();
+
+ return next != null;
+ }
public E next() {
- if (!hasNext()) {
+ setupNext();
+
+ if (next == null) {
throw new NoSuchElementException();
- }
+ }
+
E result = next;
- next = nextComponent();
+ next = null;
return result;
}
@@ -35,5 +47,5 @@
throw new UnsupportedOperationException("Iterator is read-only");
}
- abstract protected E nextComponent();
+ abstract protected E nextItem();
}
Added: 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 (rev 0)
+++ root/ui-sandbox/trunk/components/tables/ui/src/test/java/org/richfaces/component/IteratorBaseTest.java 2009-10-25 21:34:24 UTC (rev 15757)
@@ -0,0 +1,150 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.component;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+import java.util.NoSuchElementException;
+
+import org.junit.Test;
+
+
+/**
+ * @author Nick Belaevski
+ */
+public class IteratorBaseTest {
+
+ private static final List<String> strings = Collections.unmodifiableList(Arrays.asList("a", "b", "c"));
+
+ private static class IteratorImpl<E> extends IteratorBase<E> {
+
+ private Iterator<E> iterator;
+
+ public IteratorImpl(List<E> list) {
+ super();
+
+ this.iterator = list.iterator();
+ }
+
+ @Override
+ protected E nextItem() {
+ if (iterator.hasNext()) {
+ return iterator.next();
+ }
+
+ return null;
+ }
+
+ }
+
+ private Iterator<String> createTestIterator(List<String> list) {
+ return new IteratorImpl<String>(list);
+ }
+
+ private Iterator<String> createStringsIterator() {
+ return createTestIterator(strings);
+ }
+
+ private Iterator<String> createEmptyIterator() {
+ return createTestIterator(Collections.<String>emptyList());
+ }
+
+ @Test
+ public void testIteration() throws Exception {
+ Iterator<String> testIterator = createStringsIterator();
+ assertTrue(testIterator.hasNext());
+ assertEquals("a", testIterator.next());
+ assertTrue(testIterator.hasNext());
+ assertEquals("b", testIterator.next());
+ assertTrue(testIterator.hasNext());
+ assertEquals("c", testIterator.next());
+ assertFalse(testIterator.hasNext());
+ try {
+ testIterator.next();
+
+ fail();
+ } catch (NoSuchElementException e) {
+ //should be thrown - ignore
+ }
+ }
+
+ @Test
+ public void testIterationWithoutHasNext() throws Exception {
+ Iterator<String> testIterator = createStringsIterator();
+ assertEquals("a", testIterator.next());
+ assertEquals("b", testIterator.next());
+ assertEquals("c", testIterator.next());
+ try {
+ testIterator.next();
+
+ fail();
+ } catch (NoSuchElementException e) {
+ //should be thrown - ignore
+ }
+ assertFalse(testIterator.hasNext());
+ }
+
+ @Test
+ public void testEmptyList() throws Exception {
+ Iterator<String> testIterator = createEmptyIterator();
+ assertFalse(testIterator.hasNext());
+ try {
+ testIterator.next();
+
+ fail();
+ } catch (NoSuchElementException e) {
+ //should be thrown - ignore
+ }
+ }
+
+ @Test
+ public void testEmptyListWithoutHasNext() throws Exception {
+ Iterator<String> testIterator = createEmptyIterator();
+ try {
+ testIterator.next();
+
+ fail();
+ } catch (NoSuchElementException e) {
+ //should be thrown - ignore
+ }
+ }
+
+ @Test
+ public void testRemove() throws Exception {
+ Iterator<String> testIterator = createStringsIterator();
+ testIterator.next();
+ try {
+ testIterator.remove();
+
+ fail();
+ } catch (Exception e) {
+ //unsupported - ignore
+ }
+ }
+}
15 years, 2 months
JBoss Rich Faces SVN: r15756 - in root/framework/trunk/impl/src/main/java/org: richfaces/util and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2009-10-25 16:17:50 -0400 (Sun, 25 Oct 2009)
New Revision: 15756
Modified:
root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/GenericsIntrospectionCache.java
root/framework/trunk/impl/src/main/java/org/richfaces/util/ReferenceMap.java
Log:
Added synchronization for ReferenceMap and using classes
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/GenericsIntrospectionCache.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/GenericsIntrospectionCache.java 2009-10-25 19:37:03 UTC (rev 15755)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/util/GenericsIntrospectionCache.java 2009-10-25 20:17:50 UTC (rev 15756)
@@ -24,6 +24,7 @@
import java.beans.BeanInfo;
import java.lang.ref.Reference;
import java.lang.ref.SoftReference;
+import java.util.Collections;
import java.util.Map;
import javax.faces.context.ExternalContext;
@@ -69,7 +70,7 @@
private GenericsIntrospectionCache(int cacheSize) {
genericsCache = new ReferenceMap<Class<?>, GenericsCacheEntry>(
- new LRUMap<Class<?>, Reference<GenericsCacheEntry>>(cacheSize));
+ Collections.synchronizedMap(new LRUMap<Class<?>, Reference<GenericsCacheEntry>>(cacheSize)));
}
public GenericsCacheEntry getGenericCacheEntry(Class<?> beanClass) {
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/util/ReferenceMap.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/util/ReferenceMap.java 2009-10-25 19:37:03 UTC (rev 15755)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/util/ReferenceMap.java 2009-10-25 20:17:50 UTC (rev 15756)
@@ -25,6 +25,7 @@
import java.lang.ref.ReferenceQueue;
import java.lang.ref.SoftReference;
import java.util.Collection;
+import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
@@ -55,7 +56,7 @@
}
public ReferenceMap() {
- this(new HashMap<K, Reference<V>>());
+ this(Collections.synchronizedMap(new HashMap<K, Reference<V>>()));
}
public ReferenceMap(Map<K, Reference<V>> map) {
15 years, 2 months
JBoss Rich Faces SVN: r15755 - root/framework/trunk/impl/src/main/java/org/richfaces/resource.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2009-10-25 15:37:03 -0400 (Sun, 25 Oct 2009)
New Revision: 15755
Modified:
root/framework/trunk/impl/src/main/java/org/richfaces/resource/CachedResourceImpl.java
Log:
Fixed failing unit tests
Modified: root/framework/trunk/impl/src/main/java/org/richfaces/resource/CachedResourceImpl.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/richfaces/resource/CachedResourceImpl.java 2009-10-25 19:30:04 UTC (rev 15754)
+++ root/framework/trunk/impl/src/main/java/org/richfaces/resource/CachedResourceImpl.java 2009-10-25 19:37:03 UTC (rev 15755)
@@ -23,6 +23,7 @@
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
+import java.text.MessageFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Locale;
@@ -213,4 +214,9 @@
public Date getExpired(FacesContext context) {
return expired;
}
+
+ @Override
+ public String toString() {
+ return MessageFormat.format("Cached resource: {0}", getResourceName());
+ }
}
15 years, 2 months
JBoss Rich Faces SVN: r15754 - in root/framework/trunk: api/src/main/java/org/ajax4jsf/javascript and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2009-10-25 15:30:04 -0400 (Sun, 25 Oct 2009)
New Revision: 15754
Added:
root/framework/trunk/api/src/main/java/org/ajax4jsf/javascript/PropertyUtils.java
Modified:
root/framework/trunk/api/pom.xml
root/framework/trunk/api/src/main/java/org/ajax4jsf/javascript/ScriptUtils.java
root/framework/trunk/api/src/test/java/org/ajax4jsf/javascript/ScriptUtilsTest.java
root/framework/trunk/impl/pom.xml
Log:
https://jira.jboss.org/jira/browse/RF-7556
Modified: root/framework/trunk/api/pom.xml
===================================================================
--- root/framework/trunk/api/pom.xml 2009-10-23 22:46:56 UTC (rev 15753)
+++ root/framework/trunk/api/pom.xml 2009-10-25 19:30:04 UTC (rev 15754)
@@ -17,11 +17,6 @@
<dependencies>
<dependency>
- <groupId>commons-beanutils</groupId>
- <artifactId>commons-beanutils</artifactId>
- </dependency>
-
- <dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
Added: root/framework/trunk/api/src/main/java/org/ajax4jsf/javascript/PropertyUtils.java
===================================================================
--- root/framework/trunk/api/src/main/java/org/ajax4jsf/javascript/PropertyUtils.java (rev 0)
+++ root/framework/trunk/api/src/main/java/org/ajax4jsf/javascript/PropertyUtils.java 2009-10-25 19:30:04 UTC (rev 15754)
@@ -0,0 +1,92 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.ajax4jsf.javascript;
+
+import java.beans.BeanInfo;
+import java.beans.IntrospectionException;
+import java.beans.Introspector;
+import java.beans.PropertyDescriptor;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.text.MessageFormat;
+
+import org.richfaces.log.RichfacesLogger;
+import org.slf4j.Logger;
+
+/**
+ * @author Nick Belaevski
+ * @since 4.0
+ */
+final class PropertyUtils {
+
+ private static final PropertyDescriptor[] EMPTY_DESCRIPTORS_ARRAY = new PropertyDescriptor[0];
+
+ private static final Logger LOGGER = RichfacesLogger.APPLICATION.getLogger();
+
+ private PropertyUtils() {
+ //private constructor of pure utility methods class
+ }
+
+ public static PropertyDescriptor[] getPropertyDescriptors(Object bean) {
+ if (bean == null) {
+ throw new IllegalArgumentException("argument is null");
+ }
+
+ PropertyDescriptor[] descriptors = null;
+ try {
+ //TODO - cache introspection info?
+ BeanInfo beanInfo = Introspector.getBeanInfo(bean.getClass());
+ descriptors = beanInfo.getPropertyDescriptors();
+ } catch (IntrospectionException e) {
+ LOGGER.error(e.getMessage(), e);
+ }
+
+ if (descriptors == null) {
+ descriptors = EMPTY_DESCRIPTORS_ARRAY;
+ }
+
+ return descriptors;
+ }
+
+ public static Object readPropertyValue(Object bean, PropertyDescriptor descriptor) throws Exception {
+ Method readMethod = descriptor.getReadMethod();
+ if (readMethod == null) {
+ throw new NoSuchMethodException(MessageFormat.format("Read method for property ''{0}'' not found",
+ descriptor.getName()));
+ }
+
+ try {
+ return readMethod.invoke(bean);
+ } catch (InvocationTargetException e) {
+ Throwable cause = e.getCause();
+ if (cause instanceof Exception) {
+ throw (Exception) cause;
+ } else if (cause instanceof Error) {
+ throw (Error) cause;
+ } else {
+ throw e;
+ }
+ }
+ }
+
+
+}
Modified: root/framework/trunk/api/src/main/java/org/ajax4jsf/javascript/ScriptUtils.java
===================================================================
--- root/framework/trunk/api/src/main/java/org/ajax4jsf/javascript/ScriptUtils.java 2009-10-23 22:46:56 UTC (rev 15753)
+++ root/framework/trunk/api/src/main/java/org/ajax4jsf/javascript/ScriptUtils.java 2009-10-25 19:30:04 UTC (rev 15754)
@@ -33,8 +33,6 @@
import javax.faces.FacesException;
import javax.faces.context.ResponseWriter;
-import org.apache.commons.beanutils.PropertyUtils;
-
/**
* @author shura (latest modification by $Author: alexsmirnov $)
* @version $Revision: 1.1.2.3 $ $Date: 2007/01/24 13:22:31 $
@@ -46,7 +44,6 @@
* This is utility class, don't instantiate.
*/
private ScriptUtils() {
-
}
private static void writeScriptToStream(Writer writer, Object obj) throws IOException {
@@ -67,7 +64,7 @@
}
writer.write("] ");
- } else if (obj instanceof Collection) {
+ } else if (obj instanceof Collection<?>) {
// Collections put as JavaScript array.
@SuppressWarnings("unchecked")
@@ -84,7 +81,7 @@
first = false;
}
writer.write("] ");
- } else if (obj instanceof Map) {
+ } else if (obj instanceof Map<?, ?>) {
// Maps put as JavaScript hash.
@SuppressWarnings("unchecked")
@@ -109,36 +106,9 @@
} else if (obj instanceof String) {
// all other put as encoded strings.
writeEncodedString(writer, obj);
- } else if (obj instanceof Enum) {
+ } else if (obj instanceof Enum<?>) {
// all other put as encoded strings.
writeEncodedString(writer, obj);
- } else if (obj.getClass().getName().startsWith("java.sql.")) {
- writer.write("{");
- boolean first = true;
- for (PropertyDescriptor propertyDescriptor :
- PropertyUtils.getPropertyDescriptors(obj)) {
- String key = propertyDescriptor.getName();
- if ("class".equals(key)) {
- continue;
- }
- Object value = null;
- try {
- value = PropertyUtils.getProperty(obj, key);
- } catch (Exception e) {
- continue;
- }
-
- if (!first) {
- writer.write(',');
- }
-
- writeEncodedString(writer, key);
- writer.write(":");
- writeScriptToStream(writer, value);
-
- first = false;
- }
- writer.write("} ");
} else {
// All other objects threaded as Java Beans.
writer.write("{");
@@ -151,26 +121,32 @@
"Error in conversion Java Object to JavaScript", e);
}
+ boolean ignorePropertyReadException = obj.getClass().getName().startsWith("java.sql.");
boolean first = true;
+
for (PropertyDescriptor propertyDescriptor : propertyDescriptors) {
String key = propertyDescriptor.getName();
if ("class".equals(key)) {
continue;
}
+
+ Object propertyValue;
+ try{
+ propertyValue = PropertyUtils.readPropertyValue(obj, propertyDescriptor);
+ } catch (Exception e) {
+ if (!ignorePropertyReadException) {
+ throw new FacesException(
+ "Error in conversion Java Object to JavaScript", e);
+ } else {
+ continue;
+ }
+ }
+
if (!first) {
writer.write(',');
}
writeEncodedString(writer, key);
writer.write(":");
-
- Object propertyValue;
- try{
- propertyValue = PropertyUtils.getProperty(obj, key);
- } catch (Exception e) {
- throw new FacesException(
- "Error in conversion Java Object to JavaScript", e);
- }
-
writeScriptToStream(writer, propertyValue);
first = false;
}
Modified: root/framework/trunk/api/src/test/java/org/ajax4jsf/javascript/ScriptUtilsTest.java
===================================================================
--- root/framework/trunk/api/src/test/java/org/ajax4jsf/javascript/ScriptUtilsTest.java 2009-10-23 22:46:56 UTC (rev 15753)
+++ root/framework/trunk/api/src/test/java/org/ajax4jsf/javascript/ScriptUtilsTest.java 2009-10-25 19:30:04 UTC (rev 15754)
@@ -134,10 +134,18 @@
public void testSqlDate() {
java.sql.Time obj = new java.sql.Time(1);
- assertNotNull(ScriptUtils.toScript(obj));
-
+ String timeString = ScriptUtils.toScript(obj);
+ timeString = ScriptUtils.toScript(obj);
+ timeString = ScriptUtils.toScript(obj);
+ timeString = ScriptUtils.toScript(obj);
+ timeString = ScriptUtils.toScript(obj);
+ assertNotNull(timeString);
+ assertFalse(timeString.contains("year"));
+
java.sql.Date obj1 = new java.sql.Date(1);
- assertNotNull(ScriptUtils.toScript(obj1));
+ String dateString = ScriptUtils.toScript(obj1);
+ assertNotNull(dateString);
+ assertFalse(dateString.contains("seconds"));
}
/**
Modified: root/framework/trunk/impl/pom.xml
===================================================================
--- root/framework/trunk/impl/pom.xml 2009-10-23 22:46:56 UTC (rev 15753)
+++ root/framework/trunk/impl/pom.xml 2009-10-25 19:30:04 UTC (rev 15754)
@@ -124,6 +124,10 @@
<dependencies>
<dependency>
+ <groupId>commons-beanutils</groupId>
+ <artifactId>commons-beanutils</artifactId>
+ </dependency>
+ <dependency>
<groupId>${project.groupId}</groupId>
<artifactId>richfaces-api</artifactId>
</dependency>
15 years, 2 months
JBoss Rich Faces SVN: r15753 - in root/ui/trunk/components/core/src/main: java/org/ajax4jsf/facelets/tag and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2009-10-23 18:46:56 -0400 (Fri, 23 Oct 2009)
New Revision: 15753
Added:
root/ui/trunk/components/core/src/main/java/org/ajax4jsf/facelets/tag/BehaviorStack.java
root/ui/trunk/components/core/src/main/java/org/ajax4jsf/facelets/tag/BehaviorsAddingComponentHandlerWrapper.java
root/ui/trunk/components/core/src/main/java/org/ajax4jsf/facelets/tag/BehaviorsTagHandlerDelegateFactoryImpl.java
root/ui/trunk/components/core/src/main/resources/META-INF/behaviors.faces-config.xml
Modified:
root/ui/trunk/components/core/src/main/java/org/ajax4jsf/component/behavior/AjaxBehavior.java
root/ui/trunk/components/core/src/main/java/org/ajax4jsf/facelets/tag/AjaxHandler.java
Log:
https://jira.jboss.org/jira/browse/RF-7828
Modified: root/ui/trunk/components/core/src/main/java/org/ajax4jsf/component/behavior/AjaxBehavior.java
===================================================================
--- root/ui/trunk/components/core/src/main/java/org/ajax4jsf/component/behavior/AjaxBehavior.java 2009-10-23 16:32:23 UTC (rev 15752)
+++ root/ui/trunk/components/core/src/main/java/org/ajax4jsf/component/behavior/AjaxBehavior.java 2009-10-23 22:46:56 UTC (rev 15753)
@@ -16,7 +16,7 @@
*
*/
@FacesBehavior(value="org.ajax4jsf.behavior.Ajax")
-public class AjaxBehavior extends javax.faces.component.behavior.AjaxBehavior implements AjaxClientBehavior{
+public class AjaxBehavior extends javax.faces.component.behavior.AjaxBehavior implements AjaxClientBehavior {
public static final String BEHAVIOR_ID = "org.ajax4jsf.behavior.Ajax";
@@ -317,7 +317,7 @@
super.restoreState(context, values[0]);
if (values.length != 1) {
- this.limitRender = ((Boolean)values[1]).booleanValue();
+ this.limitRender = (Boolean)values[1];
this.execute = asSet(values[2]);
this.render = asSet(values[3]);
this.queueId = (String)values[4];
Modified: root/ui/trunk/components/core/src/main/java/org/ajax4jsf/facelets/tag/AjaxHandler.java
===================================================================
--- root/ui/trunk/components/core/src/main/java/org/ajax4jsf/facelets/tag/AjaxHandler.java 2009-10-23 16:32:23 UTC (rev 15752)
+++ root/ui/trunk/components/core/src/main/java/org/ajax4jsf/facelets/tag/AjaxHandler.java 2009-10-23 22:46:56 UTC (rev 15753)
@@ -1,7 +1,12 @@
package org.ajax4jsf.facelets.tag;
+import java.beans.BeanDescriptor;
+import java.beans.BeanInfo;
import java.io.IOException;
+import java.util.ArrayList;
import java.util.Collection;
+import java.util.List;
+import java.util.Map;
import javax.el.ELContext;
import javax.el.MethodExpression;
@@ -12,7 +17,10 @@
import javax.faces.event.AbortProcessingException;
import javax.faces.event.AjaxBehaviorEvent;
import javax.faces.event.AjaxBehaviorListener;
+import javax.faces.view.AttachedObjectHandler;
+import javax.faces.view.AttachedObjectTarget;
import javax.faces.view.BehaviorHolderAttachedObjectHandler;
+import javax.faces.view.BehaviorHolderAttachedObjectTarget;
import javax.faces.view.facelets.BehaviorConfig;
import javax.faces.view.facelets.ComponentHandler;
import javax.faces.view.facelets.CompositeFaceletHandler;
@@ -26,6 +34,12 @@
public class AjaxHandler extends TagHandler implements BehaviorHolderAttachedObjectHandler {
+ /**
+ *
+ */
+ //TODO - is that implementation dependency?
+ private static final String JAVAX_FACES_RETARGETABLE_HANDLERS = "javax.faces.RetargetableHandlers";
+
private final TagAttribute event;
private final TagAttribute execute;
private final TagAttribute render;
@@ -66,54 +80,74 @@
public void apply(FaceletContext fContext, UIComponent parent) throws IOException {
String eventName = getEventName();
- if(this.wrapping) {
- nextHandler.apply(fContext, parent);
+ if (this.wrapping) {
+ applyWrapping(fContext, parent, eventName);
} else {
applyNested(fContext, parent, eventName);
}
}
+
+ private static List<AttachedObjectHandler> getOrCreateRetargetableHandlersList(UIComponent component) {
+ Map<String, Object> attrs = component.getAttributes();
+ @SuppressWarnings({"unchecked"})
+ List<AttachedObjectHandler> list = (List<AttachedObjectHandler>)
+ attrs.get(JAVAX_FACES_RETARGETABLE_HANDLERS);
+
+ if (list == null) {
+ list = new ArrayList<AttachedObjectHandler>();
+ attrs.put(JAVAX_FACES_RETARGETABLE_HANDLERS, list);
+ }
+
+ return list;
+ }
private void applyNested(FaceletContext ctx, UIComponent parent, String eventName) {
-
if (!ComponentHandler.isNew(parent)) {
return;
}
if (UIComponent.isCompositeComponent(parent)) {
- throw new UnsupportedOperationException("This type of configuration is not supported!");
- /*
- BeanInfo componentBeanInfo = (BeanInfo) parent.getAttributes().get(UIComponent.BEANINFO_KEY);
- if (null == componentBeanInfo) {
- throw new TagException(tag, "Error: enclosing composite component does not have BeanInfo attribute");
- }
- BeanDescriptor componentDescriptor = componentBeanInfo.getBeanDescriptor();
- if (null == componentDescriptor) {
- throw new TagException(tag, "Error: enclosing composite component BeanInfo does not have BeanDescriptor");
- }
-
- List<AttachedObjectTarget> targetList = (List<AttachedObjectTarget>) componentDescriptor.getValue(AttachedObjectTarget.ATTACHED_OBJECT_TARGETS_KEY);
-
- if (null == targetList) {
- throw new TagException(tag, "Error: enclosing composite component does not support behavior events");
- }
-
- boolean supportedEvent = false;
- for (AttachedObjectTarget target : targetList) {
- if (target instanceof BehaviorHolderAttachedObjectTarget) {
- BehaviorHolderAttachedObjectTarget behaviorTarget = (BehaviorHolderAttachedObjectTarget) target;
- if ((null != eventName && eventName.equals(behaviorTarget.getName()))
- || (null == eventName && behaviorTarget.isDefaultEvent())) {
- supportedEvent = true;
- break;
- }
- }
- }
-
- if (supportedEvent) {
- CompositeComponentTagHandler.getAttachedObjectHandlers(parent).add(this);
- } else {
- throw new TagException(tag, "Error: enclosing composite component does not support event " + eventName);
- }*/
+ BeanInfo componentBeanInfo = (BeanInfo) parent.getAttributes().get(UIComponent.BEANINFO_KEY);
+ if (null == componentBeanInfo) {
+ throw new TagException(
+ tag,
+ "Error: enclosing composite component does not have BeanInfo attribute");
+ }
+ BeanDescriptor componentDescriptor = componentBeanInfo.getBeanDescriptor();
+ if (null == componentDescriptor) {
+ throw new TagException(
+ tag,
+ "Error: enclosing composite component BeanInfo does not have BeanDescriptor");
+ }
+
+ @SuppressWarnings("unchecked")
+ List<AttachedObjectTarget> targetList = (List<AttachedObjectTarget>)
+ componentDescriptor.getValue(AttachedObjectTarget.ATTACHED_OBJECT_TARGETS_KEY);
+
+ if (null == targetList) {
+ throw new TagException(
+ tag,
+ "Error: enclosing composite component does not support behavior events");
+ }
+ boolean supportedEvent = false;
+ for (AttachedObjectTarget target : targetList) {
+ if (target instanceof BehaviorHolderAttachedObjectTarget) {
+ BehaviorHolderAttachedObjectTarget behaviorTarget = (BehaviorHolderAttachedObjectTarget) target;
+ if ((null != eventName && eventName.equals(behaviorTarget.getName()))
+ || (null == eventName && behaviorTarget.isDefaultEvent())) {
+ supportedEvent = true;
+ break;
+ }
+ }
+ }
+ if (supportedEvent) {
+ getOrCreateRetargetableHandlersList(parent).add(this);
+ } else {
+ throw new TagException(
+ tag,
+ "Error: enclosing composite component does not support event "
+ + eventName);
+ }
} else if (parent instanceof ClientBehaviorHolder) {
applyAttachedObject(ctx, parent, eventName);
} else {
@@ -122,19 +156,19 @@
}
-/* private void applyWrapping(FaceletContext ctx, UIComponent parent, String eventName) throws IOException {
+ private void applyWrapping(FaceletContext ctx, UIComponent parent, String eventName) throws IOException {
AjaxBehavior ajaxBehavior = createAjaxBehavior(ctx, eventName);
FacesContext context = ctx.getFacesContext();
- AjaxBehaviors ajaxBehaviors = AjaxBehaviors.getAjaxBehaviors(context, true);
- ajaxBehaviors.pushBehavior(context, ajaxBehavior, eventName);
+ BehaviorStack ajaxBehaviors = BehaviorStack.getBehaviorStack(context, true);
+ ajaxBehaviors.pushBehavior(context, ajaxBehavior, AjaxBehavior.BEHAVIOR_ID, eventName);
nextHandler.apply(ctx, parent);
ajaxBehaviors.popBehavior();
- } */
+ }
+
-
public void applyAttachedObject(FaceletContext fContext, UIComponent parent, String eventName) {
ClientBehaviorHolder bHolder = (ClientBehaviorHolder) parent;
if (null == eventName) {
Added: root/ui/trunk/components/core/src/main/java/org/ajax4jsf/facelets/tag/BehaviorStack.java
===================================================================
--- root/ui/trunk/components/core/src/main/java/org/ajax4jsf/facelets/tag/BehaviorStack.java (rev 0)
+++ root/ui/trunk/components/core/src/main/java/org/ajax4jsf/facelets/tag/BehaviorStack.java 2009-10-23 22:46:56 UTC (rev 15753)
@@ -0,0 +1,153 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.ajax4jsf.facelets.tag;
+
+import java.util.Deque;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.faces.application.Application;
+import javax.faces.component.StateHolder;
+import javax.faces.component.behavior.ClientBehavior;
+import javax.faces.component.behavior.ClientBehaviorHint;
+import javax.faces.component.behavior.ClientBehaviorHolder;
+import javax.faces.context.FacesContext;
+
+/**
+ * @author Nick Belaevski
+ *
+ * This class is necessary to handle nesting wrapping behaviors properly and is created
+ * to work around this issue: https://javaserverfaces-spec-public.dev.java.net/issues/show_bug.cgi?id=655
+ *
+ */
+//TODO - check for bug resolution
+final class BehaviorStack {
+
+ private static final String BEHAVIOR_STACK = "org.richfaces.BehaviorStack";
+
+ private static class BehaviorInfo {
+
+ private String behaviorId;
+ private String eventName;
+ private Object behaviorState;
+
+ public BehaviorInfo(String behaviorId, String eventName,
+ Object behaviorState) {
+ this.behaviorId = behaviorId;
+ this.eventName = eventName;
+ this.behaviorState = behaviorState;
+ }
+
+ public void addBehavior(FacesContext context, ClientBehaviorHolder behaviorHolder) {
+ String eventName = this.eventName;
+ if (eventName == null) {
+ eventName = behaviorHolder.getDefaultEventName();
+
+ if (eventName == null) {
+ return;
+ }
+ }
+
+ if (shouldAddBehavior(behaviorHolder, eventName)) {
+ ClientBehavior behavior = createBehavior(context);
+ behaviorHolder.addClientBehavior(eventName, behavior);
+ }
+ }
+
+ private boolean shouldAddBehavior(ClientBehaviorHolder behaviorHolder, String eventName) {
+
+ if (!behaviorHolder.getEventNames().contains(eventName)) {
+ return false;
+ }
+
+ Map<String,List<ClientBehavior>> clientBehaviorsMap = behaviorHolder.getClientBehaviors();
+ List<ClientBehavior> clientBehaviors = clientBehaviorsMap.get(eventName);
+
+ if (clientBehaviors == null || clientBehaviors.isEmpty()) {
+ return true;
+ }
+
+ for (ClientBehavior behavior : clientBehaviors) {
+ Set<ClientBehaviorHint> hints = behavior.getHints();
+
+ if (hints.contains(ClientBehaviorHint.SUBMITTING)) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ private ClientBehavior createBehavior(FacesContext context) {
+ Application application = context.getApplication();
+
+ ClientBehavior behavior = (ClientBehavior) application.createBehavior(this.behaviorId);
+
+ ((StateHolder) behavior).restoreState(context, behaviorState);
+
+ return behavior;
+ }
+ }
+
+ private Deque<BehaviorInfo> behaviorStack = null;
+
+ public BehaviorStack() {
+ behaviorStack = new LinkedList<BehaviorInfo>();
+ }
+
+ public static BehaviorStack getBehaviorStack(FacesContext context, boolean createIfNull) {
+ Map<Object, Object> attributes = context.getAttributes();
+ BehaviorStack behaviorStack = (BehaviorStack) attributes.get(BEHAVIOR_STACK);
+ if (behaviorStack == null && createIfNull) {
+ behaviorStack = new BehaviorStack();
+ attributes.put(BEHAVIOR_STACK, behaviorStack);
+ }
+
+ return behaviorStack;
+ }
+
+ public void addBehaviors(FacesContext context, ClientBehaviorHolder behaviorHolder) {
+ if (behaviorStack == null || behaviorStack.isEmpty()) {
+ return;
+ }
+
+ for (BehaviorInfo behaviorInfo : behaviorStack) {
+ behaviorInfo.addBehavior(context, behaviorHolder);
+ }
+ }
+
+ public void pushBehavior(FacesContext context, ClientBehavior clientBehavior, String behaviorId,
+ String eventName) {
+
+ Object behaviorState = ((StateHolder) clientBehavior).saveState(context);
+ //closer behaviors are processed earlier
+ behaviorStack.addFirst(new BehaviorInfo(behaviorId, eventName, behaviorState));
+ }
+
+ public void popBehavior() {
+ if (!behaviorStack.isEmpty()) {
+ behaviorStack.removeFirst();
+ }
+ }
+}
Added: root/ui/trunk/components/core/src/main/java/org/ajax4jsf/facelets/tag/BehaviorsAddingComponentHandlerWrapper.java
===================================================================
--- root/ui/trunk/components/core/src/main/java/org/ajax4jsf/facelets/tag/BehaviorsAddingComponentHandlerWrapper.java (rev 0)
+++ root/ui/trunk/components/core/src/main/java/org/ajax4jsf/facelets/tag/BehaviorsAddingComponentHandlerWrapper.java 2009-10-23 22:46:56 UTC (rev 15753)
@@ -0,0 +1,119 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.ajax4jsf.facelets.tag;
+
+import java.io.IOException;
+
+import javax.el.ELException;
+import javax.faces.FacesException;
+import javax.faces.component.UIComponent;
+import javax.faces.component.behavior.ClientBehaviorHolder;
+import javax.faces.context.FacesContext;
+import javax.faces.view.facelets.ComponentConfig;
+import javax.faces.view.facelets.ComponentHandler;
+import javax.faces.view.facelets.FaceletContext;
+import javax.faces.view.facelets.Tag;
+import javax.faces.view.facelets.TagAttribute;
+
+/**
+ * @author Nick Belaevski
+ */
+public class BehaviorsAddingComponentHandlerWrapper extends ComponentHandler {
+
+ private ComponentHandler componentHandler;
+
+ public BehaviorsAddingComponentHandlerWrapper(ComponentHandler componentHandler) {
+ super(componentHandler.getComponentConfig());
+ this.componentHandler = componentHandler;
+ }
+
+ public void apply(FaceletContext ctx, UIComponent parent)
+ throws IOException {
+ componentHandler.apply(ctx, parent);
+ }
+
+ public void applyNextHandler(FaceletContext ctx, UIComponent c)
+ throws IOException, FacesException, ELException {
+ componentHandler.applyNextHandler(ctx, c);
+ }
+
+ public TagAttribute getBinding() {
+ return componentHandler.getBinding();
+ }
+
+ public ComponentConfig getComponentConfig() {
+ return componentHandler.getComponentConfig();
+ }
+
+ public Tag getTag() {
+ return componentHandler.getTag();
+ }
+
+ public TagAttribute getTagAttribute(String localName) {
+ return componentHandler.getTagAttribute(localName);
+ }
+
+ public String getTagId() {
+ return componentHandler.getTagId();
+ }
+
+ public boolean equals(Object obj) {
+ return componentHandler.equals(obj);
+ }
+
+ public int hashCode() {
+ return componentHandler.hashCode();
+ }
+
+ public String toString() {
+ return componentHandler.toString();
+ }
+
+ public boolean isDisabled(FaceletContext ctx) {
+ return componentHandler.isDisabled(ctx);
+ }
+
+ public void onComponentCreated(FaceletContext ctx, UIComponent c,
+ UIComponent parent) {
+ componentHandler.onComponentCreated(ctx, c, parent);
+ }
+
+ public void onComponentPopulated(FaceletContext ctx, UIComponent c,
+ UIComponent parent) {
+
+ FacesContext facesContext = ctx.getFacesContext();
+ BehaviorStack behaviorStack = BehaviorStack.getBehaviorStack(facesContext, false);
+ if (behaviorStack != null) {
+ if (c instanceof ClientBehaviorHolder) {
+ ClientBehaviorHolder behaviorHolder = (ClientBehaviorHolder) c;
+ behaviorStack.addBehaviors(facesContext, behaviorHolder);
+ }
+ }
+
+ componentHandler.onComponentPopulated(ctx, c, parent);
+ }
+
+ public void setAttributes(FaceletContext ctx, Object instance) {
+ componentHandler.setAttributes(ctx, instance);
+ }
+
+}
Added: root/ui/trunk/components/core/src/main/java/org/ajax4jsf/facelets/tag/BehaviorsTagHandlerDelegateFactoryImpl.java
===================================================================
--- root/ui/trunk/components/core/src/main/java/org/ajax4jsf/facelets/tag/BehaviorsTagHandlerDelegateFactoryImpl.java (rev 0)
+++ root/ui/trunk/components/core/src/main/java/org/ajax4jsf/facelets/tag/BehaviorsTagHandlerDelegateFactoryImpl.java 2009-10-23 22:46:56 UTC (rev 15753)
@@ -0,0 +1,79 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.ajax4jsf.facelets.tag;
+
+import javax.faces.view.facelets.BehaviorHandler;
+import javax.faces.view.facelets.ComponentHandler;
+import javax.faces.view.facelets.ConverterHandler;
+import javax.faces.view.facelets.TagHandlerDelegate;
+import javax.faces.view.facelets.TagHandlerDelegateFactory;
+import javax.faces.view.facelets.ValidatorHandler;
+
+/**
+ * @author Nick Belaevski
+ */
+public class BehaviorsTagHandlerDelegateFactoryImpl extends TagHandlerDelegateFactory {
+
+ private TagHandlerDelegateFactory factory;
+
+ public BehaviorsTagHandlerDelegateFactoryImpl(TagHandlerDelegateFactory factory) {
+ this.factory = factory;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.faces.view.facelets.TagHandlerDelegateFactory#createBehaviorHandlerDelegate(javax.faces.view.facelets.BehaviorHandler)
+ */
+ @Override
+ public TagHandlerDelegate createBehaviorHandlerDelegate(
+ BehaviorHandler owner) {
+ return factory.createBehaviorHandlerDelegate(owner);
+ }
+
+ /* (non-Javadoc)
+ * @see javax.faces.view.facelets.TagHandlerDelegateFactory#createComponentHandlerDelegate(javax.faces.view.facelets.ComponentHandler)
+ */
+ @Override
+ public TagHandlerDelegate createComponentHandlerDelegate(ComponentHandler owner) {
+ //TagHandlers structure is created when view is compiled
+ //so there's no need to check for BehaviorsStack
+ return factory.createComponentHandlerDelegate(new BehaviorsAddingComponentHandlerWrapper(owner));
+ }
+
+ /* (non-Javadoc)
+ * @see javax.faces.view.facelets.TagHandlerDelegateFactory#createConverterHandlerDelegate(javax.faces.view.facelets.ConverterHandler)
+ */
+ @Override
+ public TagHandlerDelegate createConverterHandlerDelegate(
+ ConverterHandler owner) {
+ return factory.createConverterHandlerDelegate(owner);
+ }
+
+ /* (non-Javadoc)
+ * @see javax.faces.view.facelets.TagHandlerDelegateFactory#createValidatorHandlerDelegate(javax.faces.view.facelets.ValidatorHandler)
+ */
+ @Override
+ public TagHandlerDelegate createValidatorHandlerDelegate(
+ ValidatorHandler owner) {
+ return factory.createValidatorHandlerDelegate(owner);
+ }
+
+}
Added: root/ui/trunk/components/core/src/main/resources/META-INF/behaviors.faces-config.xml
===================================================================
--- root/ui/trunk/components/core/src/main/resources/META-INF/behaviors.faces-config.xml (rev 0)
+++ root/ui/trunk/components/core/src/main/resources/META-INF/behaviors.faces-config.xml 2009-10-23 22:46:56 UTC (rev 15753)
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<faces-config xmlns="http://java.sun.com/xml/ns/javaee"
+ version="2.0">
+
+ <name>richfaces</name>
+
+ <ordering>
+ <before>
+ <others />
+ </before>
+ </ordering>
+
+ <factory>
+ <tag-handler-delegate-factory>org.ajax4jsf.facelets.tag.BehaviorsTagHandlerDelegateFactoryImpl</tag-handler-delegate-factory>
+ </factory>
+
+</faces-config>
\ No newline at end of file
15 years, 2 months
JBoss Rich Faces SVN: r15752 - in root/examples-sandbox/trunk/components/tables: src/main/webapp and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2009-10-23 12:32:23 -0400 (Fri, 23 Oct 2009)
New Revision: 15752
Modified:
root/examples-sandbox/trunk/components/tables/pom.xml
root/examples-sandbox/trunk/components/tables/src/main/webapp/home.xhtml
Log:
Modified: root/examples-sandbox/trunk/components/tables/pom.xml
===================================================================
--- root/examples-sandbox/trunk/components/tables/pom.xml 2009-10-23 16:30:51 UTC (rev 15751)
+++ root/examples-sandbox/trunk/components/tables/pom.xml 2009-10-23 16:32:23 UTC (rev 15752)
@@ -69,6 +69,11 @@
<version>1.5.8</version>
</dependency>
<dependency>
+ <groupId>jstl</groupId>
+ <artifactId>jstl</artifactId>
+ <version>1.2</version>
+ </dependency>
+ <dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.5.8</version>
Modified: root/examples-sandbox/trunk/components/tables/src/main/webapp/home.xhtml
===================================================================
--- root/examples-sandbox/trunk/components/tables/src/main/webapp/home.xhtml 2009-10-23 16:30:51 UTC (rev 15751)
+++ root/examples-sandbox/trunk/components/tables/src/main/webapp/home.xhtml 2009-10-23 16:32:23 UTC (rev 15752)
@@ -12,9 +12,25 @@
<h:body>
<h:form id="form1">
- <rich:simpleDataTable var="record" value="#{dataBean.employeeList}">
+ <rich:simpleDataTable var="record" value="#{dataBean.employeeList}" rows="20" style="border: 1px solid grey">
+ <f:facet name="caption">
+ <h:outputText id="captioFacet1" value="Caption Facet" />
+ </f:facet>
+ <f:facet name="header">
+ <rich:colGroup id="headerFacet1" >
+ <rich:column><h:outputText id="headerFacet12" value="header column 1"> </h:outputText></rich:column>
+ <rich:column><h:outputText id="headerFacet13" value="header column 1"></h:outputText></rich:column>
+ <rich:column><h:outputText id="headerFacet14" value="header column 1"></h:outputText></rich:column>
+ </rich:colGroup>
+ </f:facet>
<rich:column id="column_name">
+ <f:facet name="header">
+ <h:outputText id="columnHeader1" value="Column Header Facet"/>
+ </f:facet>
<h:outputText value="#{record.name}" />
+ <f:facet name="footer">
+ <h:outputText id="columnFooter1" value="Column Footer Facet"/>
+ </f:facet>
</rich:column>
<rich:column id="column_title">
@@ -25,18 +41,23 @@
<h:outputText value="#{record.EMail}" />
</rich:column>
- <rich:column id="column_company_name">
- <h:outputText value="#{record.company.name}" />
- </rich:column>
-
- <rich:column id="column_company_state">
- <h:outputText value="#{record.company.state}" />
- </rich:column>
-
- <rich:column id="column_company_phone">
- <h:outputText value="#{record.company.phone}" />
- </rich:column>
- </rich:simpleDataTable>
+ <rich:subTable var="company" value="#{record.company}">
+ <rich:column id="column_company_name">
+ <h:outputText value="#{company.name}" />
+ </rich:column>
+
+ <rich:column id="column_company_state">
+ <h:outputText value="#{company.state}" />
+ </rich:column>
+
+ <rich:column id="column_company_phone">
+ <h:outputText value="#{company.phone}" />
+ </rich:column>
+ </rich:subTable>
+ <f:facet name="footer">
+ <h:outputText id="footerFacet1" value="Footer Facet" />
+ </f:facet>
+ </rich:simpleDataTable>
</h:form>
</h:body>
</html>
15 years, 2 months
JBoss Rich Faces SVN: r15751 - root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/html.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2009-10-23 12:30:51 -0400 (Fri, 23 Oct 2009)
New Revision: 15751
Added:
root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/html/HtmlSubTable.java
Log:
subtable ui impl
Added: root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/html/HtmlSubTable.java
===================================================================
--- root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/html/HtmlSubTable.java (rev 0)
+++ root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/html/HtmlSubTable.java 2009-10-23 16:30:51 UTC (rev 15751)
@@ -0,0 +1,50 @@
+package org.richfaces.component.html;
+
+import javax.el.MethodExpression;
+
+import org.richfaces.component.UISubTable;
+import org.richfaces.model.Ordering;
+
+public class HtmlSubTable extends UISubTable{
+
+ public MethodExpression getFilterMethod() {
+ return null;
+ }
+
+ public String getFilterValue() {
+ return null;
+ }
+
+ public Ordering getSortOrder() {
+ return null;
+ }
+
+ public boolean isSelfSorted() {
+ return false;
+ }
+
+ public boolean isSortable() {
+ return false;
+ }
+
+ public void setFilterMethod(MethodExpression methodExpression) {
+ }
+
+ public void setFilterValue(String filterValue) {
+ }
+
+ public void setSelfSorted(boolean selfSorted) {
+ }
+
+ public void setSortOrder(Ordering sortOrder) {
+ }
+
+ public void setSortable(boolean sortable) {
+ }
+
+ @Override
+ public String getFamily() {
+ return COMPONENT_FAMILY;
+ }
+
+}
15 years, 2 months
JBoss Rich Faces SVN: r15750 - 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: 2009-10-23 12:29:45 -0400 (Fri, 23 Oct 2009)
New Revision: 15750
Added:
root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/IteratorBase.java
Modified:
root/ui-sandbox/trunk/components/tables/ui/src/main/config/component/tables.xml
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/UIDataTable.java
root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/SimpleColgroupRenderer.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/resources/META-INF/faces-config.xml
root/ui-sandbox/trunk/components/tables/ui/src/main/resources/META-INF/tables.taglib.xml
Log:
add IteratorBase abstract class for the columns/data iterators impl, add SubTabel renderer, fix Iterators
Modified: root/ui-sandbox/trunk/components/tables/ui/src/main/config/component/tables.xml
===================================================================
--- root/ui-sandbox/trunk/components/tables/ui/src/main/config/component/tables.xml 2009-10-23 07:17:21 UTC (rev 15749)
+++ root/ui-sandbox/trunk/components/tables/ui/src/main/config/component/tables.xml 2009-10-23 16:29:45 UTC (rev 15750)
@@ -96,5 +96,25 @@
<test/>
</tag>
</component>
-
+ <component>
+ <name>org.richfaces.SubTable</name>
+ <family>org.richfaces.SubTable</family>
+ <classname>org.richfaces.component.html.HtmlSubTable</classname>
+ <superclass>org.richfaces.component.UISubTable</superclass>
+ <test/>
+ <description>
+ </description>
+ <renderer generate="false" override="false">
+ <name>org.richfaces.renderkit.SubTableRenderer</name>
+ <classname>org.richfaces.renderkit.SubTableRenderer</classname>
+ </renderer>
+ <tag>
+ <name>subTable</name>
+ <classname>org.richfaces.taglib.SubTableTag</classname>
+ <superclass>
+ org.ajax4jsf.webapp.taglib.HtmlComponentTagBase
+ </superclass>
+ <test/>
+ </tag>
+ </component>
</components>
\ No newline at end of file
Modified: 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 2009-10-23 07:17:21 UTC (rev 15749)
+++ root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/ColumnsIterator.java 2009-10-23 16:29:45 UTC (rev 15750)
@@ -21,7 +21,6 @@
package org.richfaces.component;
import java.util.Iterator;
-import java.util.NoSuchElementException;
import javax.faces.component.UIColumn;
import javax.faces.component.UIComponent;
@@ -31,13 +30,9 @@
* @author asmirnov
*
*/
-class ColumnsIterator implements Iterator <javax.faces.component.UIColumn> {
+class ColumnsIterator extends IteratorBase<javax.faces.component.UIColumn> {
- private javax.faces.component.UIColumn next;
-
- private boolean initialized = false;
-
protected Iterator<UIComponent> childrenIterator;
@@ -45,28 +40,7 @@
this.childrenIterator = dataTable.getChildren().iterator();
}
- public boolean hasNext() {
- if(!initialized){
- next = nextColumn();
- initialized = true;
- }
- return null != next;
- }
-
- public javax.faces.component.UIColumn next() {
- if (!hasNext()) {
- throw new NoSuchElementException();
- }
- javax.faces.component.UIColumn result = next;
- next = nextColumn();
- return result;
- }
-
- public void remove() {
- throw new UnsupportedOperationException("Iterator is read-only");
- }
-
- protected javax.faces.component.UIColumn nextColumn(){
+ protected javax.faces.component.UIColumn nextComponent(){
while (childrenIterator != null && childrenIterator.hasNext()) {
UIComponent child = childrenIterator.next();
if(child instanceof javax.faces.component.UIColumn){
Modified: 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 2009-10-23 07:17:21 UTC (rev 15749)
+++ root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/DataIterator.java 2009-10-23 16:29:45 UTC (rev 15750)
@@ -24,7 +24,7 @@
import javax.faces.component.UIComponent;
-class DataIterator implements Iterator <UIComponent> {
+class DataIterator extends IteratorBase <UIComponent> {
private Iterator<UIComponent> facetsIterator;
@@ -36,28 +36,25 @@
this.facetsIterator = dataTable.getFacets().values().iterator();
}
- public boolean hasNext() {
- return (facetsIterator.hasNext() || childrenIterator.hasNext());
- }
-
- public UIComponent next() {
- UIComponent next = null;
-
- while (next == null && childrenIterator.hasNext()) {
- UIComponent child = (UIComponent) childrenIterator.next();
+ protected UIComponent nextComponent() {
+ UIComponent nextColumn = null;
+ while (nextColumn == null && childrenIterator.hasNext()) {
+ UIComponent child = childrenIterator.next();
if((child instanceof UIColumn) && child.isRendered()) {
- next = child;
+ nextColumn = child;
+ } else if(checkAjaxComponent(child)) {
+ nextColumn = child;
}
}
- while (next == null && facetsIterator.hasNext()) {
- UIComponent child = (UIComponent) facetsIterator.next();
- if(child.isRendered()) {
- next = child;
+ while (nextColumn == null && facetsIterator.hasNext()) {
+ UIComponent component = facetsIterator.next();
+ if(checkAjaxComponent(component)){
+ nextColumn = component;
}
}
- return next;
+ return nextColumn;
}
protected Iterator<UIComponent> getFacetsIterator() {
@@ -68,7 +65,8 @@
return this.childrenIterator;
}
- public void remove() {
- throw new UnsupportedOperationException("Iterator is read-only");
+ protected boolean checkAjaxComponent(UIComponent child) {
+ return false;
}
+
}
Modified: 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 2009-10-23 07:17:21 UTC (rev 15749)
+++ root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/FixedChildrenIterator.java 2009-10-23 16:29:45 UTC (rev 15750)
@@ -34,7 +34,7 @@
}
@Override
- public UIComponent next() {
+ protected UIComponent nextComponent() {
UIComponent next = null;
if(currentColumnIterator != null && currentColumnIterator.hasNext()) {
@@ -44,11 +44,13 @@
if(next == null) {
Iterator <UIComponent> childrenIterator = getChildrenIterator();
- while(childrenIterator.hasNext()) {
+ while(next == null && childrenIterator.hasNext()) {
UIComponent child = childrenIterator.next();
if((child instanceof UIColumn) && child.isRendered()) {
- currentColumnIterator = getChildrenIterator(child);
- next = next();
+ currentColumnIterator = getChildFacetIterator(child);
+ next = nextComponent();
+ } else if(checkAjaxComponent(child)) {
+ next = child;
}
}
}
@@ -56,7 +58,6 @@
if (next == null) {
next = getNextFacet();
}
-
return next;
}
@@ -74,8 +75,8 @@
}
}
- protected Iterator<UIComponent> getChildrenIterator(UIComponent component) {
- return component.getChildren().iterator();
+ 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/IteratorBase.java
===================================================================
--- root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/IteratorBase.java (rev 0)
+++ root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/IteratorBase.java 2009-10-23 16:29:45 UTC (rev 15750)
@@ -0,0 +1,39 @@
+package org.richfaces.component;
+
+import java.util.Iterator;
+import java.util.NoSuchElementException;
+
+/**
+ * @author Anton Belevich
+ *
+ */
+public abstract class IteratorBase<E> implements Iterator<E> {
+
+ private boolean initialized = false;
+
+ private E next;
+
+
+ public boolean hasNext() {
+ if(!initialized){
+ next = nextComponent();
+ initialized = true;
+ }
+ return null != next;
+ }
+
+ public E next() {
+ if (!hasNext()) {
+ throw new NoSuchElementException();
+ }
+ E result = next;
+ next = nextComponent();
+ return result;
+ }
+
+ public void remove() {
+ throw new UnsupportedOperationException("Iterator is read-only");
+ }
+
+ abstract protected E nextComponent();
+}
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 2009-10-23 07:17:21 UTC (rev 15749)
+++ root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/component/UIDataTable.java 2009-10-23 16:29:45 UTC (rev 15750)
@@ -11,6 +11,17 @@
return new ColumnsIterator(this);
}
+ @Override
+ protected Iterator<UIComponent> fixedChildren() {
+ return new FixedChildrenIterator(this);
+ }
+
+ @Override
+ protected Iterator<UIComponent> dataChildren() {
+
+ return new DataIterator(this);
+ }
+
public UIComponent getHeader() {
return getFacet("header");
}
@@ -23,4 +34,5 @@
return getFacet("caption");
}
+
}
Modified: root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/SimpleColgroupRenderer.java
===================================================================
--- root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/SimpleColgroupRenderer.java 2009-10-23 07:17:21 UTC (rev 15749)
+++ root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/SimpleColgroupRenderer.java 2009-10-23 16:29:45 UTC (rev 15750)
@@ -70,8 +70,8 @@
Map<String, Object> requestMap = context.getExternalContext().getRequestMap();
while (iter.hasNext()) {
+
UIColumn column = iter.next();
-
if (column instanceof Column) {
boolean breakBefore = ((Column) column).isBreakBefore();
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 2009-10-23 07:17:21 UTC (rev 15749)
+++ root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/SubTableRenderer.java 2009-10-23 16:29:45 UTC (rev 15750)
@@ -1,5 +1,4 @@
/**
- * License Agreement.
*
* JBoss RichFaces - Ajax4jsf Component Library
*
@@ -39,36 +38,23 @@
*/
public class SubTableRenderer extends AbstractTableRenderer {
- /*
- * (non-Javadoc)
- *
- * @see org.ajax4jsf.renderkit.RendererBase#doEncodeBegin(javax.faces.context.ResponseWriter,
- * javax.faces.context.FacesContext, javax.faces.component.UIComponent)
- */
- protected void doEncodeBegin(ResponseWriter writer, FacesContext context,
- UIComponent component) throws IOException {
+ protected void doEncodeBegin(ResponseWriter writer, FacesContext context, UIComponent component) throws IOException {
encodeHeaderRow(writer, context, component,"header");
}
/**
* Encode one row with header/footer facets from columns.
- * @param writer
- * @param context
- * @param component
- * @param facetName
- * @throws IOException
*/
private void encodeHeaderRow(ResponseWriter writer, FacesContext context, UIComponent component,String facetName) throws IOException {
UIDataTable dataTable = (UIDataTable) component;
- Iterator<UIColumn> columns = dataTable.columns();//columnFacets(dataTable,facetName);
int colCount = getColumnsCount(dataTable);
- String headerClass = (String) component.getAttributes().get(
- facetName+"Class");
+ String headerClass = (String) component.getAttributes().get(facetName+"Class");
+
if (isColumnFacetPresent(dataTable, facetName)) {
writer.startElement(HTML.TR_ELEMENT, dataTable);
- encodeStyleClass(writer, null, "rich-subtable-"+facetName, null, headerClass);
- encodeHeaderFacets(context, writer, columns, "rich-subtable-"+facetName+"cell", headerClass,
- facetName, "td",colCount);
+ encodeStyleClass(writer, null, "rich-subtable-"+facetName, null, headerClass);
+ Iterator<UIColumn> columns = dataTable.columns();
+ encodeHeaderFacets(context, writer, columns, "rich-subtable-"+facetName+"cell", headerClass, facetName, "td",colCount);
writer.endElement(HTML.TR_ELEMENT);
}
}
@@ -78,43 +64,23 @@
//stub for test only!!
}
- /*
- * (non-Javadoc)
- *
- * @see org.ajax4jsf.renderkit.RendererBase#doEncodeEnd(javax.faces.context.ResponseWriter,
- * javax.faces.context.FacesContext, javax.faces.component.UIComponent)
- */
- protected void doEncodeEnd(ResponseWriter writer, FacesContext context,
- UIComponent component) throws IOException {
+ protected void doEncodeEnd(ResponseWriter writer, FacesContext context, UIComponent component) throws IOException {
encodeHeaderRow(writer, context, component,"footer");
}
- /**
- * @return
- */
protected String getRowSkinClass() {
return "rich-subtable-row";
}
- /**
- * @return
- */
+
protected String getFirstRowSkinClass() {
return "rich-subtable-firstrow";
}
- /* (non-Javadoc)
- * @see org.richfaces.renderkit.AbstractTableRenderer#getCellSkinClass()
- */
protected String getCellSkinClass() {
return "rich-subtable-cell";
}
- /*
- * (non-Javadoc)
- *
- * @see org.ajax4jsf.renderkit.RendererBase#getComponentClass()
- */
+
protected Class<? extends UIComponent> getComponentClass() {
- // TODO Auto-generated method stub
return UISubTable.class;
}
@@ -124,30 +90,21 @@
}
@Override
- public void encodeTBody(FacesContext context, UIDataTable table)
- throws IOException {
- // TODO Auto-generated method stub
-
+ public void encodeTBody(FacesContext context, UIDataTable table) throws IOException {
}
@Override
- public void doProcess(FacesContext facesContext, TableHolder holder)
- throws IOException {
- // TODO Auto-generated method stub
-
+ public void doProcess(FacesContext facesContext, TableHolder holder) throws IOException {
+ System.out.println("SubTableRenderer.doProcess()");
}
@Override
- public void encodeCell(FacesContext context, UIComponent cell)
- throws IOException {
- // TODO Auto-generated method stub
-
+ public void encodeCell(FacesContext context, UIComponent cell) throws IOException {
+ System.out.println("SubTableRenderer.encodeCell()");
}
@Override
- public void encodeOneRow(FacesContext context, TableHolder holder)
- throws IOException {
- // TODO Auto-generated method stub
-
+ public void encodeOneRow(FacesContext context, TableHolder holder) throws IOException {
+ System.out.println("SubTableRenderer.encodeOneRow()");
}
}
Modified: root/ui-sandbox/trunk/components/tables/ui/src/main/resources/META-INF/faces-config.xml
===================================================================
--- root/ui-sandbox/trunk/components/tables/ui/src/main/resources/META-INF/faces-config.xml 2009-10-23 07:17:21 UTC (rev 15749)
+++ root/ui-sandbox/trunk/components/tables/ui/src/main/resources/META-INF/faces-config.xml 2009-10-23 16:29:45 UTC (rev 15750)
@@ -20,8 +20,11 @@
<component-type>org.richfaces.Colgroup</component-type>
<component-class>org.richfaces.component.html.HtmlColumnGroup</component-class>
</component>
+ <component>
+ <component-type>org.richfaces.SubTable</component-type>
+ <component-class>org.richfaces.component.html.HtmlSubTable</component-class>
+ </component>
-
<render-kit>
<render-kit-id>HTML_BASIC</render-kit-id>
<renderer>
Modified: root/ui-sandbox/trunk/components/tables/ui/src/main/resources/META-INF/tables.taglib.xml
===================================================================
--- root/ui-sandbox/trunk/components/tables/ui/src/main/resources/META-INF/tables.taglib.xml 2009-10-23 07:17:21 UTC (rev 15749)
+++ root/ui-sandbox/trunk/components/tables/ui/src/main/resources/META-INF/tables.taglib.xml 2009-10-23 16:29:45 UTC (rev 15750)
@@ -30,4 +30,11 @@
<renderer-type>org.richfaces.ColumnGroupRenderer</renderer-type>
</component>
</tag>
+ <tag>
+ <tag-name>subTable</tag-name>
+ <component>
+ <component-type>org.richfaces.SubTable</component-type>
+ <renderer-type>org.richfaces.renderkit.SubTableRenderer</renderer-type>
+ </component>
+ </tag>
</facelet-taglib>
15 years, 2 months
JBoss Rich Faces SVN: r15749 - in root/docs/trunk: Component_Reference and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: SeanRogers
Date: 2009-10-23 03:17:21 -0400 (Fri, 23 Oct 2009)
New Revision: 15749
Modified:
root/docs/trunk/Component_Development_Kit_Guide/Makefile
root/docs/trunk/Component_Reference/Makefile
root/docs/trunk/Developer_Guide/Makefile
Log:
Changed brand on other makefiles
Modified: root/docs/trunk/Component_Development_Kit_Guide/Makefile
===================================================================
--- root/docs/trunk/Component_Development_Kit_Guide/Makefile 2009-10-23 07:15:27 UTC (rev 15748)
+++ root/docs/trunk/Component_Development_Kit_Guide/Makefile 2009-10-23 07:17:21 UTC (rev 15749)
@@ -3,7 +3,6 @@
XML_LANG = en-US
DOCNAME = Component_Development_Kit_Guide
PRODUCT = RichFaces
-BRAND = JBoss
#OTHER_LANGS = as-IN bn-IN de-DE es-ES fr-FR gu-IN hi-IN it-IT ja-JP kn-IN ko-KR ml-IN mr-IN or-IN pa-IN pt-BR ru-RU si-LK ta-IN te-IN zh-CN zh-TW
Modified: root/docs/trunk/Component_Reference/Makefile
===================================================================
--- root/docs/trunk/Component_Reference/Makefile 2009-10-23 07:15:27 UTC (rev 15748)
+++ root/docs/trunk/Component_Reference/Makefile 2009-10-23 07:17:21 UTC (rev 15749)
@@ -2,8 +2,7 @@
XML_LANG = en-US
DOCNAME = Component_Reference
-PRODUCT = RichFaces
-BRAND = JBoss
+PRODUCT = RichFaces
#OTHER_LANGS = as-IN bn-IN de-DE es-ES fr-FR gu-IN hi-IN it-IT ja-JP kn-IN ko-KR ml-IN mr-IN or-IN pa-IN pt-BR ru-RU si-LK ta-IN te-IN zh-CN zh-TW
Modified: root/docs/trunk/Developer_Guide/Makefile
===================================================================
--- root/docs/trunk/Developer_Guide/Makefile 2009-10-23 07:15:27 UTC (rev 15748)
+++ root/docs/trunk/Developer_Guide/Makefile 2009-10-23 07:17:21 UTC (rev 15749)
@@ -3,7 +3,6 @@
XML_LANG = en-US
DOCNAME = Developer_Guide
PRODUCT = RichFaces
-BRAND = JBoss
#OTHER_LANGS = as-IN bn-IN de-DE es-ES fr-FR gu-IN hi-IN it-IT ja-JP kn-IN ko-KR ml-IN mr-IN or-IN pa-IN pt-BR ru-RU si-LK ta-IN te-IN zh-CN zh-TW
15 years, 2 months
JBoss Rich Faces SVN: r15748 - in root/docs/trunk: Component_Development_Kit_Guide/en-US/images and 7 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: SeanRogers
Date: 2009-10-23 03:15:27 -0400 (Fri, 23 Oct 2009)
New Revision: 15748
Added:
root/docs/trunk/Component_Development_Kit_Guide/en-US/images/rf_logo.png
root/docs/trunk/Component_Reference/en-US/images/rf_logo.png
root/docs/trunk/Developer_Guide/en-US/images/rf_logo.png
root/docs/trunk/Migration_Guide/en-US/images/rf_logo.png
Modified:
root/docs/trunk/Component_Development_Kit_Guide/en-US/Book_Info.xml
root/docs/trunk/Component_Reference/en-US/Book_Info.xml
root/docs/trunk/Developer_Guide/en-US/Book_Info.xml
root/docs/trunk/Migration_Guide/Makefile
root/docs/trunk/Migration_Guide/en-US/Book_Info.xml
root/docs/trunk/Migration_Guide/en-US/Changes_and_new_features.xml
Log:
Changed brand and added logo (RF-8038)
Modified: root/docs/trunk/Component_Development_Kit_Guide/en-US/Book_Info.xml
===================================================================
--- root/docs/trunk/Component_Development_Kit_Guide/en-US/Book_Info.xml 2009-10-23 05:01:21 UTC (rev 15747)
+++ root/docs/trunk/Component_Development_Kit_Guide/en-US/Book_Info.xml 2009-10-23 07:15:27 UTC (rev 15748)
@@ -13,22 +13,23 @@
<abstract>
<para>This book details how to use the RichFaces Component Development
Kit to create custom components for use with the RichFaces &VERSION;
-framework.</para></abstract>
- <corpauthor>
- <inlinemediaobject>
- <imageobject>
- <imagedata fileref="Common_Content/images/title_logo.svg" format="SVG" />
- </imageobject>
- <textobject>
- <phrase>Logo</phrase>
- </textobject>
- </inlinemediaobject>
- </corpauthor>
- <copyright>
- <year>&YEAR;</year>
- <holder>&HOLDER;</holder>
- </copyright>
- <xi:include href="Common_Content/Legal_Notice.xml" xmlns:xi="http://www.w3.org/2001/XInclude"></xi:include>
- <xi:include href="Author_Group.xml" xmlns:xi="http://www.w3.org/2001/XInclude"></xi:include>
- </bookinfo>
+framework.</para>
+ </abstract>
+ <corpauthor>
+ <inlinemediaobject>
+ <imageobject>
+ <imagedata fileref="./images/rf_logo.png" format="PNG" />
+ </imageobject>
+ <textobject>
+ <phrase>Logo</phrase>
+ </textobject>
+ </inlinemediaobject>
+ </corpauthor>
+ <copyright>
+ <year>&YEAR;</year>
+ <holder>&HOLDER;</holder>
+ </copyright>
+ <xi:include href="Common_Content/Legal_Notice.xml" xmlns:xi="http://www.w3.org/2001/XInclude"></xi:include>
+ <xi:include href="Author_Group.xml" xmlns:xi="http://www.w3.org/2001/XInclude"></xi:include>
+</bookinfo>
Added: root/docs/trunk/Component_Development_Kit_Guide/en-US/images/rf_logo.png
===================================================================
(Binary files differ)
Property changes on: root/docs/trunk/Component_Development_Kit_Guide/en-US/images/rf_logo.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: root/docs/trunk/Component_Reference/en-US/Book_Info.xml
===================================================================
--- root/docs/trunk/Component_Reference/en-US/Book_Info.xml 2009-10-23 05:01:21 UTC (rev 15747)
+++ root/docs/trunk/Component_Reference/en-US/Book_Info.xml 2009-10-23 07:15:27 UTC (rev 15748)
@@ -12,22 +12,23 @@
<pubsnumber>0</pubsnumber>
<abstract>
<para>This book details each component in the RichFaces &VERSION; framework,
-including examples of their use in applications.</para></abstract>
- <corpauthor>
- <inlinemediaobject>
- <imageobject>
- <imagedata fileref="Common_Content/images/title_logo.svg" format="SVG" />
- </imageobject>
- <textobject>
- <phrase>Logo</phrase>
- </textobject>
- </inlinemediaobject>
- </corpauthor>
- <copyright>
- <year>&YEAR;</year>
- <holder>&HOLDER;</holder>
- </copyright>
- <xi:include href="Common_Content/Legal_Notice.xml" xmlns:xi="http://www.w3.org/2001/XInclude"></xi:include>
- <xi:include href="Author_Group.xml" xmlns:xi="http://www.w3.org/2001/XInclude"></xi:include>
- </bookinfo>
+including examples of their use in applications.</para>
+ </abstract>
+ <corpauthor>
+ <inlinemediaobject>
+ <imageobject>
+ <imagedata fileref="./images/rf_logo.png" format="PNG" />
+ </imageobject>
+ <textobject>
+ <phrase>Logo</phrase>
+ </textobject>
+ </inlinemediaobject>
+ </corpauthor>
+ <copyright>
+ <year>&YEAR;</year>
+ <holder>&HOLDER;</holder>
+ </copyright>
+ <xi:include href="Common_Content/Legal_Notice.xml" xmlns:xi="http://www.w3.org/2001/XInclude"></xi:include>
+ <xi:include href="Author_Group.xml" xmlns:xi="http://www.w3.org/2001/XInclude"></xi:include>
+</bookinfo>
Added: root/docs/trunk/Component_Reference/en-US/images/rf_logo.png
===================================================================
(Binary files differ)
Property changes on: root/docs/trunk/Component_Reference/en-US/images/rf_logo.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: root/docs/trunk/Developer_Guide/en-US/Book_Info.xml
===================================================================
--- root/docs/trunk/Developer_Guide/en-US/Book_Info.xml 2009-10-23 05:01:21 UTC (rev 15747)
+++ root/docs/trunk/Developer_Guide/en-US/Book_Info.xml 2009-10-23 07:15:27 UTC (rev 15748)
@@ -14,22 +14,23 @@
<para>This book is a comprehensive reference for getting started and
working with RichFaces &VERSION;. It includes details of the
architecture, the framework's use in different applications,
-and skinning implementations.</para></abstract>
- <corpauthor>
- <inlinemediaobject>
- <imageobject>
- <imagedata fileref="Common_Content/images/title_logo.svg" format="SVG" />
- </imageobject>
- <textobject>
- <phrase>Logo</phrase>
- </textobject>
- </inlinemediaobject>
- </corpauthor>
- <copyright>
- <year>&YEAR;</year>
- <holder>&HOLDER;</holder>
- </copyright>
- <xi:include href="Common_Content/Legal_Notice.xml" xmlns:xi="http://www.w3.org/2001/XInclude"></xi:include>
- <xi:include href="Author_Group.xml" xmlns:xi="http://www.w3.org/2001/XInclude"></xi:include>
- </bookinfo>
+and skinning implementations.</para>
+ </abstract>
+ <corpauthor>
+ <inlinemediaobject>
+ <imageobject>
+ <imagedata fileref="./images/rf_logo.png" format="PNG" />
+ </imageobject>
+ <textobject>
+ <phrase>Logo</phrase>
+ </textobject>
+ </inlinemediaobject>
+ </corpauthor>
+ <copyright>
+ <year>&YEAR;</year>
+ <holder>&HOLDER;</holder>
+ </copyright>
+ <xi:include href="Common_Content/Legal_Notice.xml" xmlns:xi="http://www.w3.org/2001/XInclude"></xi:include>
+ <xi:include href="Author_Group.xml" xmlns:xi="http://www.w3.org/2001/XInclude"></xi:include>
+</bookinfo>
Added: root/docs/trunk/Developer_Guide/en-US/images/rf_logo.png
===================================================================
(Binary files differ)
Property changes on: root/docs/trunk/Developer_Guide/en-US/images/rf_logo.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: root/docs/trunk/Migration_Guide/Makefile
===================================================================
--- root/docs/trunk/Migration_Guide/Makefile 2009-10-23 05:01:21 UTC (rev 15747)
+++ root/docs/trunk/Migration_Guide/Makefile 2009-10-23 07:15:27 UTC (rev 15748)
@@ -3,7 +3,6 @@
XML_LANG = en-US
DOCNAME = Migration_Guide
PRODUCT = RichFaces
-BRAND = JBoss
#OTHER_LANGS = as-IN bn-IN de-DE es-ES fr-FR gu-IN hi-IN it-IT ja-JP kn-IN ko-KR ml-IN mr-IN or-IN pa-IN pt-BR ru-RU si-LK ta-IN te-IN zh-CN zh-TW
Modified: root/docs/trunk/Migration_Guide/en-US/Book_Info.xml
===================================================================
--- root/docs/trunk/Migration_Guide/en-US/Book_Info.xml 2009-10-23 05:01:21 UTC (rev 15747)
+++ root/docs/trunk/Migration_Guide/en-US/Book_Info.xml 2009-10-23 07:15:27 UTC (rev 15748)
@@ -7,29 +7,30 @@
<subtitle>Migrating existing projects to RichFaces &VERSION_LONG;<remark> (draft)</remark>
</subtitle>
<productname>RichFaces</productname>
- <productnumber>&VERSION;</productnumber>
+ <productnumber>4.0</productnumber>
<edition>0.1</edition>
<pubsnumber>0</pubsnumber>
<abstract>
<para>This book details how to take an existing RichFaces project and
upgrade it for use with RichFaces &VERSION;. It covers changes in
component usage and behaviors, as well as new framework features
-which may affect existing RichFaces projects.</para></abstract>
- <corpauthor>
- <inlinemediaobject>
- <imageobject>
- <imagedata fileref="Common_Content/images/title_logo.svg" format="SVG" />
- </imageobject>
- <textobject>
- <phrase>Logo</phrase>
- </textobject>
- </inlinemediaobject>
- </corpauthor>
- <copyright>
- <year>&YEAR;</year>
- <holder>&HOLDER;</holder>
- </copyright>
- <xi:include href="Common_Content/Legal_Notice.xml" xmlns:xi="http://www.w3.org/2001/XInclude"></xi:include>
- <xi:include href="Author_Group.xml" xmlns:xi="http://www.w3.org/2001/XInclude"></xi:include>
- </bookinfo>
+which may affect existing RichFaces projects.</para>
+ </abstract>
+ <corpauthor>
+ <inlinemediaobject>
+ <imageobject>
+ <imagedata fileref="./images/rf_logo.png" format="PNG" />
+ </imageobject>
+ <textobject>
+ <phrase>Logo</phrase>
+ </textobject>
+ </inlinemediaobject>
+ </corpauthor>
+ <copyright>
+ <year>&YEAR;</year>
+ <holder>&HOLDER;</holder>
+ </copyright>
+ <xi:include href="Common_Content/Legal_Notice.xml" xmlns:xi="http://www.w3.org/2001/XInclude"></xi:include>
+ <xi:include href="Author_Group.xml" xmlns:xi="http://www.w3.org/2001/XInclude"></xi:include>
+</bookinfo>
Modified: root/docs/trunk/Migration_Guide/en-US/Changes_and_new_features.xml
===================================================================
--- root/docs/trunk/Migration_Guide/en-US/Changes_and_new_features.xml 2009-10-23 05:01:21 UTC (rev 15747)
+++ root/docs/trunk/Migration_Guide/en-US/Changes_and_new_features.xml 2009-10-23 07:15:27 UTC (rev 15748)
@@ -1125,14 +1125,14 @@
</para>
</section>
- <!--
+ <!--
<section>
<title><classname><a4j:jsFunction></classname></title>
<para>
</para>
</section>
- -->
+ -->
<section id="sect-Migration_Guide-Feature_changes-a4jlog">
<title><classname><a4j:log></classname></title>
<para>
@@ -1195,14 +1195,14 @@
</para>
</section>
- <!--
+ <!--
<section>
<title><classname><a4j:region></classname></title>
<para>
</para>
</section>
- -->
+ -->
<section id="sect-Migration_Guide-Feature_changes-a4jstatus">
<title><classname><a4j:status></classname></title>
<para>
@@ -1270,7 +1270,7 @@
<para>
Several new components and behaviors have been added to RichFaces &VERSION;, some of which replace the functionality of deprecated elements. For full details on how to use these new components and behaviors, refer to the <citetitle>Developer Guide</citetitle>.
</para>
- <!-- dataTable, dataLists, trees possibly included here as they may be consolidated -->
+ <!-- dataTable, dataLists, trees possibly included here as they may be consolidated -->
<section id="sect-Migration_Guide-New_components_and_behaviors-a4jajax">
<title><classname><a4j:ajax></classname></title>
<para>
Added: root/docs/trunk/Migration_Guide/en-US/images/rf_logo.png
===================================================================
(Binary files differ)
Property changes on: root/docs/trunk/Migration_Guide/en-US/images/rf_logo.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
15 years, 2 months