JBoss Rich Faces SVN: r17106 - root/cdk/trunk/bom.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2010-05-18 15:21:36 -0400 (Tue, 18 May 2010)
New Revision: 17106
Modified:
root/cdk/trunk/bom/pom.xml
Log:
inherit project build from the root pom
Modified: root/cdk/trunk/bom/pom.xml
===================================================================
--- root/cdk/trunk/bom/pom.xml 2010-05-18 18:53:36 UTC (rev 17105)
+++ root/cdk/trunk/bom/pom.xml 2010-05-18 19:21:36 UTC (rev 17106)
@@ -9,6 +9,11 @@
all global properties: distribution management, license, developers,
company ...
-->
+ <parent>
+ <groupId>org.richfaces</groupId>
+ <artifactId>richfaces-parent</artifactId>
+ <version>1-SNAPSHOT</version>
+ </parent>
<modelVersion>4.0.0</modelVersion>
@@ -23,25 +28,6 @@
<developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/root/cdk/trunk/bom</developerConnection>
<url>http://fisheye.jboss.org/browse/Richfaces/cdk/trunk/bom</url>
</scm>
- <distributionManagement>
- <downloadUrl>
- http://labs.jboss.com/portal/jbossrichfaces/downloads
- </downloadUrl>
- <repository>
- <id>jboss-releases-repository</id>
- <uniqueVersion>false</uniqueVersion>
- <url>${releaseRepository}</url>
- </repository>
- <snapshotRepository>
- <id>jboss-snapshots-repository</id>
- <uniqueVersion>true</uniqueVersion>
- <url>${snapshotRepository}</url>
- </snapshotRepository>
- <!--
- site> <url>file:target/site2</url> </site
- -->
- </distributionManagement>
-
<build>
<!-- Define CDK plugin that is used by JSF component projects -->
<pluginManagement>
14 years, 5 months
JBoss Rich Faces SVN: r17105 - in root: commons/trunk/parent and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: jbalunas(a)redhat.com
Date: 2010-05-18 14:53:36 -0400 (Tue, 18 May 2010)
New Revision: 17105
Modified:
root/build/parent/trunk/pom.xml
root/commons/trunk/parent/pom.xml
root/core/trunk/parent/pom.xml
Log:
Needed to move richfaces-checkstyle version dependency out of richfaces-parent. Can not release richfaces-parent with snapshot version of checkstyle. This also allows modules to determine on their own what version of richfaces-checkstyle to use ( not that this is likely to change often ).
Modified: root/build/parent/trunk/pom.xml
===================================================================
--- root/build/parent/trunk/pom.xml 2010-05-18 18:25:29 UTC (rev 17104)
+++ root/build/parent/trunk/pom.xml 2010-05-18 18:53:36 UTC (rev 17105)
@@ -58,7 +58,6 @@
</issueManagement>
<properties>
- <richfaces.checkstyle.version>4.0.0-SNAPSHOT</richfaces.checkstyle.version>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>
@@ -234,15 +233,6 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>2.3</version>
- <dependencies>
- <dependency>
- <groupId>org.richfaces</groupId>
- <artifactId>richfaces-build-checkstyle
- </artifactId>
- <version>${richfaces.checkstyle.version}
- </version>
- </dependency>
- </dependencies>
<configuration>
<configLocation>richfaces-checkstyle/richfaces-checkstyle.xml
</configLocation>
Modified: root/commons/trunk/parent/pom.xml
===================================================================
--- root/commons/trunk/parent/pom.xml 2010-05-18 18:25:29 UTC (rev 17104)
+++ root/commons/trunk/parent/pom.xml 2010-05-18 18:53:36 UTC (rev 17105)
@@ -1,21 +1,19 @@
<!--
- JBoss, Home of Professional Open Source Copyright 2010, 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.
+ JBoss, Home of Professional Open Source Copyright 2010, 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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
@@ -39,6 +37,7 @@
<properties>
<richfaces.commons.version>4.0.0-SNAPSHOT</richfaces.commons.version>
+ <richfaces.checkstyle.version>4.0.0-SNAPSHOT</richfaces.checkstyle.version>
</properties>
<dependencyManagement>
@@ -59,4 +58,24 @@
</dependency>
</dependencies>
</dependencyManagement>
+
+ <build>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <!-- Configure checkstyle report for this module -->
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ <dependencies>
+ <dependency>
+ <groupId>org.richfaces</groupId>
+ <artifactId>richfaces-build-checkstyle
+ </artifactId>
+ <version>${richfaces.checkstyle.version}
+ </version>
+ </dependency>
+ </dependencies>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
</project>
\ No newline at end of file
Modified: root/core/trunk/parent/pom.xml
===================================================================
--- root/core/trunk/parent/pom.xml 2010-05-18 18:25:29 UTC (rev 17104)
+++ root/core/trunk/parent/pom.xml 2010-05-18 18:53:36 UTC (rev 17105)
@@ -39,6 +39,7 @@
<properties>
<richfaces.core.version>4.0.0-SNAPSHOT</richfaces.core.version>
+ <richfaces.checkstyle.version>4.0.0-SNAPSHOT</richfaces.checkstyle.version>
</properties>
<dependencyManagement>
@@ -80,4 +81,24 @@
</dependency>
</dependencies>
</dependencyManagement>
+
+ <build>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <!-- Configure checkstyle report for this module -->
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ <dependencies>
+ <dependency>
+ <groupId>org.richfaces</groupId>
+ <artifactId>richfaces-build-checkstyle
+ </artifactId>
+ <version>${richfaces.checkstyle.version}
+ </version>
+ </dependency>
+ </dependencies>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
</project>
\ No newline at end of file
14 years, 5 months
JBoss Rich Faces SVN: r17104 - root/build/parent/trunk.
by richfaces-svn-commits@lists.jboss.org
Author: jbalunas(a)redhat.com
Date: 2010-05-18 14:25:29 -0400 (Tue, 18 May 2010)
New Revision: 17104
Modified:
root/build/parent/trunk/pom.xml
Log:
removed unneeded version #, this is set my jboss-parent
Modified: root/build/parent/trunk/pom.xml
===================================================================
--- root/build/parent/trunk/pom.xml 2010-05-18 18:14:47 UTC (rev 17103)
+++ root/build/parent/trunk/pom.xml 2010-05-18 18:25:29 UTC (rev 17104)
@@ -144,7 +144,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
- <version>${version.release.plugin}</version>
<configuration>
<!-- All sub-modules will have same version -->
<autoVersionSubmodules>true</autoVersionSubmodules>
14 years, 5 months
JBoss Rich Faces SVN: r17103 - root/build/parent/trunk.
by richfaces-svn-commits@lists.jboss.org
Author: jbalunas(a)redhat.com
Date: 2010-05-18 14:14:47 -0400 (Tue, 18 May 2010)
New Revision: 17103
Modified:
root/build/parent/trunk/pom.xml
Log:
Set inherited=false for richfaces-parent release plugin
Modified: root/build/parent/trunk/pom.xml
===================================================================
--- root/build/parent/trunk/pom.xml 2010-05-18 17:55:44 UTC (rev 17102)
+++ root/build/parent/trunk/pom.xml 2010-05-18 18:14:47 UTC (rev 17103)
@@ -296,6 +296,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
+ <inherited>false</inherited>
</plugin>
</plugins>
</build>
14 years, 5 months
JBoss Rich Faces SVN: r17102 - in root: core/trunk/api/src/main/java/org/richfaces/event and 5 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-05-18 13:55:44 -0400 (Tue, 18 May 2010)
New Revision: 17102
Added:
root/core/trunk/api/src/main/java/org/richfaces/component/MetaComponentEncoder.java
root/core/trunk/api/src/main/java/org/richfaces/event/PreRenderMetaComponentEvent.java
Modified:
root/core/trunk/api/src/main/java/org/richfaces/renderkit/MetaComponentRenderer.java
root/core/trunk/impl/src/main/java/org/richfaces/component/UIDataAdaptor.java
root/core/trunk/impl/src/main/java/org/richfaces/component/UISequence.java
root/core/trunk/impl/src/test/java/org/richfaces/context/AjaxTableComponentImpl.java
root/ui-sandbox/tables/trunk/ui/src/main/java/org/richfaces/component/UIExtendedDataTable.java
root/ui-sandbox/tables/trunk/ui/src/main/java/org/richfaces/renderkit/ExtendedDataTableRenderer.java
Log:
https://jira.jboss.org/browse/RF-7856
Added: root/core/trunk/api/src/main/java/org/richfaces/component/MetaComponentEncoder.java
===================================================================
--- root/core/trunk/api/src/main/java/org/richfaces/component/MetaComponentEncoder.java (rev 0)
+++ root/core/trunk/api/src/main/java/org/richfaces/component/MetaComponentEncoder.java 2010-05-18 17:55:44 UTC (rev 17102)
@@ -0,0 +1,36 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, 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 java.io.IOException;
+
+import javax.faces.context.FacesContext;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public interface MetaComponentEncoder {
+
+ public void encodeMetaComponent(FacesContext context, String metaComponentId) throws IOException;
+
+}
Added: root/core/trunk/api/src/main/java/org/richfaces/event/PreRenderMetaComponentEvent.java
===================================================================
--- root/core/trunk/api/src/main/java/org/richfaces/event/PreRenderMetaComponentEvent.java (rev 0)
+++ root/core/trunk/api/src/main/java/org/richfaces/event/PreRenderMetaComponentEvent.java 2010-05-18 17:55:44 UTC (rev 17102)
@@ -0,0 +1,52 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, 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.event;
+
+import javax.faces.component.UIComponent;
+import javax.faces.event.PreRenderComponentEvent;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public class PreRenderMetaComponentEvent extends PreRenderComponentEvent {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 5755546878106468912L;
+
+ private String metaComponentId;
+
+ public PreRenderMetaComponentEvent(UIComponent component, String metaComponentId) {
+ super(component);
+
+ this.metaComponentId = metaComponentId;
+ }
+
+ /**
+ * @return the metaComponentId
+ */
+ public String getMetaComponentId() {
+ return metaComponentId;
+ }
+}
Modified: root/core/trunk/api/src/main/java/org/richfaces/renderkit/MetaComponentRenderer.java
===================================================================
--- root/core/trunk/api/src/main/java/org/richfaces/renderkit/MetaComponentRenderer.java 2010-05-18 15:27:51 UTC (rev 17101)
+++ root/core/trunk/api/src/main/java/org/richfaces/renderkit/MetaComponentRenderer.java 2010-05-18 17:55:44 UTC (rev 17102)
@@ -32,6 +32,7 @@
*/
public interface MetaComponentRenderer {
- public void encodeMetaComponent(FacesContext context, UIComponent component) throws IOException;
+ public void encodeMetaComponent(FacesContext context, UIComponent component, String metaComponentId)
+ throws IOException;
}
Modified: root/core/trunk/impl/src/main/java/org/richfaces/component/UIDataAdaptor.java
===================================================================
--- root/core/trunk/impl/src/main/java/org/richfaces/component/UIDataAdaptor.java 2010-05-18 15:27:51 UTC (rev 17101)
+++ root/core/trunk/impl/src/main/java/org/richfaces/component/UIDataAdaptor.java 2010-05-18 17:55:44 UTC (rev 17102)
@@ -54,9 +54,13 @@
import javax.faces.convert.Converter;
import javax.faces.convert.ConverterException;
import javax.faces.event.AbortProcessingException;
+import javax.faces.event.ComponentSystemEvent;
+import javax.faces.event.ComponentSystemEventListener;
import javax.faces.event.FacesEvent;
+import javax.faces.event.ListenerFor;
import javax.faces.event.PhaseId;
import javax.faces.event.PostValidateEvent;
+import javax.faces.event.PreRenderComponentEvent;
import javax.faces.event.PreValidateEvent;
import javax.faces.render.Renderer;
@@ -77,8 +81,9 @@
*
* @author shura
*/
+@ListenerFor(systemEventClass = PreRenderComponentEvent.class)
public abstract class UIDataAdaptor extends UIComponentBase implements NamingContainer,
- UniqueIdVendor, IterationStateHolder {
+ UniqueIdVendor, IterationStateHolder, ComponentSystemEventListener {
/**
* <p>The standard component family for this component.</p>
@@ -1086,12 +1091,6 @@
}
@Override
- public void encodeBegin(FacesContext context) throws IOException {
- preEncodeBegin(context);
- super.encodeBegin(context);
- }
-
- @Override
public void markInitialState() {
super.markInitialState();
@@ -1325,13 +1324,8 @@
return !idsToVisit.isEmpty();
}
- private boolean visitComponents(Iterator<UIComponent> components, VisitContext context, VisitCallback callback,
- boolean resetKeyBeforeVisit) {
+ private boolean visitComponents(Iterator<UIComponent> components, VisitContext context, VisitCallback callback) {
- if (resetKeyBeforeVisit) {
- setRowKey(context.getFacesContext(), null);
- }
-
while (components.hasNext()) {
UIComponent nextChild = components.next();
@@ -1343,14 +1337,14 @@
return false;
}
- protected boolean visitFixedChildren(VisitContext visitContext, VisitCallback callback, boolean resetKeyBeforeVisit) {
+ protected boolean visitFixedChildren(VisitContext visitContext, VisitCallback callback) {
- return visitComponents(fixedChildren(), visitContext, callback, resetKeyBeforeVisit);
+ return visitComponents(fixedChildren(), visitContext, callback);
}
- protected boolean visitDataChildren(VisitContext visitContext, VisitCallback callback, boolean resetKeyBeforeVisit) {
+ protected boolean visitDataChildren(VisitContext visitContext, VisitCallback callback, boolean visitRows) {
- if (resetKeyBeforeVisit) {
+ if (visitRows) {
FacesContext facesContext = visitContext.getFacesContext();
DataVisitorForVisitTree dataVisitor = new DataVisitorForVisitTree(callback, visitContext);
@@ -1358,7 +1352,7 @@
return dataVisitor.getVisitResult();
} else {
- return visitComponents(dataChildren(), visitContext, callback, false);
+ return visitComponents(dataChildren(), visitContext, callback);
}
}
@@ -1403,7 +1397,11 @@
// Visit children, short-circuiting as necessary
if ((result == VisitResult.ACCEPT) && doVisitChildren(visitContext, visitRows)) {
- if (visitFixedChildren(visitContext, callback, visitRows)) {
+ if (visitRows) {
+ setRowKey(facesContext, null);
+ }
+
+ if (visitFixedChildren(visitContext, callback)) {
return true;
}
@@ -1418,7 +1416,10 @@
VisitContext directChildrenVisitContext =
extendedVisitContext.createNamingContainerVisitContext(this, directSubtreeIdsToVisit);
- if (visitFixedChildren(directChildrenVisitContext, STUB_CALLBACK, visitRows)) {
+ if (visitRows) {
+ setRowKey(facesContext, null);
+ }
+ if (visitFixedChildren(directChildrenVisitContext, STUB_CALLBACK)) {
return false;
}
}
@@ -1499,4 +1500,17 @@
public abstract void processComponent(FacesContext context, UIComponent c, Object argument);
}
+
+ @Override
+ public void processEvent(ComponentSystemEvent event) throws AbortProcessingException {
+ super.processEvent(event);
+
+ if (event instanceof PreRenderComponentEvent) {
+ preEncodeBegin(getFacesContext());
+ }
+ }
+
+ protected DataComponentState getLocalComponentState() {
+ return componentState;
+ }
}
Modified: root/core/trunk/impl/src/main/java/org/richfaces/component/UISequence.java
===================================================================
--- root/core/trunk/impl/src/main/java/org/richfaces/component/UISequence.java 2010-05-18 15:27:51 UTC (rev 17101)
+++ root/core/trunk/impl/src/main/java/org/richfaces/component/UISequence.java 2010-05-18 17:55:44 UTC (rev 17102)
@@ -30,7 +30,6 @@
import javax.el.ValueExpression;
import javax.faces.context.FacesContext;
import javax.faces.convert.Converter;
-import javax.faces.el.ValueBinding;
import javax.faces.model.ArrayDataModel;
import javax.faces.model.DataModel;
import javax.faces.model.ListDataModel;
@@ -57,11 +56,18 @@
first, rows, value, iterationStatusVar
}
- private void updateSequenceState(SequenceState state) {
+ protected void updateState(SequenceState state) {
state.setFirst(getActualFirst());
state.setRows(getActualRows());
}
+ protected void updateState() {
+ DataComponentState localState = getLocalComponentState();
+ if (localState instanceof SequenceState) {
+ updateState((SequenceState) localState);
+ }
+ }
+
protected int getActualFirst() {
return getFirst();
}
@@ -114,7 +120,7 @@
protected DataComponentState createComponentState() {
SequenceState state = new SequenceState();
- updateSequenceState(state);
+ updateState(state);
return state;
}
@@ -138,6 +144,7 @@
public void setFirst(int first) {
getStateHelper().put(PropertyKeys.first, first);
+ updateState();
}
public int getRows() {
@@ -146,6 +153,7 @@
public void setRows(int rows) {
getStateHelper().put(PropertyKeys.rows, rows);
+ updateState();
}
public Object getValue() {
@@ -234,10 +242,13 @@
}
}
+ @SuppressWarnings("deprecation")
@Override
- public void setValueBinding(String name, ValueBinding binding) {
+ public void setValueBinding(String name, javax.faces.el.ValueBinding binding) {
if ("value".equals(name)) {
resetDataModel();
+ } else if ("first".equals(name) || "rows".equals(name)) {
+ updateState();
}
super.setValueBinding(name, binding);
@@ -247,6 +258,8 @@
public void setValueExpression(String name, ValueExpression binding) {
if ("value".equals(name)) {
resetDataModel();
+ } else if ("first".equals(name) || "rows".equals(name)) {
+ updateState();
}
super.setValueExpression(name, binding);
@@ -256,9 +269,6 @@
protected void preEncodeBegin(FacesContext context) {
super.preEncodeBegin(context);
- DataComponentState componentState = getComponentState();
- if (componentState instanceof SequenceState) {
- updateSequenceState((SequenceState) componentState);
- }
+ updateState();
}
}
Modified: root/core/trunk/impl/src/test/java/org/richfaces/context/AjaxTableComponentImpl.java
===================================================================
--- root/core/trunk/impl/src/test/java/org/richfaces/context/AjaxTableComponentImpl.java 2010-05-18 15:27:51 UTC (rev 17101)
+++ root/core/trunk/impl/src/test/java/org/richfaces/context/AjaxTableComponentImpl.java 2010-05-18 17:55:44 UTC (rev 17102)
@@ -52,17 +52,11 @@
}
@Override
- protected boolean visitFixedChildren(VisitContext visitContext, VisitCallback callback,
- boolean resetKeyBeforeVisit) {
+ protected boolean visitFixedChildren(VisitContext visitContext, VisitCallback callback) {
if (visitContext instanceof ExtendedVisitContext) {
ExtendedVisitContext extendedVisitContext = (ExtendedVisitContext) visitContext;
- //TODO - review
- if (resetKeyBeforeVisit) {
- setRowKey(visitContext.getFacesContext(), null);
- }
-
if (visitMetaComponent("header", extendedVisitContext, callback)) {
return true;
}
@@ -73,7 +67,7 @@
return false;
} else {
- return super.visitFixedChildren(visitContext, callback, resetKeyBeforeVisit);
+ return super.visitFixedChildren(visitContext, callback);
}
}
Modified: root/ui-sandbox/tables/trunk/ui/src/main/java/org/richfaces/component/UIExtendedDataTable.java
===================================================================
--- root/ui-sandbox/tables/trunk/ui/src/main/java/org/richfaces/component/UIExtendedDataTable.java 2010-05-18 15:27:51 UTC (rev 17101)
+++ root/ui-sandbox/tables/trunk/ui/src/main/java/org/richfaces/component/UIExtendedDataTable.java 2010-05-18 17:55:44 UTC (rev 17102)
@@ -27,6 +27,7 @@
import java.util.Map;
import java.util.Set;
+import javax.el.ValueExpression;
import javax.faces.component.UIComponent;
import javax.faces.component.visit.VisitCallback;
import javax.faces.component.visit.VisitContext;
@@ -94,7 +95,7 @@
Renderer renderer = getRenderer(context);
try {
- ((MetaComponentRenderer) renderer).encodeMetaComponent(context, target);
+ ((MetaComponentRenderer) renderer).encodeMetaComponent(context, target, metaComponentId);
} catch (IOException e) {
if (RENDERKIT_LOG.isErrorEnabled()) {
RENDERKIT_LOG.error(e.getMessage());
@@ -139,15 +140,12 @@
* @see org.richfaces.component.UIDataAdaptor#visitFixedChildren(javax.faces.component.visit.VisitContext, javax.faces.component.visit.VisitCallback, boolean)
*/
@Override
- protected boolean visitFixedChildren(VisitContext visitContext, VisitCallback callback, boolean resetKeyBeforeVisit) {
+ protected boolean visitFixedChildren(VisitContext visitContext, VisitCallback callback) {
if (visitContext instanceof ExtendedVisitContext) {
ExtendedVisitContext extendedVisitContext = (ExtendedVisitContext) visitContext;
if (extendedVisitContext.getVisitMode() == ExtendedVisitContextMode.RENDER) {
- if (resetKeyBeforeVisit) {
- setRowKey(visitContext.getFacesContext(), null);
- }
-
+ //TODO nick - call preEncodeBegin(...) and emit PreRenderEvent
MetaComponentRenderVisitCallback rendererCallback = new MetaComponentRenderVisitCallback(callback);
VisitResult visitResult;
@@ -174,7 +172,7 @@
}
}
- return super.visitFixedChildren(visitContext, callback, resetKeyBeforeVisit);
+ return super.visitFixedChildren(visitContext, callback);
}
@Override
@@ -183,6 +181,7 @@
ExtendedVisitContext extendedVisitContext = (ExtendedVisitContext) visitContext;
if (extendedVisitContext.getVisitMode() == ExtendedVisitContextMode.RENDER) {
+ //TODO nick - call preEncodeBegin(...) and emit PreRenderEvent
if (resetKeyBeforeVisit) {
setRowKey(visitContext.getFacesContext(), null);
}
@@ -258,6 +257,8 @@
public void setClientFirst(int clientFirst) {
getStateHelper().put(PropertyKeys.clientFirst, clientFirst);
+
+ updateState();
}
@Override
@@ -272,5 +273,28 @@
public void setClientRows(int clientRows) {
getStateHelper().put(PropertyKeys.clientRows, clientRows);
+
+ updateState();
}
+
+ @SuppressWarnings("deprecation")
+ @Override
+ public void setValueBinding(String name, javax.faces.el.ValueBinding binding) {
+ super.setValueBinding(name, binding);
+
+ //TODO nick - clientFirst?
+ if ("clientRows".equals(name)) {
+ updateState();
+ }
+ }
+
+ @Override
+ public void setValueExpression(String name, ValueExpression binding) {
+ super.setValueExpression(name, binding);
+
+ //TODO nick - clientFirst?
+ if ("clientRows".equals(name)) {
+ updateState();
+ }
+ }
}
Modified: root/ui-sandbox/tables/trunk/ui/src/main/java/org/richfaces/renderkit/ExtendedDataTableRenderer.java
===================================================================
--- root/ui-sandbox/tables/trunk/ui/src/main/java/org/richfaces/renderkit/ExtendedDataTableRenderer.java 2010-05-18 15:27:51 UTC (rev 17101)
+++ root/ui-sandbox/tables/trunk/ui/src/main/java/org/richfaces/renderkit/ExtendedDataTableRenderer.java 2010-05-18 17:55:44 UTC (rev 17102)
@@ -53,7 +53,6 @@
import org.richfaces.component.UIDataTableBase;
import org.richfaces.component.UIExtendedDataTable;
import org.richfaces.component.util.HtmlUtil;
-import org.richfaces.context.ExtendedVisitContext;
@ResourceDependencies({ @ResourceDependency(library = "javax.faces", name = "jsf-uncompressed.js"),
@ResourceDependency(name = "jquery.js"), @ResourceDependency(name = "jquery.position.js"),
@@ -64,7 +63,7 @@
private static enum PartName {
frozen, normal
}
-
+
private class Part {
private PartName name;
private List<UIComponent> columns;
@@ -82,21 +81,17 @@
return columns;
}
- public boolean hasColumns() {
- return !columns.isEmpty();
- }
}
private class RendererState extends RowHolderBase{
private UIDataTableBase table;
private List<Part> parts;
-
private Part current;
-
private Iterator<Part> partIterator;
- private String element;
+
+
public RendererState(FacesContext context, UIDataTableBase table) {
super(context);
this.table = table;
@@ -155,332 +150,15 @@
return partIterator.hasNext();
}
- public void setElement(String element) {
- this.element = element;
- }
-
- public String getElement() {
- return element;
- }
}
- private abstract class TableEncoder {
- final void encodeTableFacets(RendererState state) throws IOException {
- FacesContext context = state.getContext();
- UIDataTableBase table = state.getRow();
- String facetName = state.getElement();
-
- UIComponent facet = table.getFacet(facetName);
- if (facet != null && facet.isRendered()) {
- String facetId = table.getClientId(context) + ":" + facetName + "Facet";
-
- encodeStartUpdate(context, facetId);
-
- ResponseWriter writer = context.getResponseWriter();
- writer.startElement(HTML.DIV_ELEM, facet);
- writer.writeAttribute(HTML.ID_ATTRIBUTE, facetId, null);
- facet.encodeAll(context);
- writer.endElement(HTML.DIV_ELEM);
-
- encodeEndUpdate(context);
- }
- }
-
- final void encodeColumnFacets(RendererState state) throws IOException {
- UIDataTableBase table = state.getRow();
- String facetName = state.getElement();
-
- if (table.isColumnFacetPresent(facetName)) {
- encodeColumnFacetsProlog(state);
- for (state.startIterate(); state.hasNextPart();) {
- //TODO nick - review this part of code
- state.nextPart();
- encodeColumnFacetsPart(state);
- }
-
- encodeColumnFacetsEpilog(state);
- }
- }
-
- final void encodeColumnFacetsPart(RendererState state) throws IOException {
- Part part = state.getPart();
- if (part.hasColumns()) {
- encodeColumnPartProlog(state);
- encodeColumnPart(state);
- encodeColumnPartEpilog(state);
- }
- }
-
- final void encodeColumnPart(RendererState state) throws IOException {
- FacesContext context = state.getContext();
- UIDataTableBase table = state.getRow();
- ResponseWriter writer = context.getResponseWriter();
- Part part = state.getPart();
- Iterator<UIComponent> columns = part.getColumns().iterator();
- String facetName = state.getElement();
-
- String partElementId = getPartElementId(context, table, part.getName(), facetName);
-
- encodeStartUpdate(context, partElementId);
-
- writer.startElement(HTML.TABLE_ELEMENT, table);
- writer.writeAttribute(HTML.ID_ATTRIBUTE, partElementId, null);
- writer.writeAttribute(HTML.CELLPADDING_ATTRIBUTE, "0", null);
- writer.writeAttribute(HTML.CELLSPACING_ATTRIBUTE, "0", null);
- writer.startElement(HTML.TBOBY_ELEMENT, table);
- writer.startElement(HTML.TR_ELEMENT, table);
- while (columns.hasNext()) {
- UIComponent column = columns.next();
-
- if (column.isRendered()) {
-
- String classAttribute = facetName + "Class";
- writer.startElement(HTML.TD_ELEM, column);
- if ("header".equals(facetName)) {
- writer.startElement(HTML.DIV_ELEM, column);
- writer.writeAttribute(HTML.CLASS_ATTRIBUTE, "rich-extable-resizer-holder rich-extable-cell-width-"
- + column.getId(), null);
- writer.startElement(HTML.DIV_ELEM, column);
- writer.writeAttribute(HTML.CLASS_ATTRIBUTE, "rich-extable-resizer", null);
- writer.endElement(HTML.DIV_ELEM);
- writer.endElement(HTML.DIV_ELEM);
- }
- writer.startElement(HTML.DIV_ELEM, column);
- writer
- .writeAttribute(HTML.CLASS_ATTRIBUTE, HtmlUtil.concatClasses("rich-extable-" + facetName + "-cell",
- "rich-extable-cell-width-" + column.getId(), (String) column.getAttributes().get(classAttribute)),
- null);
- writer.startElement(HTML.DIV_ELEM, column);
- writer.writeAttribute(HTML.CLASS_ATTRIBUTE, "rich-extable-" + facetName + "-cell-content", null);
- UIComponent facet = column.getFacet(facetName);
- if (facet != null && facet.isRendered()) {
- facet.encodeAll(context);
- }
- writer.endElement(HTML.DIV_ELEM);
- writer.endElement(HTML.DIV_ELEM);
- writer.endElement(HTML.TD_ELEM);
- }
- }
- writer.endElement(HTML.TR_ELEMENT);
- writer.endElement(HTML.TBOBY_ELEMENT);
- writer.endElement(HTML.TABLE_ELEMENT);
-
- encodeEndUpdate(context);
- }
-
- final void encodeBody(RendererState state) throws IOException {
- FacesContext context = state.getContext();
- ResponseWriter writer = context.getResponseWriter();
- UIDataTableBase table = state.getRow();
- String bodyElementId = table.getClientId(context) + ":b";
-
- encodeStartUpdate(context, bodyElementId);
-
- writer.startElement(HTML.DIV_ELEM, table);
- writer.writeAttribute(HTML.ID_ATTRIBUTE, bodyElementId, null);
- writer.writeAttribute(HTML.CLASS_ATTRIBUTE, "rich-extable-body", null);
- if (table.getRowCount() == 0) {
- UIComponent facet = table.getFacet("noData");
- if (facet != null && facet.isRendered()) {
- facet.encodeAll(context);
- } else {
- Object noDataLabel = table.getAttributes().get("noDataLabel");
- if (noDataLabel != null) {
- writer.writeText(noDataLabel, "noDataLabel");
- }
- }
- } else {
- table.getAttributes().put("clientFirst", 0);
- writer.startElement(HTML.DIV_ELEM, table);
- writer.startElement(HTML.DIV_ELEM, table);
- writer.writeAttribute(HTML.CLASS_ATTRIBUTE, "rich-extable-spacer", null);
- writer.endElement(HTML.DIV_ELEM);
- writer.startElement(HTML.TABLE_ELEMENT, table);
- writer.writeAttribute(HTML.CELLPADDING_ATTRIBUTE, "0", null);
- writer.writeAttribute(HTML.CELLSPACING_ATTRIBUTE, "0", null);
- writer.startElement(HTML.TBOBY_ELEMENT, table);
- writer.startElement(HTML.TR_ELEMENT, table);
- for (state.startIterate(); state.hasNextPart();) {
- writer.startElement(HTML.TD_ELEM, table);
- writer.startElement(HTML.DIV_ELEM, table);
- PartName partName = state.nextPart().getName();
- if (PartName.normal.equals(partName)) {
- writer.writeAttribute(HTML.ID_ATTRIBUTE, table.getClientId(context) + ":body", null);
- writer.writeAttribute(HTML.CLASS_ATTRIBUTE, "rich-extable-part rich-extable-part-width", null);
- }
- writer.startElement(HTML.TABLE_ELEMENT, table);
- writer.writeAttribute(HTML.CELLPADDING_ATTRIBUTE, "0", null);
- writer.writeAttribute(HTML.CELLSPACING_ATTRIBUTE, "0", null);
- writer.startElement(HTML.TBOBY_ELEMENT, table);
- writer.writeAttribute(HTML.ID_ATTRIBUTE, table.getClientId(context) + ":tb"
- + partName.toString().charAt(0), null);
- encodeRows(state);
- writer.endElement(HTML.TBOBY_ELEMENT);
- writer.endElement(HTML.TABLE_ELEMENT);
- writer.endElement(HTML.DIV_ELEM);
- writer.endElement(HTML.TD_ELEM);
- }
- writer.endElement(HTML.TR_ELEMENT);
- writer.endElement(HTML.TBOBY_ELEMENT);
- writer.endElement(HTML.TABLE_ELEMENT);
- writer.endElement(HTML.DIV_ELEM);
- }
- writer.endElement(HTML.DIV_ELEM);
-
- encodeEndUpdate(context);
- }
-
- private String getPartElementId(FacesContext context, UIComponent table, PartName partName, String name) {
- //TODO nick - better id is necessary here
- return table.getClientId(context) + ":" + partName + name + "Table";
- }
-
- public void encode(RendererState state) throws IOException {
- String element = state.getElement();
-
- if (UIExtendedDataTable.HEADER.equals(element)) {
- encodeTableFacets(state);
- encodeColumnFacets(state);
- } else if (UIExtendedDataTable.FOOTER.equals(element)) {
- encodeColumnFacets(state);
- encodeTableFacets(state);
- } else if (UIExtendedDataTable.BODY.equals(element)) {
- encodeBody(state);
- } else {
- throw new IllegalArgumentException(element);
- }
- }
-
- public abstract void encodeColumnFacetsProlog(RendererState state) throws IOException;
-
- public abstract void encodeColumnFacetsEpilog(RendererState state) throws IOException;
-
- public abstract void encodeColumnPartProlog(RendererState state) throws IOException;
-
- public abstract void encodeColumnPartEpilog(RendererState state) throws IOException;
-
- public abstract void encodeStartUpdate(FacesContext context, String targetId) throws IOException;
-
- public abstract void encodeEndUpdate(FacesContext context) throws IOException;
- }
-
- private class FullTableEncoder extends TableEncoder {
- @Override
- public void encodeStartUpdate(FacesContext context, String targetId) throws IOException {
- //not applicable
- }
-
- @Override
- public void encodeEndUpdate(FacesContext context) throws IOException {
- //not applicable
- }
-
- @Override
- public void encodeColumnFacetsProlog(RendererState state) throws IOException {
- FacesContext context = state.getContext();
- UIDataTableBase table = state.getRow();
- String facetName = state.getElement();
-
- ResponseWriter writer = context.getResponseWriter();
- writer.startElement(HTML.DIV_ELEM, table);
- writer.writeAttribute(HTML.CLASS_ATTRIBUTE, HtmlUtil.concatClasses("rich-extable-" + facetName, (String) table
- .getAttributes().get(facetName + "Class")), null);
- writer.startElement(HTML.TABLE_ELEMENT, table);
- writer.writeAttribute(HTML.CELLPADDING_ATTRIBUTE, "0", null);
- writer.writeAttribute(HTML.CELLSPACING_ATTRIBUTE, "0", null);
- writer.startElement(HTML.TBOBY_ELEMENT, table);
- writer.startElement(HTML.TR_ELEMENT, table);
- }
-
- @Override
- public void encodeColumnFacetsEpilog(RendererState state) throws IOException {
- ResponseWriter writer = state.getContext().getResponseWriter();
- writer.endElement(HTML.TR_ELEMENT);
- writer.endElement(HTML.TBOBY_ELEMENT);
- writer.endElement(HTML.TABLE_ELEMENT);
- writer.endElement(HTML.DIV_ELEM);
- }
-
- @Override
- public void encodeColumnPartProlog(RendererState state) throws IOException {
- FacesContext context = state.getContext();
- UIDataTableBase table = state.getRow();
- PartName partName = state.getPart().getName();
- String facetName = state.getElement();
-
- ResponseWriter writer = context.getResponseWriter();
- writer.startElement(HTML.TD_ELEM, table);
- if (PartName.frozen.equals(partName) && "footer".equals(facetName)) {
- writer.writeAttribute(HTML.CLASS_ATTRIBUTE, "rich-extable-footer-align", null);
- }
- writer.startElement(HTML.DIV_ELEM, table);
- if (PartName.frozen.equals(partName)) {
- if ("header".equals(facetName)) {
- writer
- .writeAttribute(HTML.ID_ATTRIBUTE, table.getClientId(context) + ":frozenHeader", null);
- }
- } else {
- writer.writeAttribute(HTML.ID_ATTRIBUTE, table.getClientId(context) + ":" + facetName, null);
- writer.writeAttribute(HTML.CLASS_ATTRIBUTE, "rich-extable"
- + ("footer".equals(facetName) ? "-footer" : "") + "-part rich-extable-part-width", null);
- }
- }
-
- @Override
- public void encodeColumnPartEpilog(RendererState state) throws IOException {
- ResponseWriter writer = state.getContext().getResponseWriter();
- writer.endElement(HTML.DIV_ELEM);
- writer.endElement(HTML.TD_ELEM);
- }
- };
-
- private class PartialTableEncoder extends TableEncoder {
-
- @Override
- public void encodeStartUpdate(FacesContext context, String targetId) throws IOException {
- PartialResponseWriter writer = context.getPartialViewContext().getPartialResponseWriter();
- writer.startUpdate(targetId);
- }
-
- @Override
- public void encodeEndUpdate(FacesContext context) throws IOException {
- PartialResponseWriter writer = context.getPartialViewContext().getPartialResponseWriter();
- writer.endUpdate();
- }
-
- @Override
- public void encodeColumnFacetsProlog(RendererState state) throws IOException {
- //not applicable
- }
-
- @Override
- public void encodeColumnFacetsEpilog(RendererState state) throws IOException {
- //not applicable
- }
-
- @Override
- public void encodeColumnPartProlog(RendererState state) throws IOException {
- //not applicable
- }
-
- @Override
- public void encodeColumnPartEpilog(RendererState state) throws IOException {
- // TODO Auto-generated method stub
-
- }
- };
-
- private final TableEncoder fullTableEncoder = new FullTableEncoder();
-
- private final TableEncoder partialTableEncoder = new PartialTableEncoder();
-
@Override
protected Class<? extends UIComponent> getComponentClass() {
return UIExtendedDataTable.class;
}
- public void encodeMetaComponent(FacesContext context, UIComponent component) throws IOException {
- String metaComponentId = (String) context.getAttributes().get(ExtendedVisitContext.META_COMPONENT_ID);
+ public void encodeMetaComponent(FacesContext context, UIComponent component, String metaComponentId)
+ throws IOException {
if (UIExtendedDataTable.SCROLL.equals(metaComponentId)) {
final PartialResponseWriter writer = context.getPartialViewContext().getPartialResponseWriter();
@@ -567,9 +245,7 @@
table.restoreOrigValue(context);
}
} else {
- RendererState state = createRowHolder(context, component);
- state.setElement(metaComponentId);
- partialTableEncoder.encode(state);
+ throw new IllegalArgumentException("Unsupported metaComponentIdentifier: " + metaComponentId);
}
}
@@ -581,6 +257,12 @@
writer.writeAttribute(HTML.ID_ATTRIBUTE, component.getClientId(context), null);
writer.writeAttribute(HTML.CLASS_ATTRIBUTE, HtmlUtil.concatClasses("rich-extable", (String) attributes.get("styleClass")), null);
getUtils().writeAttribute(writer, HTML.STYLE_ATTRIBUTE, attributes.get("style"));
+ UIComponent header = component.getFacet("header");
+ if (header != null && header.isRendered()) {
+ writer.startElement(HTML.DIV_ELEM, component);
+ header.encodeAll(context);
+ writer.endElement(HTML.DIV_ELEM);
+ }
}
@@ -598,22 +280,21 @@
table.setRowKey(context, null);
RendererState state = createRowHolder(context, table);
encodeStyle(state);
-
- state.setElement(UIExtendedDataTable.HEADER);
- fullTableEncoder.encode(state);
-
- state.setElement(UIExtendedDataTable.BODY);
- fullTableEncoder.encode(state);
-
- state.setElement(UIExtendedDataTable.FOOTER);
- fullTableEncoder.encode(state);
-
+ encodeHeaderOrFooter(state, "header");
+ encodeBody(state);
+ encodeHeaderOrFooter(state, "footer");
table.setRowKey(context, key);
table.restoreOrigValue(context);
}
@Override
protected void doEncodeEnd(ResponseWriter writer, FacesContext context, UIComponent component) throws IOException {
+ UIComponent facet = component.getFacet("footer");
+ if (facet != null && facet.isRendered()) {
+ writer.startElement(HTML.DIV_ELEM, component);
+ facet.encodeAll(context);
+ writer.endElement(HTML.DIV_ELEM);
+ }
writer.startElement(HTML.DIV_ELEM, component);
writer.writeAttribute(HTML.ID_ATTRIBUTE, component.getClientId(context) + ":d", null);
writer.writeAttribute(HTML.CLASS_ATTRIBUTE, "rich-extable-drag", null);
@@ -702,6 +383,149 @@
writer.endElement("style");
}
+ private void encodeHeaderOrFooter(RendererState state, String name) throws IOException {
+ FacesContext context = state.getContext();
+ ResponseWriter writer = context.getResponseWriter();
+ UIDataTableBase table = state.getRow();
+ if (table.isColumnFacetPresent(name)) {
+ writer.startElement(HTML.DIV_ELEM, table);
+ writer.writeAttribute(HTML.CLASS_ATTRIBUTE, HtmlUtil.concatClasses("rich-extable-" + name, (String) table
+ .getAttributes().get(name + "Class")), null);
+ writer.startElement(HTML.TABLE_ELEMENT, table);
+ writer.writeAttribute(HTML.CELLPADDING_ATTRIBUTE, "0", null);
+ writer.writeAttribute(HTML.CELLSPACING_ATTRIBUTE, "0", null);
+ writer.startElement(HTML.TBOBY_ELEMENT, table);
+ writer.startElement(HTML.TR_ELEMENT, table);
+ for (state.startIterate(); state.hasNextPart();) {
+ Part part = state.nextPart();
+ PartName partName = part.getName();
+ Iterator<UIComponent> columns = part.getColumns().iterator();
+ if (columns.hasNext()) {
+ writer.startElement(HTML.TD_ELEM, table);
+ if (PartName.frozen.equals(partName) && "footer".equals(name)) {
+ writer.writeAttribute(HTML.CLASS_ATTRIBUTE, "rich-extable-footer-align", null);
+ }
+ writer.startElement(HTML.DIV_ELEM, table);
+ if (PartName.frozen.equals(partName)) {
+ if ("header".equals(name)) {
+ writer
+ .writeAttribute(HTML.ID_ATTRIBUTE, table.getClientId(context) + ":frozenHeader", null);
+ }
+ } else {
+ writer.writeAttribute(HTML.ID_ATTRIBUTE, table.getClientId(context) + ":" + name, null);
+ writer.writeAttribute(HTML.CLASS_ATTRIBUTE, "rich-extable"
+ + ("footer".equals(name) ? "-footer" : "") + "-part rich-extable-part-width", null);
+ }
+ writer.startElement(HTML.TABLE_ELEMENT, table);
+ writer.writeAttribute(HTML.CELLPADDING_ATTRIBUTE, "0", null);
+ writer.writeAttribute(HTML.CELLSPACING_ATTRIBUTE, "0", null);
+ writer.startElement(HTML.TBOBY_ELEMENT, table);
+ writer.startElement(HTML.TR_ELEMENT, table);
+ while (columns.hasNext()) {
+ encodeHeaderOrFooterCell(context, writer, columns.next(), name);
+ }
+ writer.endElement(HTML.TR_ELEMENT);
+ writer.endElement(HTML.TBOBY_ELEMENT);
+ writer.endElement(HTML.TABLE_ELEMENT);
+ writer.endElement(HTML.DIV_ELEM);
+ writer.endElement(HTML.TD_ELEM);
+ }
+ }
+ writer.endElement(HTML.TR_ELEMENT);
+ writer.endElement(HTML.TBOBY_ELEMENT);
+ writer.endElement(HTML.TABLE_ELEMENT);
+ writer.endElement(HTML.DIV_ELEM);
+ }
+ }
+
+ private void encodeBody(RendererState state) throws IOException {
+ FacesContext context = state.getContext();
+ ResponseWriter writer = context.getResponseWriter();
+ UIDataTableBase table = state.getRow();
+ writer.startElement(HTML.DIV_ELEM, table);
+ writer.writeAttribute(HTML.ID_ATTRIBUTE, table.getClientId(context) + ":b", null);
+ writer.writeAttribute(HTML.CLASS_ATTRIBUTE, "rich-extable-body", null);
+ if (table.getRowCount() == 0) {
+ UIComponent facet = table.getFacet("noData");
+ if (facet != null && facet.isRendered()) {
+ facet.encodeAll(context);
+ } else {
+ Object noDataLabel = table.getAttributes().get("noDataLabel");
+ if (noDataLabel != null) {
+ writer.writeText(noDataLabel, "noDataLabel");
+ }
+ }
+ } else {
+ table.getAttributes().put("clientFirst", 0);
+ writer.startElement(HTML.DIV_ELEM, table);
+ writer.startElement(HTML.DIV_ELEM, table);
+ writer.writeAttribute(HTML.CLASS_ATTRIBUTE, "rich-extable-spacer", null);
+ writer.endElement(HTML.DIV_ELEM);
+ writer.startElement(HTML.TABLE_ELEMENT, table);
+ writer.writeAttribute(HTML.CELLPADDING_ATTRIBUTE, "0", null);
+ writer.writeAttribute(HTML.CELLSPACING_ATTRIBUTE, "0", null);
+ writer.startElement(HTML.TBOBY_ELEMENT, table);
+ writer.startElement(HTML.TR_ELEMENT, table);
+ for (state.startIterate(); state.hasNextPart();) {
+ writer.startElement(HTML.TD_ELEM, table);
+ writer.startElement(HTML.DIV_ELEM, table);
+ PartName partName = state.nextPart().getName();
+ if (PartName.normal.equals(partName)) {
+ writer.writeAttribute(HTML.ID_ATTRIBUTE, table.getClientId(context) + ":body", null);
+ writer.writeAttribute(HTML.CLASS_ATTRIBUTE, "rich-extable-part rich-extable-part-width", null);
+ }
+ writer.startElement(HTML.TABLE_ELEMENT, table);
+ writer.writeAttribute(HTML.CELLPADDING_ATTRIBUTE, "0", null);
+ writer.writeAttribute(HTML.CELLSPACING_ATTRIBUTE, "0", null);
+ writer.startElement(HTML.TBOBY_ELEMENT, table);
+ writer.writeAttribute(HTML.ID_ATTRIBUTE, table.getClientId(context) + ":tb"
+ + partName.toString().charAt(0), null);
+ encodeRows(state);
+ writer.endElement(HTML.TBOBY_ELEMENT);
+ writer.endElement(HTML.TABLE_ELEMENT);
+ writer.endElement(HTML.DIV_ELEM);
+ writer.endElement(HTML.TD_ELEM);
+ }
+ writer.endElement(HTML.TR_ELEMENT);
+ writer.endElement(HTML.TBOBY_ELEMENT);
+ writer.endElement(HTML.TABLE_ELEMENT);
+ writer.endElement(HTML.DIV_ELEM);
+ }
+ writer.endElement(HTML.DIV_ELEM);
+ }
+
+ private void encodeHeaderOrFooterCell(FacesContext context, ResponseWriter writer, UIComponent column,
+ String facetName) throws IOException {
+ if (column.isRendered()) {
+
+ String classAttribute = facetName + "Class";
+ writer.startElement(HTML.TD_ELEM, column);
+ if ("header".equals(facetName)) {
+ writer.startElement(HTML.DIV_ELEM, column);
+ writer.writeAttribute(HTML.CLASS_ATTRIBUTE, "rich-extable-resizer-holder rich-extable-cell-width-"
+ + column.getId(), null);
+ writer.startElement(HTML.DIV_ELEM, column);
+ writer.writeAttribute(HTML.CLASS_ATTRIBUTE, "rich-extable-resizer", null);
+ writer.endElement(HTML.DIV_ELEM);
+ writer.endElement(HTML.DIV_ELEM);
+ }
+ writer.startElement(HTML.DIV_ELEM, column);
+ writer
+ .writeAttribute(HTML.CLASS_ATTRIBUTE, HtmlUtil.concatClasses("rich-extable-" + facetName + "-cell",
+ "rich-extable-cell-width-" + column.getId(), (String) column.getAttributes().get(classAttribute)),
+ null);
+ writer.startElement(HTML.DIV_ELEM, column);
+ writer.writeAttribute(HTML.CLASS_ATTRIBUTE, "rich-extable-" + facetName + "-cell-content", null);
+ UIComponent facet = column.getFacet(facetName);
+ if (facet != null && facet.isRendered()) {
+ facet.encodeAll(context);
+ }
+ writer.endElement(HTML.DIV_ELEM);
+ writer.endElement(HTML.DIV_ELEM);
+ writer.endElement(HTML.TD_ELEM);
+ }
+ }
+
@Override
public void encodeRow(RowHolderBase rowHolder) throws IOException {
FacesContext context = rowHolder.getContext();
@@ -732,6 +556,7 @@
writer.endElement(HTML.TR_ELEMENT);
}
+
@Override
protected void doDecode(FacesContext context, UIComponent component) {
super.doDecode(context, component);
14 years, 5 months
JBoss Rich Faces SVN: r17101 - root/ui-sandbox/tables/trunk/ui/src/main/resources/META-INF/resources.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2010-05-18 11:27:51 -0400 (Tue, 18 May 2010)
New Revision: 17101
Modified:
root/ui-sandbox/tables/trunk/ui/src/main/resources/META-INF/resources/datatable.js
Log:
fix invokeOnSubTables func
Modified: root/ui-sandbox/tables/trunk/ui/src/main/resources/META-INF/resources/datatable.js
===================================================================
--- root/ui-sandbox/tables/trunk/ui/src/main/resources/META-INF/resources/datatable.js 2010-05-18 15:12:00 UTC (rev 17100)
+++ root/ui-sandbox/tables/trunk/ui/src/main/resources/META-INF/resources/datatable.js 2010-05-18 15:27:51 UTC (rev 17101)
@@ -54,11 +54,11 @@
},
expandAllSubTables: function() {
- this.invokeOnSubTables.call(this, 'expand');
+ this.invokeOnSubTables('expand');
},
collapseAllSubTables: function() {
- this.invokeOnSubTables.call(this, 'collapse');
+ this.invokeOnSubTables('collapse');
},
switchSubTable: function(id) {
14 years, 5 months
JBoss Rich Faces SVN: r17100 - in root/ui/core/trunk/api/src/main/java/org: richfaces/view/facelets/html and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2010-05-18 11:12:00 -0400 (Tue, 18 May 2010)
New Revision: 17100
Added:
root/ui/core/trunk/api/src/main/java/org/ajax4jsf/component/behavior/MethodExpressionAjaxBehaviorListener.java
root/ui/core/trunk/api/src/main/java/org/richfaces/view/facelets/tag/AjaxBehaviorRule.java
Modified:
root/ui/core/trunk/api/src/main/java/org/ajax4jsf/component/behavior/AjaxBehavior.java
root/ui/core/trunk/api/src/main/java/org/richfaces/view/facelets/html/BehaviorTagHandlerDelegate.java
root/ui/core/trunk/api/src/main/java/org/richfaces/view/facelets/tag/BehaviorRule.java
Log:
add ajaxClientBehavior listeners support
Modified: root/ui/core/trunk/api/src/main/java/org/ajax4jsf/component/behavior/AjaxBehavior.java
===================================================================
--- root/ui/core/trunk/api/src/main/java/org/ajax4jsf/component/behavior/AjaxBehavior.java 2010-05-18 14:59:11 UTC (rev 17099)
+++ root/ui/core/trunk/api/src/main/java/org/ajax4jsf/component/behavior/AjaxBehavior.java 2010-05-18 15:12:00 UTC (rev 17100)
@@ -29,6 +29,7 @@
import javax.faces.FacesException;
import javax.faces.component.behavior.ClientBehaviorHint;
+import javax.faces.event.AjaxBehaviorListener;
import org.ajax4jsf.component.AjaxClientBehavior;
import org.ajax4jsf.renderkit.AjaxRendererUtils;
@@ -36,29 +37,23 @@
import org.richfaces.cdk.annotations.Tag;
import org.richfaces.cdk.annotations.TagType;
-
/**
* @author Anton Belevich
- *
+ *
*/
-@JsfBehavior(
- id = "org.ajax4jsf.behavior.Ajax",
- tag = @Tag(name = "ajax", handler = "org.richfaces.view.facelets.html.AjaxHandler", type = TagType.Facelets)
-)
+@JsfBehavior(id = "org.ajax4jsf.behavior.Ajax", tag = @Tag(name = "ajax", handler = "org.richfaces.view.facelets.html.AjaxHandler", type = TagType.Facelets))
public class AjaxBehavior extends ClientBehavior implements AjaxClientBehavior {
-
+
public static final String BEHAVIOR_ID = "org.ajax4jsf.behavior.Ajax";
-
- private static final Set<ClientBehaviorHint> HINTS =
- Collections.unmodifiableSet(EnumSet.of(ClientBehaviorHint.SUBMITTING));
-
-
+
+ private static final Set<ClientBehaviorHint> HINTS = Collections.unmodifiableSet(EnumSet
+ .of(ClientBehaviorHint.SUBMITTING));
+
enum PropertyKeys {
- data, execute, onbeforedomupdate, onbegin, oncomplete, onerror, onevent,
- queueId, render, similarityGroupingId, status, disabled, limitRender, immediate
+ data, execute, onbeforedomupdate, onbegin, oncomplete, onerror, onevent, queueId, render, similarityGroupingId, status, disabled, limitRender, immediate, behaviorListener
}
-
+
private static final Set<String> ALL_LIST = Collections.singleton("@all");
private static final Set<String> FORM_LIST = Collections.singleton("@form");
private static final Set<String> THIS_LIST = Collections.singleton("@this");
@@ -71,54 +66,50 @@
setData(value);
} else if (compare(PropertyKeys.execute, name)) {
Set<String> set = toSet(name, value);
- if(set != null) {
+ if (set != null) {
setExecute(set);
} else {
- throw new FacesException(value
- + " : '"
- + name
+ throw new FacesException(value + " : '" + name
+ "' attribute value must be either a String or a Collection");
}
-
+
} else if (compare(PropertyKeys.render, name)) {
Set<String> set = toSet(name, value);
- if(set != null) {
+ if (set != null) {
setRender(set);
} else {
- throw new FacesException(value
- + " : '"
- + name
+ throw new FacesException(value + " : '" + name
+ "' attribute value must be either a String or a Collection");
}
-
+
} else if (compare(PropertyKeys.onbeforedomupdate, name)) {
- setOnbeforedomupdate((String)value);
+ setOnbeforedomupdate((String) value);
} else if (compare(PropertyKeys.onbegin, name)) {
- setOnbegin((String)value);
+ setOnbegin((String) value);
} else if (compare(PropertyKeys.oncomplete, name)) {
- setOncomplete((String)value);
+ setOncomplete((String) value);
} else if (compare(PropertyKeys.onerror, name)) {
- setOnerror((String)value);
+ setOnerror((String) value);
} else if (compare(PropertyKeys.onevent, name)) {
- setOnevent((String)value);
+ setOnevent((String) value);
} else if (compare(PropertyKeys.queueId, name)) {
- setQueueId((String)value);
+ setQueueId((String) value);
} else if (compare(PropertyKeys.similarityGroupingId, name)) {
- setSimilarityGroupingId((String)value);
+ setSimilarityGroupingId((String) value);
} else if (compare(PropertyKeys.status, name)) {
- setStatus((String)value);
+ setStatus((String) value);
} else if (compare(PropertyKeys.disabled, name)) {
- setDisabled((Boolean)value);
+ setDisabled((Boolean) value);
} else if (compare(PropertyKeys.limitRender, name)) {
- setLimitRender((Boolean)value);
- } else if(compare(PropertyKeys.immediate, name)) {
- setImmediate((Boolean)value);
+ setLimitRender((Boolean) value);
+ } else if (compare(PropertyKeys.immediate, name)) {
+ setImmediate((Boolean) value);
}
}
private Set<String> toSet(String propertyName, Object value) {
if (value instanceof String) {
- String strValue = (String)value;
+ String strValue = (String) value;
if (strValue.indexOf(' ') == -1) {
return toSingleton(propertyName, strValue);
}
@@ -126,8 +117,8 @@
}
return null;
}
-
- private static Set <String> toSingleton(String propertyName, String value) {
+
+ private static Set<String> toSingleton(String propertyName, String value) {
if ((null == value) || (value.length() == 0)) {
return null;
}
@@ -137,100 +128,97 @@
if (AjaxRendererUtils.ALL.equals(value)) {
list = ALL_LIST;
- } else if (AjaxRendererUtils.FORM.equals(value)){
+ } else if (AjaxRendererUtils.FORM.equals(value)) {
list = FORM_LIST;
} else if (AjaxRendererUtils.THIS.equals(value)) {
- list = THIS_LIST;
+ list = THIS_LIST;
} else if (AjaxRendererUtils.REGION.equals(value)) {
list = REGION_LIST;
} else if (AjaxRendererUtils.NONE.equals(value)) {
list = NONE_LIST;
} else {
- throw new FacesException(value
- + " : Invalid id keyword specified for '"
- + propertyName
- + "' attribute");
+ throw new FacesException(value + " : Invalid id keyword specified for '" + propertyName + "' attribute");
}
-
+
return list;
}
return Collections.singleton(value);
}
-
+
public Object getData() {
return getStateHelper().eval(PropertyKeys.data);
}
-
+
public void setData(Object data) {
getStateHelper().put(PropertyKeys.data, data);
}
public Collection<String> getExecute() {
- return (Collection<String>)getStateHelper().eval(PropertyKeys.execute);
+ return (Collection<String>) getStateHelper().eval(PropertyKeys.execute);
}
public void setExecute(Collection<String> execute) {
- getStateHelper().put(PropertyKeys.execute,execute);
+ getStateHelper().put(PropertyKeys.execute, execute);
}
public String getOnbeforedomupdate() {
- return (String)getStateHelper().eval(PropertyKeys.onbeforedomupdate);
+ return (String) getStateHelper().eval(PropertyKeys.onbeforedomupdate);
}
public void setOnbeforedomupdate(String onbeforedomupdate) {
- getStateHelper().put(PropertyKeys.onbeforedomupdate,onbeforedomupdate);
+ getStateHelper().put(PropertyKeys.onbeforedomupdate, onbeforedomupdate);
}
public String getOnbegin() {
- return (String)getStateHelper().eval(PropertyKeys.onbegin);
+ return (String) getStateHelper().eval(PropertyKeys.onbegin);
}
-
+
public void setOnbegin(String onbegin) {
getStateHelper().put(PropertyKeys.onbegin, onbegin);
}
public String getOncomplete() {
- return (String)getStateHelper().eval(PropertyKeys.oncomplete);
+ return (String) getStateHelper().eval(PropertyKeys.oncomplete);
}
-
+
public void setOncomplete(String oncomplete) {
- getStateHelper().put(PropertyKeys.oncomplete,oncomplete);
+ getStateHelper().put(PropertyKeys.oncomplete, oncomplete);
}
public String getOnerror() {
- return (String)getStateHelper().eval(PropertyKeys.onerror);
+ return (String) getStateHelper().eval(PropertyKeys.onerror);
}
-
+
public void setOnerror(String onerror) {
- getStateHelper().put(PropertyKeys.onerror,onerror);
+ getStateHelper().put(PropertyKeys.onerror, onerror);
}
public String getOnevent() {
- return (String)getStateHelper().eval(PropertyKeys.onevent);
+ return (String) getStateHelper().eval(PropertyKeys.onevent);
}
-
+
public void setOnevent(String onevent) {
- getStateHelper().put(PropertyKeys.onevent,onevent);
+ getStateHelper().put(PropertyKeys.onevent, onevent);
}
public String getQueueId() {
- return (String)getStateHelper().eval(PropertyKeys.queueId);
+ return (String) getStateHelper().eval(PropertyKeys.queueId);
}
-
+
public void setQueueId(String queueId) {
- getStateHelper().put(PropertyKeys.queueId,queueId);
+ getStateHelper().put(PropertyKeys.queueId, queueId);
}
public Collection<String> getRender() {
- return (Collection<String>)getStateHelper().eval(PropertyKeys.render);
+ return (Collection<String>) getStateHelper().eval(PropertyKeys.render);
}
-
+
public void setRender(Collection<String> render) {
getStateHelper().put(PropertyKeys.render, render);
}
public String getSimilarityGroupingId() {
- return (String)getStateHelper().eval(PropertyKeys.similarityGroupingId);
+ return (String) getStateHelper().eval(PropertyKeys.similarityGroupingId);
}
public void setSimilarityGroupingId(String similarityGroupingId) {
@@ -238,46 +226,53 @@
}
public String getStatus() {
- return (String)getStateHelper().eval(PropertyKeys.status);
+ return (String) getStateHelper().eval(PropertyKeys.status);
}
-
+
public void setStatus(String status) {
getStateHelper().put(PropertyKeys.status, status);
}
-
+
public boolean isDisabled() {
- return (Boolean)getStateHelper().eval(PropertyKeys.disabled, false);
+ return (Boolean) getStateHelper().eval(PropertyKeys.disabled, false);
}
-
+
public void setDisabled(boolean disabled) {
getStateHelper().put(PropertyKeys.disabled, disabled);
}
public boolean isLimitRender() {
- return (Boolean)getStateHelper().eval(PropertyKeys.limitRender, false);
+ return (Boolean) getStateHelper().eval(PropertyKeys.limitRender, false);
}
public void setLimitRender(boolean limitRender) {
getStateHelper().put(PropertyKeys.limitRender, limitRender);
}
-
- public boolean isImmediate(){
- return (Boolean)getStateHelper().eval(PropertyKeys.immediate, false);
+
+ public boolean isImmediate() {
+ return (Boolean) getStateHelper().eval(PropertyKeys.immediate, false);
}
public void setImmediate(boolean immediate) {
getStateHelper().put(PropertyKeys.limitRender, immediate);
}
-
+
@Override
public String getRendererType() {
return BEHAVIOR_ID;
}
-
+
@Override
public Set<ClientBehaviorHint> getHints() {
return HINTS;
}
-}
+ public void addAjaxBehaviorListener(AjaxBehaviorListener listener) {
+ addBehaviorListener(listener);
+ }
+ public void removeAjaxBehaviorListener(AjaxBehaviorListener listener) {
+ removeBehaviorListener(listener);
+ }
+
+}
Added: root/ui/core/trunk/api/src/main/java/org/ajax4jsf/component/behavior/MethodExpressionAjaxBehaviorListener.java
===================================================================
--- root/ui/core/trunk/api/src/main/java/org/ajax4jsf/component/behavior/MethodExpressionAjaxBehaviorListener.java (rev 0)
+++ root/ui/core/trunk/api/src/main/java/org/ajax4jsf/component/behavior/MethodExpressionAjaxBehaviorListener.java 2010-05-18 15:12:00 UTC (rev 17100)
@@ -0,0 +1,99 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, 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.component.behavior;
+
+import javax.el.ELContext;
+import javax.el.ELException;
+import javax.el.MethodExpression;
+import javax.el.MethodNotFoundException;
+import javax.faces.context.FacesContext;
+import javax.faces.event.AbortProcessingException;
+import javax.faces.event.AjaxBehaviorEvent;
+import javax.faces.event.AjaxBehaviorListener;
+
+/**
+ * @author Anton Belevich
+ *
+ */
+public class MethodExpressionAjaxBehaviorListener implements AjaxBehaviorListener {
+
+ private static final Class<?>[] ACTION_LISTENER_ZEROARG_SIG = new Class[] {};
+
+ private MethodExpression methodExpressionOneArg = null;
+
+ private MethodExpression methodExpressionZeroArg = null;
+
+ public MethodExpressionAjaxBehaviorListener() {
+ }
+
+ public MethodExpressionAjaxBehaviorListener(MethodExpression methodExpressionOneArg) {
+ this.methodExpressionOneArg = methodExpressionOneArg;
+
+ FacesContext context = FacesContext.getCurrentInstance();
+ ELContext elContext = context.getELContext();
+ this.methodExpressionZeroArg = context.getApplication().getExpressionFactory().createMethodExpression(
+ elContext, methodExpressionOneArg.getExpressionString(), Void.class, ACTION_LISTENER_ZEROARG_SIG);
+
+ }
+
+ MethodExpressionAjaxBehaviorListener(MethodExpression methodExpressionOneArg,
+ MethodExpression methodExpressionZeroArg) {
+ this.methodExpressionOneArg = methodExpressionOneArg;
+ this.methodExpressionZeroArg = methodExpressionZeroArg;
+ }
+
+ public void processAjaxBehavior(AjaxBehaviorEvent event) throws AbortProcessingException {
+
+ Throwable cause = null;
+ Throwable thrown = null;
+
+ if (event == null) {
+ throw new NullPointerException();
+ }
+
+ FacesContext context = FacesContext.getCurrentInstance();
+ ELContext elContext = context.getELContext();
+ try {
+ methodExpressionOneArg.invoke(elContext, new Object[] { event });
+ } catch (MethodNotFoundException mnfe) {
+ if (null != methodExpressionZeroArg) {
+
+ try {
+ methodExpressionZeroArg.invoke(elContext, new Object[] {});
+ } catch (ELException ee) {
+ cause = ee.getCause();
+ thrown = ee;
+ }
+ }
+ } catch (ELException ee) {
+ cause = ee.getCause();
+ thrown = ee;
+ }
+
+ if (null != thrown) {
+ throw cause == null ? new AbortProcessingException(thrown.getMessage(), thrown)
+ : new AbortProcessingException(thrown.getMessage(), cause);
+ }
+ }
+
+}
Modified: root/ui/core/trunk/api/src/main/java/org/richfaces/view/facelets/html/BehaviorTagHandlerDelegate.java
===================================================================
--- root/ui/core/trunk/api/src/main/java/org/richfaces/view/facelets/html/BehaviorTagHandlerDelegate.java 2010-05-18 14:59:11 UTC (rev 17099)
+++ root/ui/core/trunk/api/src/main/java/org/richfaces/view/facelets/html/BehaviorTagHandlerDelegate.java 2010-05-18 15:12:00 UTC (rev 17100)
@@ -34,6 +34,7 @@
import javax.faces.view.facelets.TagHandlerDelegate;
import org.ajax4jsf.component.behavior.ClientBehavior;
+import org.richfaces.view.facelets.tag.AjaxBehaviorRule;
import org.richfaces.view.facelets.tag.BehaviorRule;
/**
@@ -45,9 +46,9 @@
TagHandlerDelegate wrappedHandlerDelegate;
CustomBehaviorHandler owner;
-
- private String behaviorId;
-
+
+ private String behaviorId;
+
private String eventName;
public BehaviorTagHandlerDelegate(CustomBehaviorHandler owner, TagHandlerDelegate wrappedHandlerDelegate) {
@@ -59,35 +60,36 @@
@Override
public void apply(FaceletContext ctx, UIComponent parent) throws IOException {
-
+
if (owner.isWrapping()) {
Application application = ctx.getFacesContext().getApplication();
Behavior behavior = application.createBehavior(this.behaviorId);
-
- if(behavior instanceof ClientBehavior) {
- ClientBehavior clientBehavior = (ClientBehavior)behavior;
+
+ if (behavior instanceof ClientBehavior) {
+ ClientBehavior clientBehavior = (ClientBehavior) behavior;
owner.setAttributes(ctx, clientBehavior);
-
+
FacesContext context = ctx.getFacesContext();
BehaviorStack behaviorStack = BehaviorStack.getBehaviorStack(context, true);
-
+
behaviorStack.pushBehavior(context, clientBehavior, this.behaviorId, this.eventName);
-
+
owner.applyNextHandler(ctx, parent);
-
+
behaviorStack.popBehavior();
- }
-
+ }
+
} else {
- wrappedHandlerDelegate.apply(ctx, parent);
+ wrappedHandlerDelegate.apply(ctx, parent);
}
-
+
}
-
+
public MetaRuleset createMetaRuleset(Class type) {
MetaRuleset metaRuleset = wrappedHandlerDelegate.createMetaRuleset(type);
- metaRuleset.addRule(new BehaviorRule());
+ metaRuleset.addRule(BehaviorRule.INSTANCE);
+ metaRuleset.addRule(AjaxBehaviorRule.INSTANCE);
return metaRuleset;
}
Added: root/ui/core/trunk/api/src/main/java/org/richfaces/view/facelets/tag/AjaxBehaviorRule.java
===================================================================
--- root/ui/core/trunk/api/src/main/java/org/richfaces/view/facelets/tag/AjaxBehaviorRule.java (rev 0)
+++ root/ui/core/trunk/api/src/main/java/org/richfaces/view/facelets/tag/AjaxBehaviorRule.java 2010-05-18 15:12:00 UTC (rev 17100)
@@ -0,0 +1,71 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, 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.view.facelets.tag;
+
+import javax.faces.event.AjaxBehaviorEvent;
+import javax.faces.view.facelets.FaceletContext;
+import javax.faces.view.facelets.MetaRule;
+import javax.faces.view.facelets.Metadata;
+import javax.faces.view.facelets.MetadataTarget;
+import javax.faces.view.facelets.TagAttribute;
+
+import org.ajax4jsf.component.AjaxClientBehavior;
+import org.ajax4jsf.component.behavior.AjaxBehavior;
+import org.ajax4jsf.component.behavior.MethodExpressionAjaxBehaviorListener;
+
+/**
+ * @author Anton Belevich
+ *
+ */
+public class AjaxBehaviorRule extends MetaRule {
+
+ public static final Class<?>[] AJAX_BEHAVIOR_LISTENER_SIG = new Class[] { AjaxBehaviorEvent.class };
+
+ public static final AjaxBehaviorRule INSTANCE = new AjaxBehaviorRule();
+
+ @Override
+ public Metadata applyRule(String name, TagAttribute attribute, MetadataTarget meta) {
+ if (meta.isTargetInstanceOf(AjaxBehavior.class)) {
+ if ("ajaxBehaviorListener".equals(name)) {
+ return new AjaxBehaviorListenerMapper(attribute);
+ }
+ }
+
+ return null;
+ }
+
+ public static final class AjaxBehaviorListenerMapper extends Metadata {
+
+ private final TagAttribute attr;
+
+ public AjaxBehaviorListenerMapper(TagAttribute attr) {
+ this.attr = attr;
+ }
+
+ public void applyMetadata(FaceletContext ctx, Object instance) {
+ ((AjaxClientBehavior) instance).addAjaxBehaviorListener(new MethodExpressionAjaxBehaviorListener(this.attr
+ .getMethodExpression(ctx, null, AjaxBehaviorRule.AJAX_BEHAVIOR_LISTENER_SIG)));
+ }
+ }
+
+}
Modified: root/ui/core/trunk/api/src/main/java/org/richfaces/view/facelets/tag/BehaviorRule.java
===================================================================
--- root/ui/core/trunk/api/src/main/java/org/richfaces/view/facelets/tag/BehaviorRule.java 2010-05-18 14:59:11 UTC (rev 17099)
+++ root/ui/core/trunk/api/src/main/java/org/richfaces/view/facelets/tag/BehaviorRule.java 2010-05-18 15:12:00 UTC (rev 17100)
@@ -38,14 +38,14 @@
*/
public class BehaviorRule extends MetaRule {
+ public static final BehaviorRule INSTANCE = new BehaviorRule();
+
private static Logger log = RichfacesLogger.CONNECTION.getLogger();
static final class LiteralAttributeMetadata extends Metadata {
private final String name;
private final String value;
-
-
public LiteralAttributeMetadata(String name, String value) {
this.value = value;
@@ -87,25 +87,24 @@
type = Object.class;
}
return new ValueExpressionMetadata(name, type, attribute);
- } else
-
- if(meta != null) {
-
- if (meta.getWriteMethod(name) != null) {
- if("execute".equals(name) || "render".equals(name)) {
- return new LiteralAttributeMetadata(name, attribute.getValue());
- }
-
- } else {
- if (log.isDebugEnabled()) {
- log
- .debug(attribute + " Property '" + name + "' is not on type: "
- + meta.getTargetClass().getName());
- }
+ } else
+
+ if (meta != null) {
+
+ if (meta.getWriteMethod(name) != null) {
+ if ("execute".equals(name) || "render".equals(name)) {
return new LiteralAttributeMetadata(name, attribute.getValue());
}
-
+
+ } else {
+ if (log.isDebugEnabled()) {
+ log.debug(attribute + " Property '" + name + "' is not on type: "
+ + meta.getTargetClass().getName());
+ }
+ return new LiteralAttributeMetadata(name, attribute.getValue());
}
+
+ }
}
return null;
14 years, 5 months
JBoss Rich Faces SVN: r17099 - root/core/trunk/api/src/main/java/org/ajax4jsf/component.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2010-05-18 10:59:11 -0400 (Tue, 18 May 2010)
New Revision: 17099
Modified:
root/core/trunk/api/src/main/java/org/ajax4jsf/component/AjaxClientBehavior.java
Log:
add add/remove AjaxBehaviorListener
Modified: root/core/trunk/api/src/main/java/org/ajax4jsf/component/AjaxClientBehavior.java
===================================================================
--- root/core/trunk/api/src/main/java/org/ajax4jsf/component/AjaxClientBehavior.java 2010-05-18 14:57:32 UTC (rev 17098)
+++ root/core/trunk/api/src/main/java/org/ajax4jsf/component/AjaxClientBehavior.java 2010-05-18 14:59:11 UTC (rev 17099)
@@ -3,6 +3,7 @@
import java.util.Collection;
import javax.faces.component.behavior.ClientBehavior;
+import javax.faces.event.AjaxBehaviorListener;
/**
* @author Anton Belevich
@@ -62,8 +63,8 @@
public void setData(Object data);
- public boolean isImmediate();
+ public void addAjaxBehaviorListener(AjaxBehaviorListener listener);
+
+ public void removeAjaxBehaviorListener(AjaxBehaviorListener listener);
- public void setImmediate(boolean immediate) ;
-
}
14 years, 5 months
JBoss Rich Faces SVN: r17098 - in root: build/parent/trunk and 12 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: Alex.Kolonitsky
Date: 2010-05-18 10:57:32 -0400 (Tue, 18 May 2010)
New Revision: 17098
Modified:
root/build/parent/trunk/pom.xml
root/commons/trunk/api/pom.xml
root/commons/trunk/parent/pom.xml
root/commons/trunk/pom.xml
root/core/trunk/parent/pom.xml
root/examples/repeater-demo/trunk/pom.xml
root/pom.xml
root/ui-sandbox/componentcontrol/trunk/pom.xml
root/ui-sandbox/datascroller/trunk/parent/pom.xml
root/ui-sandbox/datascroller/trunk/pom.xml
root/ui-sandbox/datascroller/trunk/ui/pom.xml
root/ui-sandbox/pom.xml
root/ui-sandbox/tables/trunk/pom.xml
root/ui/core/trunk/parent/pom.xml
Log:
correct bom/parent model
Modified: root/build/parent/trunk/pom.xml
===================================================================
--- root/build/parent/trunk/pom.xml 2010-05-18 14:13:33 UTC (rev 17097)
+++ root/build/parent/trunk/pom.xml 2010-05-18 14:57:32 UTC (rev 17098)
@@ -99,6 +99,39 @@
</pluginRepository>
</pluginRepositories>
+ <dependencyManagement>
+ <dependencies>
+ <!-- Archetypes dependency -->
+ <dependency>
+ <groupId>org.apache.maven.archetype</groupId>
+ <artifactId>archetype-packaging</artifactId>
+ <version>2.0-alpha-4</version>
+ </dependency>
+
+ <!-- tests -->
+ <dependency>
+ <groupId>org.jboss.test-jsf</groupId>
+ <artifactId>htmlunit-client</artifactId>
+ <version>1.0.3</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.test-jsf</groupId>
+ <artifactId>jsf-mock</artifactId>
+ <version>1.0.3</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.test-jsf</groupId>
+ <artifactId>jsf-test-stage</artifactId>
+ <version>1.0.3</version>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.4</version>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
<!-- Build -->
<build>
<!--
Modified: root/commons/trunk/api/pom.xml
===================================================================
--- root/commons/trunk/api/pom.xml 2010-05-18 14:13:33 UTC (rev 17097)
+++ root/commons/trunk/api/pom.xml 2010-05-18 14:57:32 UTC (rev 17098)
@@ -63,12 +63,12 @@
</dependency>
</dependencies>
-<!-- <build>
+ <build>
<plugins>
- <!– Trigger checkstyle checking for this module –>
+ <!-- Trigger checkstyle checking for this module -->
<plugin>
<artifactId>maven-checkstyle-plugin</artifactId>
</plugin>
</plugins>
- </build>-->
+ </build>
</project>
\ No newline at end of file
Modified: root/commons/trunk/parent/pom.xml
===================================================================
--- root/commons/trunk/parent/pom.xml 2010-05-18 14:13:33 UTC (rev 17097)
+++ root/commons/trunk/parent/pom.xml 2010-05-18 14:57:32 UTC (rev 17098)
@@ -53,16 +53,6 @@
<!-- Test Dependencies -->
<dependency>
- <groupId>org.jboss.test-jsf</groupId>
- <artifactId>jsf-mock</artifactId>
- <version>1.0.3</version>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.6</version>
- </dependency>
- <dependency>
<groupId>org.easymock</groupId>
<artifactId>easymock</artifactId>
<version>2.5.2</version>
Modified: root/commons/trunk/pom.xml
===================================================================
--- root/commons/trunk/pom.xml 2010-05-18 14:13:33 UTC (rev 17097)
+++ root/commons/trunk/pom.xml 2010-05-18 14:57:32 UTC (rev 17098)
@@ -42,13 +42,5 @@
<module>parent</module>
<module>api</module>
</modules>
-
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-checkstyle-plugin</artifactId>
- </plugin>
- </plugins>
- </build>
</project>
Modified: root/core/trunk/parent/pom.xml
===================================================================
--- root/core/trunk/parent/pom.xml 2010-05-18 14:13:33 UTC (rev 17097)
+++ root/core/trunk/parent/pom.xml 2010-05-18 14:57:32 UTC (rev 17098)
@@ -52,21 +52,6 @@
</dependency>
<!-- Test Dependencies -->
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.6</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.test-jsf</groupId>
- <artifactId>jsf-mock</artifactId>
- <version>1.0.3</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.test-jsf</groupId>
- <artifactId>htmlunit-client</artifactId>
- <version>1.0.3</version>
- </dependency>
<!--
These dependencies are usually provided by
org.jboss.test-jsf:htmlunit-client, but the latest 2.7
Modified: root/examples/repeater-demo/trunk/pom.xml
===================================================================
--- root/examples/repeater-demo/trunk/pom.xml 2010-05-18 14:13:33 UTC (rev 17097)
+++ root/examples/repeater-demo/trunk/pom.xml 2010-05-18 14:57:32 UTC (rev 17098)
@@ -39,7 +39,6 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
- <version>3.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>
Modified: root/pom.xml
===================================================================
--- root/pom.xml 2010-05-18 14:13:33 UTC (rev 17097)
+++ root/pom.xml 2010-05-18 14:57:32 UTC (rev 17098)
@@ -30,8 +30,8 @@
<modules>
<!-- These trunk settings, and this pom.xml will be removed -->
<!-- Added bom, parent, for temp integration -->
- <module>build/bom/trunk</module>
- <module>build/parent/trunk</module>
+ <module>build/parent/trunk</module>
+ <module>build/bom/trunk</module>
<module>build/resources/trunk/checkstyle</module>
<module>commons/${commons.svn.dir}</module>
<module>core/${core.svn.dir}</module>
Modified: root/ui/core/trunk/parent/pom.xml
===================================================================
--- root/ui/core/trunk/parent/pom.xml 2010-05-18 14:13:33 UTC (rev 17097)
+++ root/ui/core/trunk/parent/pom.xml 2010-05-18 14:57:32 UTC (rev 17098)
@@ -55,35 +55,6 @@
<artifactId>annotations</artifactId>
<version>4.0.0-SNAPSHOT</version>
</dependency>
-
- <!-- Archetypes dependency -->
- <dependency>
- <groupId>org.apache.maven.archetype</groupId>
- <artifactId>archetype-packaging</artifactId>
- <version>2.0-alpha-4</version>
- </dependency>
-
- <!-- tests -->
- <dependency>
- <groupId>org.jboss.test-jsf</groupId>
- <artifactId>htmlunit-client</artifactId>
- <version>1.0.3</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.test-jsf</groupId>
- <artifactId>jsf-mock</artifactId>
- <version>1.0.3</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.test-jsf</groupId>
- <artifactId>jsf-test-stage</artifactId>
- <version>1.0.3</version>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.4</version>
- </dependency>
</dependencies>
</dependencyManagement>
Modified: root/ui-sandbox/componentcontrol/trunk/pom.xml
===================================================================
--- root/ui-sandbox/componentcontrol/trunk/pom.xml 2010-05-18 14:13:33 UTC (rev 17097)
+++ root/ui-sandbox/componentcontrol/trunk/pom.xml 2010-05-18 14:57:32 UTC (rev 17098)
@@ -26,7 +26,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
- <groupId>org.richfaces.sandbox.ui</groupId>
+ <groupId>org.richfaces.ui-sandbox</groupId>
<artifactId>components</artifactId>
<version>4.0.0-SNAPSHOT</version>
</parent>
Modified: root/ui-sandbox/datascroller/trunk/parent/pom.xml
===================================================================
--- root/ui-sandbox/datascroller/trunk/parent/pom.xml 2010-05-18 14:13:33 UTC (rev 17097)
+++ root/ui-sandbox/datascroller/trunk/parent/pom.xml 2010-05-18 14:57:32 UTC (rev 17098)
@@ -55,35 +55,6 @@
<artifactId>annotations</artifactId>
<version>4.0.0-SNAPSHOT</version>
</dependency>
-
- <!-- Archetypes dependency -->
- <dependency>
- <groupId>org.apache.maven.archetype</groupId>
- <artifactId>archetype-packaging</artifactId>
- <version>2.0-alpha-4</version>
- </dependency>
-
- <!-- tests -->
- <dependency>
- <groupId>org.jboss.test-jsf</groupId>
- <artifactId>htmlunit-client</artifactId>
- <version>1.0.3</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.test-jsf</groupId>
- <artifactId>jsf-mock</artifactId>
- <version>1.0.3</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.test-jsf</groupId>
- <artifactId>jsf-test-stage</artifactId>
- <version>1.0.3</version>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.4</version>
- </dependency>
</dependencies>
</dependencyManagement>
Modified: root/ui-sandbox/datascroller/trunk/pom.xml
===================================================================
--- root/ui-sandbox/datascroller/trunk/pom.xml 2010-05-18 14:13:33 UTC (rev 17097)
+++ root/ui-sandbox/datascroller/trunk/pom.xml 2010-05-18 14:57:32 UTC (rev 17098)
@@ -26,7 +26,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
- <groupId>org.richfaces.sandbox.ui</groupId>
+ <groupId>org.richfaces.ui-sandbox</groupId>
<artifactId>components</artifactId>
<version>4.0.0-SNAPSHOT</version>
</parent>
Modified: root/ui-sandbox/datascroller/trunk/ui/pom.xml
===================================================================
--- root/ui-sandbox/datascroller/trunk/ui/pom.xml 2010-05-18 14:13:33 UTC (rev 17097)
+++ root/ui-sandbox/datascroller/trunk/ui/pom.xml 2010-05-18 14:57:32 UTC (rev 17098)
@@ -23,13 +23,14 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
<parent>
<groupId>org.richfaces.ui-sandbox</groupId>
<artifactId>datascroller-parent</artifactId>
<version>4.0.0-SNAPSHOT</version>
</parent>
- <modelVersion>4.0.0</modelVersion>
<groupId>org.richfaces.ui-sandbox</groupId>
<artifactId>datascroller-ui</artifactId>
<name>Richfaces UI Components: Datascroller UI</name>
Modified: root/ui-sandbox/pom.xml
===================================================================
--- root/ui-sandbox/pom.xml 2010-05-18 14:13:33 UTC (rev 17097)
+++ root/ui-sandbox/pom.xml 2010-05-18 14:57:32 UTC (rev 17098)
@@ -29,7 +29,7 @@
<version>1-SNAPSHOT</version>
</parent>
- <groupId>org.richfaces.sandbox.ui</groupId>
+ <groupId>org.richfaces.ui-sandbox</groupId>
<artifactId>components</artifactId>
<version>4.0.0-SNAPSHOT</version>
<packaging>pom</packaging>
@@ -48,35 +48,6 @@
<artifactId>annotations</artifactId>
<version>4.0.0-SNAPSHOT</version>
</dependency>
-
- <!-- Archetypes dependency -->
- <dependency>
- <groupId>org.apache.maven.archetype</groupId>
- <artifactId>archetype-packaging</artifactId>
- <version>2.0-alpha-4</version>
- </dependency>
-
- <!-- tests -->
- <dependency>
- <groupId>org.jboss.test-jsf</groupId>
- <artifactId>htmlunit-client</artifactId>
- <version>1.0.3</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.test-jsf</groupId>
- <artifactId>jsf-mock</artifactId>
- <version>1.0.3</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.test-jsf</groupId>
- <artifactId>jsf-test-stage</artifactId>
- <version>1.0.3</version>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.4</version>
- </dependency>
</dependencies>
</dependencyManagement>
Modified: root/ui-sandbox/tables/trunk/pom.xml
===================================================================
--- root/ui-sandbox/tables/trunk/pom.xml 2010-05-18 14:13:33 UTC (rev 17097)
+++ root/ui-sandbox/tables/trunk/pom.xml 2010-05-18 14:57:32 UTC (rev 17098)
@@ -24,7 +24,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
- <groupId>org.richfaces.sandbox.ui</groupId>
+ <groupId>org.richfaces.ui-sandbox</groupId>
<artifactId>components</artifactId>
<version>4.0.0-SNAPSHOT</version>
</parent>
14 years, 5 months
JBoss Rich Faces SVN: r17097 - root/build/resources/trunk/checkstyle.
by richfaces-svn-commits@lists.jboss.org
Author: jbalunas(a)redhat.com
Date: 2010-05-18 10:13:33 -0400 (Tue, 18 May 2010)
New Revision: 17097
Modified:
root/build/resources/trunk/checkstyle/pom.xml
Log:
Update for the release process of the checkstyle module
Modified: root/build/resources/trunk/checkstyle/pom.xml
===================================================================
--- root/build/resources/trunk/checkstyle/pom.xml 2010-05-18 14:09:24 UTC (rev 17096)
+++ root/build/resources/trunk/checkstyle/pom.xml 2010-05-18 14:13:33 UTC (rev 17097)
@@ -20,16 +20,28 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.richfaces</groupId>
+ <artifactId>richfaces-parent</artifactId>
+ <version>1-SNAPSHOT</version>
+ </parent>
+
<groupId>org.richfaces</groupId>
<artifactId>richfaces-build-checkstyle</artifactId>
+ <!-- TODO reversion to 1-SNAPSHOT before release -->
<version>4.0.0-SNAPSHOT</version>
-
<name>Richfaces Checkstyle</name>
- <parent>
- <groupId>org.richfaces</groupId>
- <artifactId>richfaces-parent</artifactId>
- <version>1-SNAPSHOT</version>
- </parent>
+ <description>Contains the checkstyle settings for the RichFaces project</description>
+
+ <build>
+ <plugins>
+ <!-- For the release this parent pom -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-release-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
</project>
\ No newline at end of file
14 years, 5 months