Author: Alex.Kolonitsky
Date: 2010-05-28 04:14:16 -0400 (Fri, 28 May 2010)
New Revision: 17340
Added:
root/ui/core/trunk/api/src/main/java/org/richfaces/view/facelets/html/AjaxPollHandler.java
root/ui/core/trunk/api/src/main/java/org/richfaces/view/facelets/html/AjaxPushHandler.java
Log:
fix build
Added:
root/ui/core/trunk/api/src/main/java/org/richfaces/view/facelets/html/AjaxPollHandler.java
===================================================================
---
root/ui/core/trunk/api/src/main/java/org/richfaces/view/facelets/html/AjaxPollHandler.java
(rev 0)
+++
root/ui/core/trunk/api/src/main/java/org/richfaces/view/facelets/html/AjaxPollHandler.java 2010-05-28
08:14:16 UTC (rev 17340)
@@ -0,0 +1,74 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright , 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.html;
+
+import javax.faces.event.ActionEvent;
+import javax.faces.view.facelets.*;
+import org.richfaces.MethodMetadata;
+import org.richfaces.component.AbstractPoll;
+
+public class AjaxPollHandler extends ComponentHandler {
+
+ private static final AjaxPollHandlerMetaRule META_RULE = new
AjaxPollHandlerMetaRule();
+
+
+ public AjaxPollHandler(ComponentConfig config) {
+ super(config);
+
+ }
+
+ protected MetaRuleset createMetaRuleset(Class type) {
+ MetaRuleset m = super.createMetaRuleset(type);
+ m.addRule(META_RULE);
+ return m;
+ }
+
+ static class AjaxPollHandlerMetaRule extends MetaRule{
+
+ public Metadata applyRule(String name, TagAttribute attribute, MetadataTarget
meta) {
+ if (meta.isTargetInstanceOf(AbstractPoll.class)) {
+ if ("action".equals(name)) {
+ return new MethodMetadata(attribute) {
+ public void applyMetadata(FaceletContext ctx, Object instance) {
+ ((AbstractPoll) instance).setAction(getMethodBinding(ctx));
+ }
+ };
+ }
+ if ("actionExpression".equals(name)) {
+ return new MethodMetadata(attribute) {
+ public void applyMetadata(FaceletContext ctx, Object instance) {
+ ((AbstractPoll)
instance).setActionExpression(getMethodExpression(ctx));
+ }
+ };
+ }
+ if ("actionListener".equals(name)) {
+ return new MethodMetadata(attribute, ActionEvent.class) {
+ public void applyMetadata(FaceletContext ctx, Object instance) {
+ ((AbstractPoll)
instance).setActionListener(getMethodBinding(ctx));
+ }
+ };
+ }
+ }
+ return null;
+ }
+ }
+}
Added:
root/ui/core/trunk/api/src/main/java/org/richfaces/view/facelets/html/AjaxPushHandler.java
===================================================================
---
root/ui/core/trunk/api/src/main/java/org/richfaces/view/facelets/html/AjaxPushHandler.java
(rev 0)
+++
root/ui/core/trunk/api/src/main/java/org/richfaces/view/facelets/html/AjaxPushHandler.java 2010-05-28
08:14:16 UTC (rev 17340)
@@ -0,0 +1,83 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright , 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.html;
+
+import javax.faces.event.ActionEvent;
+import javax.faces.view.facelets.*;
+import org.richfaces.MethodMetadata;
+import org.richfaces.component.AbstractPush;
+
+import java.util.EventListener;
+
+public class AjaxPushHandler extends ComponentHandler {
+
+ private static final AjaxPushHandlerMetaRule META_RULE = new
AjaxPushHandlerMetaRule();
+
+
+ public AjaxPushHandler(ComponentConfig config) {
+ super(config);
+
+ }
+
+ protected MetaRuleset createMetaRuleset(Class type) {
+ MetaRuleset m = super.createMetaRuleset(type);
+ m.addRule(META_RULE);
+ return m;
+ }
+
+ static class AjaxPushHandlerMetaRule extends MetaRule{
+
+ public Metadata applyRule(String name, TagAttribute attribute, MetadataTarget
meta) {
+ if (meta.isTargetInstanceOf(AbstractPush.class)) {
+ if ("action".equals(name)) {
+ return new MethodMetadata(attribute) {
+ public void applyMetadata(FaceletContext ctx, Object instance) {
+ ((AbstractPush) instance).setAction(getMethodBinding(ctx));
+ }
+ };
+ }
+ if ("actionExpression".equals(name)) {
+ return new MethodMetadata(attribute) {
+ public void applyMetadata(FaceletContext ctx, Object instance) {
+ ((AbstractPush)
instance).setActionExpression(getMethodExpression(ctx));
+ }
+ };
+ }
+ if ("actionListener".equals(name)) {
+ return new MethodMetadata(attribute, ActionEvent.class) {
+ public void applyMetadata(FaceletContext ctx, Object instance) {
+ ((AbstractPush)
instance).setActionListener(getMethodBinding(ctx));
+ }
+ };
+ }
+ if ("eventProducer".equals(name)) {
+ return new MethodMetadata(attribute, EventListener.class) {
+ public void applyMetadata(FaceletContext ctx, Object instance) {
+ ((AbstractPush)
instance).setEventProducer(getMethodExpression(ctx));
+ }
+ };
+ }
+ }
+ return null;
+ }
+ }
+}