Author: Alex.Kolonitsky
Date: 2010-03-01 08:29:51 -0500 (Mon, 01 Mar 2010)
New Revision: 16508
Modified:
root/cdk/trunk/plugins/attributes/src/test/java/org/richfaces/cdk/attributes/AttributesTest.java
root/cdk/trunk/pom.xml
root/ui/trunk/components/core/src/main/java/org/ajax4jsf/component/behavior/AjaxBehavior.java
root/ui/trunk/components/core/src/main/java/org/richfaces/component/UIAjaxFunction.java
root/ui/trunk/components/core/src/main/java/org/richfaces/component/UIAjaxLog.java
root/ui/trunk/components/core/src/main/java/org/richfaces/component/UIMediaOutput.java
root/ui/trunk/components/core/src/main/java/org/richfaces/component/UIPush.java
root/ui/trunk/components/core/src/main/java/org/richfaces/component/html/HtmlAjaxLog.java
root/ui/trunk/components/core/src/main/java/org/richfaces/renderkit/html/QueueRenderer.java
root/ui/trunk/components/core/src/main/java/org/richfaces/taglib/html/facelets/AjaxPushHandler.java
Log:
https://jira.jboss.org/jira/browse/RF-8232
Tags support - generate Taglib and TagHandlers
Modified:
root/cdk/trunk/plugins/attributes/src/test/java/org/richfaces/cdk/attributes/AttributesTest.java
===================================================================
---
root/cdk/trunk/plugins/attributes/src/test/java/org/richfaces/cdk/attributes/AttributesTest.java 2010-03-01
13:14:42 UTC (rev 16507)
+++
root/cdk/trunk/plugins/attributes/src/test/java/org/richfaces/cdk/attributes/AttributesTest.java 2010-03-01
13:29:51 UTC (rev 16508)
@@ -108,8 +108,6 @@
public void testMarshalUnmarshal() throws Exception {
String marshalledData = marshal(schemaSet);
- System.out.println("AttributesTest.testMarshalUnmarshal() " +
marshalledData);
-
assertNotNull(marshalledData);
assertTrue(marshalledData.length() > 0);
Modified: root/cdk/trunk/pom.xml
===================================================================
--- root/cdk/trunk/pom.xml 2010-03-01 13:14:42 UTC (rev 16507)
+++ root/cdk/trunk/pom.xml 2010-03-01 13:29:51 UTC (rev 16508)
@@ -4,6 +4,8 @@
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>
<groupId>org.richfaces</groupId>
@@ -102,6 +104,12 @@
<build>
<plugins>
<plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <forkMode>never</forkMode>
+ </configuration>
+ </plugin>
+ <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.1</version>
@@ -139,7 +147,7 @@
<suppressionsLocation>checkstyle-suppressions.xml</suppressionsLocation>
</configuration>
- <phase>verify</phase>
+ <phase>process-sources</phase>
<goals>
<goal>check</goal>
</goals>
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 2010-03-01
13:14:42 UTC (rev 16507)
+++
root/ui/trunk/components/core/src/main/java/org/ajax4jsf/component/behavior/AjaxBehavior.java 2010-03-01
13:29:51 UTC (rev 16508)
@@ -12,10 +12,17 @@
import org.ajax4jsf.component.AjaxClientBehavior;
import org.ajax4jsf.renderkit.AjaxRendererUtils;
+import org.ajax4jsf.facelets.tag.AjaxHandler;
+import org.richfaces.cdk.annotations.JsfBehavior;
+import org.richfaces.cdk.annotations.Tag;
/**
* @author Anton Belevich
*/
+@JsfBehavior(
+ id = "org.ajax4jsf.behavior.Ajax",
+ tag = @Tag(name = "ajax", handler = AjaxHandler.class)
+)
@FacesBehavior(value = "org.ajax4jsf.behavior.Ajax")
public class AjaxBehavior extends javax.faces.component.behavior.AjaxBehavior implements
AjaxClientBehavior {
public static final String BEHAVIOR_ID = "org.ajax4jsf.behavior.Ajax";
Modified:
root/ui/trunk/components/core/src/main/java/org/richfaces/component/UIAjaxFunction.java
===================================================================
---
root/ui/trunk/components/core/src/main/java/org/richfaces/component/UIAjaxFunction.java 2010-03-01
13:14:42 UTC (rev 16507)
+++
root/ui/trunk/components/core/src/main/java/org/richfaces/component/UIAjaxFunction.java 2010-03-01
13:29:51 UTC (rev 16508)
@@ -24,12 +24,19 @@
package org.richfaces.component;
import org.ajax4jsf.component.AjaxActionComponent;
+import org.richfaces.cdk.annotations.Component;
+import org.richfaces.cdk.annotations.Tag;
/**
* @author asmirnov(a)exadel.com (latest modification by $Author: alexsmirnov $)
* @version $Revision: 1.1.2.2 $ $Date: 2007/01/23 20:01:04 $
*
*/
+@Component(
+ value = "org.richfaces.Function",
+ tag = @Tag(name = "jsFunction"),
+ generate = false
+)
public abstract class UIAjaxFunction extends AjaxActionComponent {
public static final String COMPONENT_TYPE = "org.richfaces.Function";
Modified:
root/ui/trunk/components/core/src/main/java/org/richfaces/component/UIAjaxLog.java
===================================================================
---
root/ui/trunk/components/core/src/main/java/org/richfaces/component/UIAjaxLog.java 2010-03-01
13:14:42 UTC (rev 16507)
+++
root/ui/trunk/components/core/src/main/java/org/richfaces/component/UIAjaxLog.java 2010-03-01
13:29:51 UTC (rev 16508)
@@ -23,6 +23,9 @@
package org.richfaces.component;
+import org.richfaces.cdk.annotations.Component;
+import org.richfaces.cdk.annotations.Tag;
+
import javax.faces.application.ResourceDependencies;
import javax.faces.application.ResourceDependency;
import javax.faces.component.UIComponentBase;
@@ -35,6 +38,11 @@
@ResourceDependency(name = "jquery.js") , @ResourceDependency(name =
"richfaces.js") ,
@ResourceDependency(name = "richfaces-jsf-log.js") ,
@ResourceDependency(name = "richfaces.css")
})
+@Component (
+ value = "org.richfaces.AjaxLog",
+ tag = @Tag(name = "log"),
+ generate = false
+)
public class UIAjaxLog extends UIComponentBase {
public static final String COMPONENT_FAMILY = "org.richfaces.AjaxLog";
Modified:
root/ui/trunk/components/core/src/main/java/org/richfaces/component/UIMediaOutput.java
===================================================================
---
root/ui/trunk/components/core/src/main/java/org/richfaces/component/UIMediaOutput.java 2010-03-01
13:14:42 UTC (rev 16507)
+++
root/ui/trunk/components/core/src/main/java/org/richfaces/component/UIMediaOutput.java 2010-03-01
13:29:51 UTC (rev 16508)
@@ -36,11 +36,19 @@
import org.richfaces.resource.MediaOutputResource;
import org.richfaces.webapp.taglib.MethodBindingMethodExpressionAdaptor;
import org.richfaces.webapp.taglib.MethodExpressionMethodBindingAdaptor;
+import org.richfaces.cdk.annotations.Component;
+import org.richfaces.cdk.annotations.Tag;
+import org.richfaces.taglib.html.facelets.MediaOutputHandler;
/**
* @author shura
*
*/
+@Component(
+ value = "org.richfaces.MediaOutput",
+ tag = @Tag(name = "mediaOutput", handler = MediaOutputHandler.class),
+ generate = false
+)
public abstract class UIMediaOutput extends UIOutput implements ResourceComponent2 {
public static final String COMPONENT_TYPE = "org.richfaces.MediaOutput";
Modified: root/ui/trunk/components/core/src/main/java/org/richfaces/component/UIPush.java
===================================================================
---
root/ui/trunk/components/core/src/main/java/org/richfaces/component/UIPush.java 2010-03-01
13:14:42 UTC (rev 16507)
+++
root/ui/trunk/components/core/src/main/java/org/richfaces/component/UIPush.java 2010-03-01
13:29:51 UTC (rev 16508)
@@ -23,7 +23,14 @@
package org.richfaces.component;
+import org.richfaces.cdk.annotations.Component;
+import org.richfaces.cdk.annotations.Tag;
+import org.richfaces.cdk.annotations.Attribute;
+import org.richfaces.cdk.annotations.Signature;
+import org.richfaces.taglib.html.facelets.AjaxPushHandler;
+
import java.io.IOException;
+import java.util.EventListener;
import javax.el.MethodExpression;
@@ -40,12 +47,21 @@
* @author shura
*
*/
+@Component(
+ value = "org.richfaces.Push",
+ tag = @Tag(name = "push", handler = AjaxPushHandler.class),
+ generate = false
+)
public class UIPush extends UICommand {
public static final String COMPONENT_FAMILY = "org.richfaces.Push";
public static final String COMPONENT_TYPE = "org.richfaces.Push";
private transient boolean hasActiveBehavior = false;
- private static enum PropertyKeys {eventProducer, enabled, interval}
+ private static enum PropertyKeys {
+ eventProducer,
+ enabled,
+ interval
+ }
@Override
public void encodeBegin(FacesContext context) throws IOException {
@@ -82,6 +98,8 @@
return id.toString();
}
+ @Attribute
+ @Signature(parameters = EventListener.class)
public MethodExpression getEventProducer() {
return (MethodExpression) getStateHelper().get(PropertyKeys.eventProducer);
}
Modified:
root/ui/trunk/components/core/src/main/java/org/richfaces/component/html/HtmlAjaxLog.java
===================================================================
---
root/ui/trunk/components/core/src/main/java/org/richfaces/component/html/HtmlAjaxLog.java 2010-03-01
13:14:42 UTC (rev 16507)
+++
root/ui/trunk/components/core/src/main/java/org/richfaces/component/html/HtmlAjaxLog.java 2010-03-01
13:29:51 UTC (rev 16508)
@@ -28,7 +28,9 @@
*
*/
import org.richfaces.component.UIAjaxLog;
+import org.richfaces.cdk.annotations.Component;
+@Component(value = "org.richfaces.AjaxLog", generate = false)
public class HtmlAjaxLog extends UIAjaxLog {
public static final String COMPONENT_TYPE = "org.richfaces.AjaxLog";
Modified:
root/ui/trunk/components/core/src/main/java/org/richfaces/renderkit/html/QueueRenderer.java
===================================================================
---
root/ui/trunk/components/core/src/main/java/org/richfaces/renderkit/html/QueueRenderer.java 2010-03-01
13:14:42 UTC (rev 16507)
+++
root/ui/trunk/components/core/src/main/java/org/richfaces/renderkit/html/QueueRenderer.java 2010-03-01
13:29:51 UTC (rev 16508)
@@ -34,6 +34,7 @@
* @author Nick Belaevski
*
*/
+(a)org.richfaces.cdk.annotations.Renderer
@ResourceDependencies( { @ResourceDependency(library = "javax.faces", name =
"jsf.js"),
@ResourceDependency(name = "jquery.js"), @ResourceDependency(name =
"richfaces.js"),
@ResourceDependency(name = "richfaces-queue.js")
Modified:
root/ui/trunk/components/core/src/main/java/org/richfaces/taglib/html/facelets/AjaxPushHandler.java
===================================================================
---
root/ui/trunk/components/core/src/main/java/org/richfaces/taglib/html/facelets/AjaxPushHandler.java 2010-03-01
13:14:42 UTC (rev 16507)
+++
root/ui/trunk/components/core/src/main/java/org/richfaces/taglib/html/facelets/AjaxPushHandler.java 2010-03-01
13:29:51 UTC (rev 16508)
@@ -36,28 +36,13 @@
import org.richfaces.component.UIPush;
-/**
- * @author shura (latest modification by $Author$)
- * @version $Revision$ $Date: 2009-07-31 14:34:48 +0300 (Пт, 31 июл
- * 2009) $
- *
- */
public class AjaxPushHandler extends ComponentHandler {
private static final MetaRule AJAX_PUSH_META_RULE = new AjaxPushMetaRule();
- /**
- * @param config
- */
public AjaxPushHandler(ComponentConfig config) {
super(config);
}
- /*
- * (non-Javadoc)
- *
- * @see
- * org.ajax4jsf.tag.AjaxComponentHandler#createMetaRuleset(java.lang.Class)
- */
@Override
protected MetaRuleset createMetaRuleset(Class type) {
MetaRuleset metaRules = super.createMetaRuleset(type);
@@ -67,57 +52,25 @@
return metaRules;
}
- /**
- * @author shura (latest modification by $Author$)
- * @version $Revision$ $Date: 2009-07-31 14:34:48 +0300 (Пт, 31
- * июл 2009) $
- *
- */
static class AjaxPushActionMapper extends Metadata {
private static final Class<?>[] AJAX_PUSH_ACTION_SIG = new Class[]
{EventListener.class};
private final TagAttribute send;
- /**
- * @param attribute
- */
public AjaxPushActionMapper(TagAttribute attribute) {
send = attribute;
}
- /*
- * (non-Javadoc)
- *
- * @seecom.sun.facelets.tag.Metadata#applyMetadata(com.sun.facelets.
- * FaceletContext, java.lang.Object)
- */
public void applyMetadata(FaceletContext ctx, Object instance) {
((UIPush) instance).setEventProducer(this.send.getMethodExpression(ctx, null,
AJAX_PUSH_ACTION_SIG));
}
}
-
- /**
- * @author shura (latest modification by $Author$)
- * @version $Revision$ $Date: 2009-07-31 14:34:48 +0300 (Пт, 31
- * июл 2009) $
- *
- */
static class AjaxPushMetaRule extends MetaRule {
- /**
- *
- */
public AjaxPushMetaRule() {
super();
}
- /*
- * (non-Javadoc)
- *
- * @see com.sun.facelets.tag.MetaRule#applyRule(java.lang.String,
- * com.sun.facelets.tag.TagAttribute,
- * com.sun.facelets.tag.MetadataTarget)
- */
public Metadata applyRule(String name, TagAttribute attribute, MetadataTarget
meta) {
if (meta.isTargetInstanceOf(UIPush.class)) {
if ("eventProducer".equals(name)) {