Author: nbelaevski
Date: 2008-04-07 18:49:35 -0400 (Mon, 07 Apr 2008)
New Revision: 7649
Added:
branches/3.2.x/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/
branches/3.2.x/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/ActionParamHandler.java
branches/3.2.x/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/AjaxListenerHandler.java
branches/3.2.x/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/AjaxPushHandler.java
branches/3.2.x/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/AjaxSupportHandler.java
branches/3.2.x/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/FacetHandler.java
branches/3.2.x/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/IncludeFaceletContext.java
branches/3.2.x/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/IncludeHandler.java
branches/3.2.x/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/KeepAliveHandler.java
branches/3.2.x/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/MediaOutputHandler.java
branches/3.2.x/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/RowKeyConverterRule.java
branches/3.2.x/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/package-info.java
Removed:
branches/3.2.x/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/ActionParamHandler.java
branches/3.2.x/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/AjaxListenerHandler.java
branches/3.2.x/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/AjaxSupportHandler.java
branches/3.2.x/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/FacetHandler.java
branches/3.2.x/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/IncludeFaceletContext.java
branches/3.2.x/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/IncludeHandler.java
branches/3.2.x/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/KeepAliveHandler.java
branches/3.2.x/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/MediaOutputHandler.java
branches/3.2.x/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/RowKeyConverterRule.java
branches/3.2.x/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/package-info.java
Log:
reverted changes from r7644-r7646
Copied: branches/3.2.x/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets (from rev
7566, branches/3.2.x/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets)
Deleted:
branches/3.2.x/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/ActionParamHandler.java
===================================================================
---
branches/3.2.x/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/ActionParamHandler.java 2008-04-02
00:36:29 UTC (rev 7566)
+++
branches/3.2.x/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/ActionParamHandler.java 2008-04-07
22:49:35 UTC (rev 7649)
@@ -1,176 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.taglib.html.facelets;
-
-import javax.faces.application.Application;
-import javax.faces.component.ActionSource;
-import javax.faces.component.UIComponent;
-import javax.faces.context.FacesContext;
-import javax.faces.convert.Converter;
-
-import org.ajax4jsf.Messages;
-import org.ajax4jsf.component.UIActionParameter;
-
-import com.sun.facelets.FaceletContext;
-import com.sun.facelets.tag.MetaRule;
-import com.sun.facelets.tag.MetaRuleset;
-import com.sun.facelets.tag.Metadata;
-import com.sun.facelets.tag.MetadataTarget;
-import com.sun.facelets.tag.TagAttribute;
-import com.sun.facelets.tag.TagAttributeException;
-import com.sun.facelets.tag.jsf.ComponentConfig;
-import com.sun.facelets.tag.jsf.ComponentHandler;
-
-/**
- * @author shura (latest modification by $Author: alexsmirnov $)
- * @version $Revision: 1.1.2.1 $ $Date: 2007/02/01 15:31:23 $
- *
- */
-public class ActionParamHandler extends ComponentHandler {
-
- /**
- * @author shura (latest modification by $Author: alexsmirnov $)
- * @version $Revision: 1.1.2.1 $ $Date: 2007/02/01 15:31:23 $
- *
- */
- public static class ActionParamMetaRule extends MetaRule {
-
- /* (non-Javadoc)
- * @see
org.ajax4jsf.tag.SuggestionHandler.SuggestionMetaRule#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(UIActionParameter.class)) {
- if ("assignTo".equals(name)) {
- return new AssignToValueBindingMetadata(attribute);
- } else if ("converter".equals(name)) {
- if (attribute.isLiteral()) {
- return new LiteralConverterMetadata(attribute.getValue());
- } else {
- return new DynamicConverterMetadata(attribute);
- }
-
- }
- }
-
- return null;
- }
-
-
- }
-
- final static class LiteralConverterMetadata extends Metadata {
-
- private final String converterId;
-
- public LiteralConverterMetadata(String converterId) {
- this.converterId = converterId;
- }
-
- public void applyMetadata(FaceletContext ctx, Object instance) {
- ((UIActionParameter) instance).setConverter(ctx.getFacesContext()
- .getApplication().createConverter(this.converterId));
- }
- }
-
- final static class DynamicConverterMetadata extends Metadata {
-
- private final TagAttribute attr;
-
- public DynamicConverterMetadata(TagAttribute attr) {
- this.attr = attr;
- }
-
- public void applyMetadata(FaceletContext ctx, Object instance) {
- ((UIActionParameter) instance).setConverter((Converter) this.attr
- .getObject(ctx, Converter.class));
- }
- }
-
- final static class AssignToValueBindingMetadata extends Metadata {
-
- private final TagAttribute attr;
-
- public AssignToValueBindingMetadata(TagAttribute attr) {
- this.attr = attr;
- }
-
- public void applyMetadata(FaceletContext ctx, Object instance) {
- ((UIActionParameter)
instance).setAssignToBinding(attr.getValueExpression(ctx,
- Object.class));
- }
- }
-
-
- private TagAttribute _assignTo;
- private TagAttribute _converter;
-
- /**
- * @param config
- */
- public ActionParamHandler(ComponentConfig config) {
- super(config);
- _assignTo = getAttribute("assignTo");
- _converter = getAttribute("converter");
- if(null != _assignTo) {
- if (_assignTo.isLiteral()) {
- throw new TagAttributeException(this.tag, this._assignTo,
Messages.getMessage(Messages.MUST_BE_EXPRESSION_ERROR));
- }
-
- }
- // TODO Auto-generated constructor stub
- }
- /*
- * (non-Javadoc)
- *
- * @see com.sun.facelets.FaceletHandler#apply(com.sun.facelets.FaceletContext,
- * javax.faces.component.UIComponent)
- */
- public void onComponentCreated(FaceletContext ctx, UIComponent c, UIComponent parent)
{
- if (parent instanceof ActionSource)
- {
- FacesContext facesContext = FacesContext.getCurrentInstance();
- Application application = facesContext.getApplication();
- if (_assignTo != null) {
- UIActionParameter al = (UIActionParameter)c;
- // TODO - in jsf 1.2 use ELValueExpression
-//
al.setAssignToBinding(application.createValueBinding(_assignTo.getValue()));
-// if (_converter != null) {
-// Converter converter =
application.createConverter(_converter.getValue(ctx));
-// al.setConverter(converter);
-// }
- ((ActionSource)parent).addActionListener(al);
- }
- }
- }
-
- private static final ActionParamMetaRule actionParamMetaRule = new
ActionParamMetaRule();
-
- /* (non-Javadoc)
- * @see org.ajax4jsf.tag.AjaxComponentHandler#createMetaRuleset(java.lang.Class)
- */
- protected MetaRuleset createMetaRuleset(Class type) {
- MetaRuleset metaRules = super.createMetaRuleset(type);
- metaRules.addRule(actionParamMetaRule);
- return metaRules;
- }
-
-}
Copied:
branches/3.2.x/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/ActionParamHandler.java
(from rev 7566,
branches/3.2.x/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/ActionParamHandler.java)
===================================================================
---
branches/3.2.x/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/ActionParamHandler.java
(rev 0)
+++
branches/3.2.x/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/ActionParamHandler.java 2008-04-07
22:49:35 UTC (rev 7649)
@@ -0,0 +1,176 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf.taglib.html.facelets;
+
+import javax.faces.application.Application;
+import javax.faces.component.ActionSource;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.convert.Converter;
+
+import org.ajax4jsf.Messages;
+import org.ajax4jsf.component.UIActionParameter;
+
+import com.sun.facelets.FaceletContext;
+import com.sun.facelets.tag.MetaRule;
+import com.sun.facelets.tag.MetaRuleset;
+import com.sun.facelets.tag.Metadata;
+import com.sun.facelets.tag.MetadataTarget;
+import com.sun.facelets.tag.TagAttribute;
+import com.sun.facelets.tag.TagAttributeException;
+import com.sun.facelets.tag.jsf.ComponentConfig;
+import com.sun.facelets.tag.jsf.ComponentHandler;
+
+/**
+ * @author shura (latest modification by $Author: alexsmirnov $)
+ * @version $Revision: 1.1.2.1 $ $Date: 2007/02/01 15:31:23 $
+ *
+ */
+public class ActionParamHandler extends ComponentHandler {
+
+ /**
+ * @author shura (latest modification by $Author: alexsmirnov $)
+ * @version $Revision: 1.1.2.1 $ $Date: 2007/02/01 15:31:23 $
+ *
+ */
+ public static class ActionParamMetaRule extends MetaRule {
+
+ /* (non-Javadoc)
+ * @see
org.ajax4jsf.tag.SuggestionHandler.SuggestionMetaRule#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(UIActionParameter.class)) {
+ if ("assignTo".equals(name)) {
+ return new AssignToValueBindingMetadata(attribute);
+ } else if ("converter".equals(name)) {
+ if (attribute.isLiteral()) {
+ return new LiteralConverterMetadata(attribute.getValue());
+ } else {
+ return new DynamicConverterMetadata(attribute);
+ }
+
+ }
+ }
+
+ return null;
+ }
+
+
+ }
+
+ final static class LiteralConverterMetadata extends Metadata {
+
+ private final String converterId;
+
+ public LiteralConverterMetadata(String converterId) {
+ this.converterId = converterId;
+ }
+
+ public void applyMetadata(FaceletContext ctx, Object instance) {
+ ((UIActionParameter) instance).setConverter(ctx.getFacesContext()
+ .getApplication().createConverter(this.converterId));
+ }
+ }
+
+ final static class DynamicConverterMetadata extends Metadata {
+
+ private final TagAttribute attr;
+
+ public DynamicConverterMetadata(TagAttribute attr) {
+ this.attr = attr;
+ }
+
+ public void applyMetadata(FaceletContext ctx, Object instance) {
+ ((UIActionParameter) instance).setConverter((Converter) this.attr
+ .getObject(ctx, Converter.class));
+ }
+ }
+
+ final static class AssignToValueBindingMetadata extends Metadata {
+
+ private final TagAttribute attr;
+
+ public AssignToValueBindingMetadata(TagAttribute attr) {
+ this.attr = attr;
+ }
+
+ public void applyMetadata(FaceletContext ctx, Object instance) {
+ ((UIActionParameter)
instance).setAssignToBinding(attr.getValueExpression(ctx,
+ Object.class));
+ }
+ }
+
+
+ private TagAttribute _assignTo;
+ private TagAttribute _converter;
+
+ /**
+ * @param config
+ */
+ public ActionParamHandler(ComponentConfig config) {
+ super(config);
+ _assignTo = getAttribute("assignTo");
+ _converter = getAttribute("converter");
+ if(null != _assignTo) {
+ if (_assignTo.isLiteral()) {
+ throw new TagAttributeException(this.tag, this._assignTo,
Messages.getMessage(Messages.MUST_BE_EXPRESSION_ERROR));
+ }
+
+ }
+ // TODO Auto-generated constructor stub
+ }
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.sun.facelets.FaceletHandler#apply(com.sun.facelets.FaceletContext,
+ * javax.faces.component.UIComponent)
+ */
+ public void onComponentCreated(FaceletContext ctx, UIComponent c, UIComponent parent)
{
+ if (parent instanceof ActionSource)
+ {
+ FacesContext facesContext = FacesContext.getCurrentInstance();
+ Application application = facesContext.getApplication();
+ if (_assignTo != null) {
+ UIActionParameter al = (UIActionParameter)c;
+ // TODO - in jsf 1.2 use ELValueExpression
+//
al.setAssignToBinding(application.createValueBinding(_assignTo.getValue()));
+// if (_converter != null) {
+// Converter converter =
application.createConverter(_converter.getValue(ctx));
+// al.setConverter(converter);
+// }
+ ((ActionSource)parent).addActionListener(al);
+ }
+ }
+ }
+
+ private static final ActionParamMetaRule actionParamMetaRule = new
ActionParamMetaRule();
+
+ /* (non-Javadoc)
+ * @see org.ajax4jsf.tag.AjaxComponentHandler#createMetaRuleset(java.lang.Class)
+ */
+ protected MetaRuleset createMetaRuleset(Class type) {
+ MetaRuleset metaRules = super.createMetaRuleset(type);
+ metaRules.addRule(actionParamMetaRule);
+ return metaRules;
+ }
+
+}
Deleted:
branches/3.2.x/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/AjaxListenerHandler.java
===================================================================
---
branches/3.2.x/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/AjaxListenerHandler.java 2008-04-02
00:36:29 UTC (rev 7566)
+++
branches/3.2.x/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/AjaxListenerHandler.java 2008-04-07
22:49:35 UTC (rev 7649)
@@ -1,122 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.taglib.html.facelets;
-
-import java.io.IOException;
-
-import javax.el.ELException;
-import javax.el.ValueExpression;
-import javax.faces.FacesException;
-import javax.faces.component.UIComponent;
-
-import org.ajax4jsf.Messages;
-import org.ajax4jsf.event.AjaxListener;
-import org.ajax4jsf.event.AjaxListenerHelper;
-import org.ajax4jsf.event.AjaxSource;
-
-import com.sun.facelets.FaceletContext;
-import com.sun.facelets.FaceletException;
-import com.sun.facelets.el.LegacyValueBinding;
-import com.sun.facelets.tag.TagAttribute;
-import com.sun.facelets.tag.TagAttributeException;
-import com.sun.facelets.tag.TagConfig;
-import com.sun.facelets.tag.TagException;
-import com.sun.facelets.tag.TagHandler;
-
-/**
- * Register an ActionListener instance on the UIComponent associated with the
- * closest parent UIComponent custom action. <p/> See <a
target="_new"
- *
href="http://java.sun.com/j2ee/javaserverfaces/1.1_01/docs/tlddocs/f...
- * documentation</a>.
- *
- * @see javax.faces.event.ActionListener
- * @see javax.faces.component.AjaxContainer
- * @author Jacob Hookom
- * @version $Id: AjaxListenerHandler.java,v 1.1.2.1 2007/02/01 15:31:23 alexsmirnov Exp
$
- */
-public final class AjaxListenerHandler extends TagHandler {
-
- private Class listenerType;
-
- private final TagAttribute type;
-
- private final TagAttribute binding;
-
- /**
- * @param config
- */
- public AjaxListenerHandler(TagConfig config) {
- super(config);
- this.binding = this.getAttribute("binding");
- this.type = this.getAttribute("type");
- if(binding == null && type == null){
- throw new TagException(this.tag, "One of the attribute 'binding'
or type' is required");
- }
- if (binding == null && type != null) {
- if (!type.isLiteral()) {
- throw new TagAttributeException(this.tag, this.type,
Messages.getMessage(Messages.MUST_BE_LITERAL_ERROR));
- }
- try {
- this.listenerType = Class.forName(type.getValue());
- } catch (Exception e) {
- throw new TagAttributeException(this.tag, this.type, e);
- }
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.sun.facelets.FaceletHandler#apply(com.sun.facelets.FaceletContext,
- * javax.faces.component.UIComponent)
- */
- public void apply(FaceletContext ctx, UIComponent parent)
- throws IOException, FacesException, FaceletException, ELException {
- if (parent instanceof AjaxSource) {
- // only process if parent was just created
- if (parent.getParent() == null) {
- AjaxSource src = (AjaxSource) parent;
- AjaxListener listener = null;
- ValueExpression ve = null;
- if (this.binding != null) {
- ve = this.binding.getValueExpression(ctx,
- AjaxListener.class);
- // TODO - handle both JSF 1.2/1.1 cases.
- listener = new AjaxListenerHelper(new LegacyValueBinding(ve));
- }
- if (listener == null) {
- try {
- listener = (AjaxListener) listenerType.newInstance();
- } catch (Exception e) {
- throw new TagAttributeException(this.tag, this.type,
e.getCause());
- }
- if (ve != null) {
- ve.setValue(ctx, ve);
- }
- }
- src.addAjaxListener(listener);
- }
- } else {
- throw new TagException(this.tag,
Messages.getMessage(Messages.NOT_PARENT_AJAX_COMPONENT_ERROR, parent));
- }
- }
-}
Copied:
branches/3.2.x/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/AjaxListenerHandler.java
(from rev 7566,
branches/3.2.x/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/AjaxListenerHandler.java)
===================================================================
---
branches/3.2.x/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/AjaxListenerHandler.java
(rev 0)
+++
branches/3.2.x/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/AjaxListenerHandler.java 2008-04-07
22:49:35 UTC (rev 7649)
@@ -0,0 +1,122 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf.taglib.html.facelets;
+
+import java.io.IOException;
+
+import javax.el.ELException;
+import javax.el.ValueExpression;
+import javax.faces.FacesException;
+import javax.faces.component.UIComponent;
+
+import org.ajax4jsf.Messages;
+import org.ajax4jsf.event.AjaxListener;
+import org.ajax4jsf.event.AjaxListenerHelper;
+import org.ajax4jsf.event.AjaxSource;
+
+import com.sun.facelets.FaceletContext;
+import com.sun.facelets.FaceletException;
+import com.sun.facelets.el.LegacyValueBinding;
+import com.sun.facelets.tag.TagAttribute;
+import com.sun.facelets.tag.TagAttributeException;
+import com.sun.facelets.tag.TagConfig;
+import com.sun.facelets.tag.TagException;
+import com.sun.facelets.tag.TagHandler;
+
+/**
+ * Register an ActionListener instance on the UIComponent associated with the
+ * closest parent UIComponent custom action. <p/> See <a
target="_new"
+ *
href="http://java.sun.com/j2ee/javaserverfaces/1.1_01/docs/tlddocs/f...
+ * documentation</a>.
+ *
+ * @see javax.faces.event.ActionListener
+ * @see javax.faces.component.AjaxContainer
+ * @author Jacob Hookom
+ * @version $Id: AjaxListenerHandler.java,v 1.1.2.1 2007/02/01 15:31:23 alexsmirnov Exp
$
+ */
+public final class AjaxListenerHandler extends TagHandler {
+
+ private Class listenerType;
+
+ private final TagAttribute type;
+
+ private final TagAttribute binding;
+
+ /**
+ * @param config
+ */
+ public AjaxListenerHandler(TagConfig config) {
+ super(config);
+ this.binding = this.getAttribute("binding");
+ this.type = this.getAttribute("type");
+ if(binding == null && type == null){
+ throw new TagException(this.tag, "One of the attribute 'binding'
or type' is required");
+ }
+ if (binding == null && type != null) {
+ if (!type.isLiteral()) {
+ throw new TagAttributeException(this.tag, this.type,
Messages.getMessage(Messages.MUST_BE_LITERAL_ERROR));
+ }
+ try {
+ this.listenerType = Class.forName(type.getValue());
+ } catch (Exception e) {
+ throw new TagAttributeException(this.tag, this.type, e);
+ }
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.sun.facelets.FaceletHandler#apply(com.sun.facelets.FaceletContext,
+ * javax.faces.component.UIComponent)
+ */
+ public void apply(FaceletContext ctx, UIComponent parent)
+ throws IOException, FacesException, FaceletException, ELException {
+ if (parent instanceof AjaxSource) {
+ // only process if parent was just created
+ if (parent.getParent() == null) {
+ AjaxSource src = (AjaxSource) parent;
+ AjaxListener listener = null;
+ ValueExpression ve = null;
+ if (this.binding != null) {
+ ve = this.binding.getValueExpression(ctx,
+ AjaxListener.class);
+ // TODO - handle both JSF 1.2/1.1 cases.
+ listener = new AjaxListenerHelper(new LegacyValueBinding(ve));
+ }
+ if (listener == null) {
+ try {
+ listener = (AjaxListener) listenerType.newInstance();
+ } catch (Exception e) {
+ throw new TagAttributeException(this.tag, this.type,
e.getCause());
+ }
+ if (ve != null) {
+ ve.setValue(ctx, ve);
+ }
+ }
+ src.addAjaxListener(listener);
+ }
+ } else {
+ throw new TagException(this.tag,
Messages.getMessage(Messages.NOT_PARENT_AJAX_COMPONENT_ERROR, parent));
+ }
+ }
+}
Added:
branches/3.2.x/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/AjaxPushHandler.java
===================================================================
---
branches/3.2.x/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/AjaxPushHandler.java
(rev 0)
+++
branches/3.2.x/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/AjaxPushHandler.java 2008-04-07
22:49:35 UTC (rev 7649)
@@ -0,0 +1,118 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf.taglib.html.facelets;
+
+import java.util.EventListener;
+
+import org.ajax4jsf.component.UIPush;
+
+import com.sun.facelets.FaceletContext;
+import com.sun.facelets.tag.MetaRule;
+import com.sun.facelets.tag.MetaRuleset;
+import com.sun.facelets.tag.Metadata;
+import com.sun.facelets.tag.MetadataTarget;
+import com.sun.facelets.tag.TagAttribute;
+import com.sun.facelets.tag.jsf.ComponentConfig;
+import com.sun.facelets.tag.jsf.ComponentHandler;
+
+/**
+ * @author shura (latest modification by $Author: alexsmirnov $)
+ * @version $Revision: 7646 $ $Date: 2008-04-08 01:31:52 +0300 (Вт, 08 апр 2008) $
+ *
+ */
+public class AjaxPushHandler extends ComponentHandler {
+
+ private static final MetaRule ajaxPushMetaRule = new AjaxPushMetaRule();
+ /**
+ * @param config
+ */
+ public AjaxPushHandler(ComponentConfig config) {
+ super(config);
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.ajax4jsf.tag.AjaxComponentHandler#createMetaRuleset(java.lang.Class)
+ */
+ protected MetaRuleset createMetaRuleset(Class type) {
+ MetaRuleset metaRules = super.createMetaRuleset(type);
+ metaRules.addRule(ajaxPushMetaRule);
+ return metaRules;
+ }
+
+ /**
+ * @author shura (latest modification by $Author: alexsmirnov $)
+ * @version $Revision: 7646 $ $Date: 2008-04-08 01:31:52 +0300 (Вт, 08 апр 2008) $
+ *
+ */
+ 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)) {
+ return new AjaxPushActionMapper(attribute);
+ }
+ }
+ return null;
+ }
+
+ }
+ /**
+ * @author shura (latest modification by $Author: alexsmirnov $)
+ * @version $Revision: 7646 $ $Date: 2008-04-08 01:31:52 +0300 (Вт, 08 апр 2008) $
+ *
+ */
+ 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)
+ * @see com.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));
+ }
+
+ }
+
+}
Deleted:
branches/3.2.x/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/AjaxSupportHandler.java
===================================================================
---
branches/3.2.x/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/AjaxSupportHandler.java 2008-04-02
00:36:29 UTC (rev 7566)
+++
branches/3.2.x/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/AjaxSupportHandler.java 2008-04-07
22:49:35 UTC (rev 7649)
@@ -1,98 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.taglib.html.facelets;
-
-import java.io.IOException;
-
-import javax.el.ELException;
-import javax.faces.FacesException;
-import javax.faces.component.UIComponent;
-import javax.faces.component.UIComponentBase;
-
-import org.ajax4jsf.taglib.html.jsp.AjaxSupportTag;
-import org.ajax4jsf.webapp.taglib.AjaxComponentHandler;
-
-import com.sun.facelets.FaceletContext;
-import com.sun.facelets.FaceletException;
-import com.sun.facelets.tag.TagAttribute;
-import com.sun.facelets.tag.TagHandler;
-import com.sun.facelets.tag.jsf.ComponentConfig;
-
-/**
- * "proxy" class for creating UIAjaxSupport component as facet for it's
parent.
- * @author shura (latest modification by $Author: alexsmirnov $)
- * @version $Revision: 1.1.2.1 $ $Date: 2007/02/01 15:31:22 $
- *
- */
-public class AjaxSupportHandler extends TagHandler {
- /**
- * A UIComponent for capturing a child UIComponent, representative of the
- * desired Facet
- *
- * @author Jacob Hookom
- *
- */
- private final static class UIFacet extends UIComponentBase {
- public String getFamily() {
- return null;
- }
- }
-
- /**
- * Real tag handler for create component.
- */
- private TagHandler _ajaxSupportHandler;
-
- private TagAttribute _event;
- /**
- * @param config
- */
- public AjaxSupportHandler(ComponentConfig config) {
- super(config);
- _event = getRequiredAttribute("event");
- _ajaxSupportHandler = new AjaxComponentHandler(config);
- }
-
- /* (non-Javadoc)
- * @see com.sun.facelets.FaceletHandler#apply(com.sun.facelets.FaceletContext,
javax.faces.component.UIComponent)
- */
- public void apply(FaceletContext ctx, UIComponent parent)
- throws IOException, FacesException, FaceletException, ELException {
- UIComponent c;
- // our id
-// String id = ctx.generateUniqueId(this.tagId);
- UIFacet facet = new UIFacet();
- // Find facet for support component
- String facetName = AjaxSupportTag.AJAX_SUPPORT_FACET+_event.getValue();
- c = parent.getFacet(facetName);
- if (null != c) {
- parent.getFacets().remove(facetName);
- facet.getChildren().add(c);
- }
- this._ajaxSupportHandler.apply(ctx, facet);
- c = (UIComponent) facet.getChildren().get(0);
- parent.getFacets().put(facetName, c);
- // Fix for possible incompabilites in different frameworks.
-// c.setParentProperties(parent);
- }
-
-}
Copied:
branches/3.2.x/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/AjaxSupportHandler.java
(from rev 7566,
branches/3.2.x/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/AjaxSupportHandler.java)
===================================================================
---
branches/3.2.x/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/AjaxSupportHandler.java
(rev 0)
+++
branches/3.2.x/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/AjaxSupportHandler.java 2008-04-07
22:49:35 UTC (rev 7649)
@@ -0,0 +1,98 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf.taglib.html.facelets;
+
+import java.io.IOException;
+
+import javax.el.ELException;
+import javax.faces.FacesException;
+import javax.faces.component.UIComponent;
+import javax.faces.component.UIComponentBase;
+
+import org.ajax4jsf.taglib.html.jsp.AjaxSupportTag;
+import org.ajax4jsf.webapp.taglib.AjaxComponentHandler;
+
+import com.sun.facelets.FaceletContext;
+import com.sun.facelets.FaceletException;
+import com.sun.facelets.tag.TagAttribute;
+import com.sun.facelets.tag.TagHandler;
+import com.sun.facelets.tag.jsf.ComponentConfig;
+
+/**
+ * "proxy" class for creating UIAjaxSupport component as facet for it's
parent.
+ * @author shura (latest modification by $Author: alexsmirnov $)
+ * @version $Revision: 1.1.2.1 $ $Date: 2007/02/01 15:31:22 $
+ *
+ */
+public class AjaxSupportHandler extends TagHandler {
+ /**
+ * A UIComponent for capturing a child UIComponent, representative of the
+ * desired Facet
+ *
+ * @author Jacob Hookom
+ *
+ */
+ private final static class UIFacet extends UIComponentBase {
+ public String getFamily() {
+ return null;
+ }
+ }
+
+ /**
+ * Real tag handler for create component.
+ */
+ private TagHandler _ajaxSupportHandler;
+
+ private TagAttribute _event;
+ /**
+ * @param config
+ */
+ public AjaxSupportHandler(ComponentConfig config) {
+ super(config);
+ _event = getRequiredAttribute("event");
+ _ajaxSupportHandler = new AjaxComponentHandler(config);
+ }
+
+ /* (non-Javadoc)
+ * @see com.sun.facelets.FaceletHandler#apply(com.sun.facelets.FaceletContext,
javax.faces.component.UIComponent)
+ */
+ public void apply(FaceletContext ctx, UIComponent parent)
+ throws IOException, FacesException, FaceletException, ELException {
+ UIComponent c;
+ // our id
+// String id = ctx.generateUniqueId(this.tagId);
+ UIFacet facet = new UIFacet();
+ // Find facet for support component
+ String facetName = AjaxSupportTag.AJAX_SUPPORT_FACET+_event.getValue();
+ c = parent.getFacet(facetName);
+ if (null != c) {
+ parent.getFacets().remove(facetName);
+ facet.getChildren().add(c);
+ }
+ this._ajaxSupportHandler.apply(ctx, facet);
+ c = (UIComponent) facet.getChildren().get(0);
+ parent.getFacets().put(facetName, c);
+ // Fix for possible incompabilites in different frameworks.
+// c.setParentProperties(parent);
+ }
+
+}
Deleted:
branches/3.2.x/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/FacetHandler.java
===================================================================
---
branches/3.2.x/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/FacetHandler.java 2008-04-02
00:36:29 UTC (rev 7566)
+++
branches/3.2.x/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/FacetHandler.java 2008-04-07
22:49:35 UTC (rev 7649)
@@ -1,94 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.taglib.html.facelets;
-
-import java.io.IOException;
-
-import javax.el.ELException;
-import javax.faces.FacesException;
-import javax.faces.component.UIComponent;
-import javax.faces.component.UIComponentBase;
-
-import org.ajax4jsf.Messages;
-
-import com.sun.facelets.FaceletContext;
-import com.sun.facelets.FaceletException;
-import com.sun.facelets.tag.TagAttribute;
-import com.sun.facelets.tag.TagConfig;
-import com.sun.facelets.tag.TagException;
-import com.sun.facelets.tag.TagHandler;
-
-/**
- * Register a named facet on the UIComponent associated with the closest parent
- * UIComponent custom action. <p/> See <a target="_new"
- *
href="http://java.sun.com/j2ee/javaserverfaces/1.1_01/docs/tlddocs/f...
- * documentation</a>.
- *
- * @author Jacob Hookom
- * @version $Id: FacetHandler.java,v 1.1.2.1 2007/02/01 15:31:21 alexsmirnov Exp $
- */
-public final class FacetHandler extends TagHandler {
-
- /**
- * A UIComponent for capturing a child UIComponent, representative of the
- * desired Facet
- *
- * @author Jacob Hookom
- *
- */
- private final static class UIFacet extends UIComponentBase {
- public String getFamily() {
- return null;
- }
- }
-
- protected final TagAttribute name;
-
- public FacetHandler(TagConfig config) {
- super(config);
- this.name = this.getRequiredAttribute("name");
- }
-
- /* (non-Javadoc)
- * @see com.sun.facelets.FaceletHandler#apply(com.sun.facelets.FaceletContext,
javax.faces.component.UIComponent)
- */
- public void apply(FaceletContext ctx, UIComponent parent)
- throws IOException, FacesException, FaceletException, ELException {
- UIFacet facet = new UIFacet();
- UIComponent c;
- // Check for existing facet
- String facetName = this.name.getValue(ctx);
- c = parent.getFacet(facetName);
- if (null != c) {
- parent.getFacets().remove(facetName);
- facet.getChildren().add(c);
- }
- this.nextHandler.apply(ctx, facet);
- int childCount = facet.getChildCount();
- if (childCount == 1) {
- c = (UIComponent) facet.getChildren().get(0);
- parent.getFacets().put(facetName, c);
- } else {
- throw new TagException(this.tag,
Messages.getMessage(Messages.FACET_TAG_MANY_CHILDREN_ERROR));
- }
- }
-}
Copied:
branches/3.2.x/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/FacetHandler.java
(from rev 7566,
branches/3.2.x/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/FacetHandler.java)
===================================================================
---
branches/3.2.x/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/FacetHandler.java
(rev 0)
+++
branches/3.2.x/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/FacetHandler.java 2008-04-07
22:49:35 UTC (rev 7649)
@@ -0,0 +1,94 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf.taglib.html.facelets;
+
+import java.io.IOException;
+
+import javax.el.ELException;
+import javax.faces.FacesException;
+import javax.faces.component.UIComponent;
+import javax.faces.component.UIComponentBase;
+
+import org.ajax4jsf.Messages;
+
+import com.sun.facelets.FaceletContext;
+import com.sun.facelets.FaceletException;
+import com.sun.facelets.tag.TagAttribute;
+import com.sun.facelets.tag.TagConfig;
+import com.sun.facelets.tag.TagException;
+import com.sun.facelets.tag.TagHandler;
+
+/**
+ * Register a named facet on the UIComponent associated with the closest parent
+ * UIComponent custom action. <p/> See <a target="_new"
+ *
href="http://java.sun.com/j2ee/javaserverfaces/1.1_01/docs/tlddocs/f...
+ * documentation</a>.
+ *
+ * @author Jacob Hookom
+ * @version $Id: FacetHandler.java,v 1.1.2.1 2007/02/01 15:31:21 alexsmirnov Exp $
+ */
+public final class FacetHandler extends TagHandler {
+
+ /**
+ * A UIComponent for capturing a child UIComponent, representative of the
+ * desired Facet
+ *
+ * @author Jacob Hookom
+ *
+ */
+ private final static class UIFacet extends UIComponentBase {
+ public String getFamily() {
+ return null;
+ }
+ }
+
+ protected final TagAttribute name;
+
+ public FacetHandler(TagConfig config) {
+ super(config);
+ this.name = this.getRequiredAttribute("name");
+ }
+
+ /* (non-Javadoc)
+ * @see com.sun.facelets.FaceletHandler#apply(com.sun.facelets.FaceletContext,
javax.faces.component.UIComponent)
+ */
+ public void apply(FaceletContext ctx, UIComponent parent)
+ throws IOException, FacesException, FaceletException, ELException {
+ UIFacet facet = new UIFacet();
+ UIComponent c;
+ // Check for existing facet
+ String facetName = this.name.getValue(ctx);
+ c = parent.getFacet(facetName);
+ if (null != c) {
+ parent.getFacets().remove(facetName);
+ facet.getChildren().add(c);
+ }
+ this.nextHandler.apply(ctx, facet);
+ int childCount = facet.getChildCount();
+ if (childCount == 1) {
+ c = (UIComponent) facet.getChildren().get(0);
+ parent.getFacets().put(facetName, c);
+ } else {
+ throw new TagException(this.tag,
Messages.getMessage(Messages.FACET_TAG_MANY_CHILDREN_ERROR));
+ }
+ }
+}
Deleted:
branches/3.2.x/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/IncludeFaceletContext.java
===================================================================
---
branches/3.2.x/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/IncludeFaceletContext.java 2008-04-02
00:36:29 UTC (rev 7566)
+++
branches/3.2.x/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/IncludeFaceletContext.java 2008-04-07
22:49:35 UTC (rev 7649)
@@ -1,274 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.taglib.html.facelets;
-
-import java.io.IOException;
-import java.net.URL;
-import java.util.HashMap;
-import java.util.Locale;
-import java.util.Map;
-
-import javax.el.ELException;
-import javax.el.ELResolver;
-import javax.el.ExpressionFactory;
-import javax.el.FunctionMapper;
-import javax.el.VariableMapper;
-import javax.faces.FacesException;
-import javax.faces.component.UIComponent;
-import javax.faces.context.FacesContext;
-
-import com.sun.facelets.FaceletContext;
-import com.sun.facelets.FaceletException;
-import com.sun.facelets.TemplateClient;
-
-/**
- * @author shura
- *
- */
-public class IncludeFaceletContext extends FaceletContext {
-
- private FaceletContext defaultContext;
-
- private Map ids;
-
- /**
- * @param defaultContext
- */
- public IncludeFaceletContext(FaceletContext defaultContext) {
- this.defaultContext = defaultContext;
- this.ids = new HashMap();
- }
-
- /**
- * @param client
- * @see com.sun.facelets.FaceletContext#extendClient(com.sun.facelets.TemplateClient)
- */
- public void extendClient(TemplateClient client) {
- this.defaultContext.extendClient(client);
- }
-
- /**
- * @param base
- * @return
- * @see com.sun.facelets.FaceletContext#generateUniqueId(java.lang.String)
- */
- public String generateUniqueId(String base) {
- Integer cnt = (Integer) this.ids.get(base);
- if (cnt == null) {
- this.ids.put(base, new Integer(0));
- return base;
- } else {
- int i = cnt.intValue() + 1;
- this.ids.put(base, new Integer(i));
- return base + "_" + i;
- }
- }
-
- /**
- * @param name
- * @return
- * @see com.sun.facelets.FaceletContext#getAttribute(java.lang.String)
- */
- public Object getAttribute(String name) {
- return this.defaultContext.getAttribute(name);
- }
-
- /**
- * @param key
- * @return
- * @see javax.el.ELContext#getContext(java.lang.Class)
- */
- public Object getContext(Class key) {
- return this.defaultContext.getContext(key);
- }
-
- /**
- * @return
- * @see javax.el.ELContext#getELResolver()
- */
- public ELResolver getELResolver() {
- return this.defaultContext.getELResolver();
- }
-
- /**
- * @return
- * @see com.sun.facelets.FaceletContext#getExpressionFactory()
- */
- public ExpressionFactory getExpressionFactory() {
- return this.defaultContext.getExpressionFactory();
- }
-
- /**
- * @return
- * @see com.sun.facelets.FaceletContext#getFacesContext()
- */
- public FacesContext getFacesContext() {
- return this.defaultContext.getFacesContext();
- }
-
- /**
- * @return
- * @see javax.el.ELContext#getFunctionMapper()
- */
- public FunctionMapper getFunctionMapper() {
- return this.defaultContext.getFunctionMapper();
- }
-
- /**
- * @return
- * @see javax.el.ELContext#getLocale()
- */
- public Locale getLocale() {
- return this.defaultContext.getLocale();
- }
-
- /**
- * @return
- * @see javax.el.ELContext#getVariableMapper()
- */
- public VariableMapper getVariableMapper() {
- return this.defaultContext.getVariableMapper();
- }
-
- /**
- * @return
- * @see java.lang.Object#hashCode()
- */
- public int hashCode() {
- return this.defaultContext.hashCode();
- }
-
- /**
- * @param parent
- * @param name
- * @return
- * @throws IOException
- * @throws FaceletException
- * @throws FacesException
- * @throws ELException
- * @see
com.sun.facelets.FaceletContext#includeDefinition(javax.faces.component.UIComponent,
java.lang.String)
- */
- public boolean includeDefinition(UIComponent parent, String name) throws IOException,
FaceletException, FacesException, ELException {
- return this.defaultContext.includeDefinition(parent, name);
- }
-
- /**
- * @param parent
- * @param relativePath
- * @throws IOException
- * @throws FaceletException
- * @throws FacesException
- * @throws ELException
- * @see
com.sun.facelets.FaceletContext#includeFacelet(javax.faces.component.UIComponent,
java.lang.String)
- */
- public void includeFacelet(UIComponent parent, String relativePath) throws IOException,
FaceletException, FacesException, ELException {
- this.defaultContext.includeFacelet(parent, relativePath);
- }
-
- /**
- * @param parent
- * @param absolutePath
- * @throws IOException
- * @throws FaceletException
- * @throws FacesException
- * @throws ELException
- * @see
com.sun.facelets.FaceletContext#includeFacelet(javax.faces.component.UIComponent,
java.net.URL)
- */
- public void includeFacelet(UIComponent parent, URL absolutePath) throws IOException,
FaceletException, FacesException, ELException {
- this.defaultContext.includeFacelet(parent, absolutePath);
- }
-
- /**
- * @return
- * @see javax.el.ELContext#isPropertyResolved()
- */
- public boolean isPropertyResolved() {
- return this.defaultContext.isPropertyResolved();
- }
-
- /**
- * @param client
- * @see com.sun.facelets.FaceletContext#popClient(com.sun.facelets.TemplateClient)
- */
- public void popClient(TemplateClient client) {
- this.defaultContext.popClient(client);
- }
-
- /**
- * @param client
- * @see com.sun.facelets.FaceletContext#pushClient(com.sun.facelets.TemplateClient)
- */
- public void pushClient(TemplateClient client) {
- this.defaultContext.pushClient(client);
- }
-
- /**
- * @param key
- * @param contextObject
- * @see javax.el.ELContext#putContext(java.lang.Class, java.lang.Object)
- */
- public void putContext(Class key, Object contextObject) {
- this.defaultContext.putContext(key, contextObject);
- }
-
- /**
- * @param name
- * @param value
- * @see com.sun.facelets.FaceletContext#setAttribute(java.lang.String,
java.lang.Object)
- */
- public void setAttribute(String name, Object value) {
- this.defaultContext.setAttribute(name, value);
- }
-
- /**
- * @param fnMapper
- * @see com.sun.facelets.FaceletContext#setFunctionMapper(javax.el.FunctionMapper)
- */
- public void setFunctionMapper(FunctionMapper fnMapper) {
- this.defaultContext.setFunctionMapper(fnMapper);
- }
-
- /**
- * @param locale
- * @see javax.el.ELContext#setLocale(java.util.Locale)
- */
- public void setLocale(Locale locale) {
- this.defaultContext.setLocale(locale);
- }
-
- /**
- * @param resolved
- * @see javax.el.ELContext#setPropertyResolved(boolean)
- */
- public void setPropertyResolved(boolean resolved) {
- this.defaultContext.setPropertyResolved(resolved);
- }
-
- /**
- * @param varMapper
- * @see com.sun.facelets.FaceletContext#setVariableMapper(javax.el.VariableMapper)
- */
- public void setVariableMapper(VariableMapper varMapper) {
- this.defaultContext.setVariableMapper(varMapper);
- }
-
-}
Copied:
branches/3.2.x/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/IncludeFaceletContext.java
(from rev 7566,
branches/3.2.x/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/IncludeFaceletContext.java)
===================================================================
---
branches/3.2.x/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/IncludeFaceletContext.java
(rev 0)
+++
branches/3.2.x/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/IncludeFaceletContext.java 2008-04-07
22:49:35 UTC (rev 7649)
@@ -0,0 +1,274 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf.taglib.html.facelets;
+
+import java.io.IOException;
+import java.net.URL;
+import java.util.HashMap;
+import java.util.Locale;
+import java.util.Map;
+
+import javax.el.ELException;
+import javax.el.ELResolver;
+import javax.el.ExpressionFactory;
+import javax.el.FunctionMapper;
+import javax.el.VariableMapper;
+import javax.faces.FacesException;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+
+import com.sun.facelets.FaceletContext;
+import com.sun.facelets.FaceletException;
+import com.sun.facelets.TemplateClient;
+
+/**
+ * @author shura
+ *
+ */
+public class IncludeFaceletContext extends FaceletContext {
+
+ private FaceletContext defaultContext;
+
+ private Map ids;
+
+ /**
+ * @param defaultContext
+ */
+ public IncludeFaceletContext(FaceletContext defaultContext) {
+ this.defaultContext = defaultContext;
+ this.ids = new HashMap();
+ }
+
+ /**
+ * @param client
+ * @see com.sun.facelets.FaceletContext#extendClient(com.sun.facelets.TemplateClient)
+ */
+ public void extendClient(TemplateClient client) {
+ this.defaultContext.extendClient(client);
+ }
+
+ /**
+ * @param base
+ * @return
+ * @see com.sun.facelets.FaceletContext#generateUniqueId(java.lang.String)
+ */
+ public String generateUniqueId(String base) {
+ Integer cnt = (Integer) this.ids.get(base);
+ if (cnt == null) {
+ this.ids.put(base, new Integer(0));
+ return base;
+ } else {
+ int i = cnt.intValue() + 1;
+ this.ids.put(base, new Integer(i));
+ return base + "_" + i;
+ }
+ }
+
+ /**
+ * @param name
+ * @return
+ * @see com.sun.facelets.FaceletContext#getAttribute(java.lang.String)
+ */
+ public Object getAttribute(String name) {
+ return this.defaultContext.getAttribute(name);
+ }
+
+ /**
+ * @param key
+ * @return
+ * @see javax.el.ELContext#getContext(java.lang.Class)
+ */
+ public Object getContext(Class key) {
+ return this.defaultContext.getContext(key);
+ }
+
+ /**
+ * @return
+ * @see javax.el.ELContext#getELResolver()
+ */
+ public ELResolver getELResolver() {
+ return this.defaultContext.getELResolver();
+ }
+
+ /**
+ * @return
+ * @see com.sun.facelets.FaceletContext#getExpressionFactory()
+ */
+ public ExpressionFactory getExpressionFactory() {
+ return this.defaultContext.getExpressionFactory();
+ }
+
+ /**
+ * @return
+ * @see com.sun.facelets.FaceletContext#getFacesContext()
+ */
+ public FacesContext getFacesContext() {
+ return this.defaultContext.getFacesContext();
+ }
+
+ /**
+ * @return
+ * @see javax.el.ELContext#getFunctionMapper()
+ */
+ public FunctionMapper getFunctionMapper() {
+ return this.defaultContext.getFunctionMapper();
+ }
+
+ /**
+ * @return
+ * @see javax.el.ELContext#getLocale()
+ */
+ public Locale getLocale() {
+ return this.defaultContext.getLocale();
+ }
+
+ /**
+ * @return
+ * @see javax.el.ELContext#getVariableMapper()
+ */
+ public VariableMapper getVariableMapper() {
+ return this.defaultContext.getVariableMapper();
+ }
+
+ /**
+ * @return
+ * @see java.lang.Object#hashCode()
+ */
+ public int hashCode() {
+ return this.defaultContext.hashCode();
+ }
+
+ /**
+ * @param parent
+ * @param name
+ * @return
+ * @throws IOException
+ * @throws FaceletException
+ * @throws FacesException
+ * @throws ELException
+ * @see
com.sun.facelets.FaceletContext#includeDefinition(javax.faces.component.UIComponent,
java.lang.String)
+ */
+ public boolean includeDefinition(UIComponent parent, String name) throws IOException,
FaceletException, FacesException, ELException {
+ return this.defaultContext.includeDefinition(parent, name);
+ }
+
+ /**
+ * @param parent
+ * @param relativePath
+ * @throws IOException
+ * @throws FaceletException
+ * @throws FacesException
+ * @throws ELException
+ * @see
com.sun.facelets.FaceletContext#includeFacelet(javax.faces.component.UIComponent,
java.lang.String)
+ */
+ public void includeFacelet(UIComponent parent, String relativePath) throws IOException,
FaceletException, FacesException, ELException {
+ this.defaultContext.includeFacelet(parent, relativePath);
+ }
+
+ /**
+ * @param parent
+ * @param absolutePath
+ * @throws IOException
+ * @throws FaceletException
+ * @throws FacesException
+ * @throws ELException
+ * @see
com.sun.facelets.FaceletContext#includeFacelet(javax.faces.component.UIComponent,
java.net.URL)
+ */
+ public void includeFacelet(UIComponent parent, URL absolutePath) throws IOException,
FaceletException, FacesException, ELException {
+ this.defaultContext.includeFacelet(parent, absolutePath);
+ }
+
+ /**
+ * @return
+ * @see javax.el.ELContext#isPropertyResolved()
+ */
+ public boolean isPropertyResolved() {
+ return this.defaultContext.isPropertyResolved();
+ }
+
+ /**
+ * @param client
+ * @see com.sun.facelets.FaceletContext#popClient(com.sun.facelets.TemplateClient)
+ */
+ public void popClient(TemplateClient client) {
+ this.defaultContext.popClient(client);
+ }
+
+ /**
+ * @param client
+ * @see com.sun.facelets.FaceletContext#pushClient(com.sun.facelets.TemplateClient)
+ */
+ public void pushClient(TemplateClient client) {
+ this.defaultContext.pushClient(client);
+ }
+
+ /**
+ * @param key
+ * @param contextObject
+ * @see javax.el.ELContext#putContext(java.lang.Class, java.lang.Object)
+ */
+ public void putContext(Class key, Object contextObject) {
+ this.defaultContext.putContext(key, contextObject);
+ }
+
+ /**
+ * @param name
+ * @param value
+ * @see com.sun.facelets.FaceletContext#setAttribute(java.lang.String,
java.lang.Object)
+ */
+ public void setAttribute(String name, Object value) {
+ this.defaultContext.setAttribute(name, value);
+ }
+
+ /**
+ * @param fnMapper
+ * @see com.sun.facelets.FaceletContext#setFunctionMapper(javax.el.FunctionMapper)
+ */
+ public void setFunctionMapper(FunctionMapper fnMapper) {
+ this.defaultContext.setFunctionMapper(fnMapper);
+ }
+
+ /**
+ * @param locale
+ * @see javax.el.ELContext#setLocale(java.util.Locale)
+ */
+ public void setLocale(Locale locale) {
+ this.defaultContext.setLocale(locale);
+ }
+
+ /**
+ * @param resolved
+ * @see javax.el.ELContext#setPropertyResolved(boolean)
+ */
+ public void setPropertyResolved(boolean resolved) {
+ this.defaultContext.setPropertyResolved(resolved);
+ }
+
+ /**
+ * @param varMapper
+ * @see com.sun.facelets.FaceletContext#setVariableMapper(javax.el.VariableMapper)
+ */
+ public void setVariableMapper(VariableMapper varMapper) {
+ this.defaultContext.setVariableMapper(varMapper);
+ }
+
+}
Deleted:
branches/3.2.x/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/IncludeHandler.java
===================================================================
---
branches/3.2.x/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/IncludeHandler.java 2008-04-02
00:36:29 UTC (rev 7566)
+++
branches/3.2.x/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/IncludeHandler.java 2008-04-07
22:49:35 UTC (rev 7649)
@@ -1,91 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.taglib.html.facelets;
-
-import java.io.IOException;
-
-import javax.el.ELException;
-import javax.el.VariableMapper;
-import javax.faces.FacesException;
-import javax.faces.component.UIComponent;
-
-import org.ajax4jsf.component.UIInclude;
-
-import com.sun.facelets.FaceletContext;
-import com.sun.facelets.el.VariableMapperWrapper;
-import com.sun.facelets.tag.TagAttribute;
-import com.sun.facelets.tag.jsf.ComponentConfig;
-import com.sun.facelets.tag.jsf.ComponentHandler;
-
-/**
- * @author shura
- *
- */
-public class IncludeHandler extends ComponentHandler {
-
- private TagAttribute viewId;
-
- public IncludeHandler(ComponentConfig config) {
- super(config);
- this.viewId = getRequiredAttribute("viewId");
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
com.sun.facelets.tag.jsf.ComponentHandler#onComponentCreated(com.sun.facelets.FaceletContext,
- * javax.faces.component.UIComponent,
- * javax.faces.component.UIComponent)
- */
- protected void onComponentCreated(FaceletContext ctx, UIComponent c,
- UIComponent parent) {
- // TODO Auto-generated method stub
- super.onComponentCreated(ctx, c, parent);
- }
-
- protected void applyNextHandler(FaceletContext ctx, UIComponent component)
- throws IOException, FacesException, ELException {
- String path;
- if (component instanceof UIInclude) {
- UIInclude include = (UIInclude) component;
- path = include.getViewId();
- if(include.isWasNavigation()){
- component.getChildren().clear();
- }
- } else {
- path = (String) component.getAttributes().get("viewId");
- }
- VariableMapper orig = ctx.getVariableMapper();
- ctx.setVariableMapper(new VariableMapperWrapper(orig));
- try {
- this.nextHandler.apply(ctx, component);
- ctx.includeFacelet(component, path);
- } catch (Exception e) {
- throw new FacesException("UIInclude component "
- + component.getClientId(ctx.getFacesContext())
- + " could't include page with path " + path, e);
- } finally {
- ctx.setVariableMapper(orig);
- }
- }
-
-}
Copied:
branches/3.2.x/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/IncludeHandler.java
(from rev 7566,
branches/3.2.x/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/IncludeHandler.java)
===================================================================
---
branches/3.2.x/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/IncludeHandler.java
(rev 0)
+++
branches/3.2.x/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/IncludeHandler.java 2008-04-07
22:49:35 UTC (rev 7649)
@@ -0,0 +1,91 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf.taglib.html.facelets;
+
+import java.io.IOException;
+
+import javax.el.ELException;
+import javax.el.VariableMapper;
+import javax.faces.FacesException;
+import javax.faces.component.UIComponent;
+
+import org.ajax4jsf.component.UIInclude;
+
+import com.sun.facelets.FaceletContext;
+import com.sun.facelets.el.VariableMapperWrapper;
+import com.sun.facelets.tag.TagAttribute;
+import com.sun.facelets.tag.jsf.ComponentConfig;
+import com.sun.facelets.tag.jsf.ComponentHandler;
+
+/**
+ * @author shura
+ *
+ */
+public class IncludeHandler extends ComponentHandler {
+
+ private TagAttribute viewId;
+
+ public IncludeHandler(ComponentConfig config) {
+ super(config);
+ this.viewId = getRequiredAttribute("viewId");
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
com.sun.facelets.tag.jsf.ComponentHandler#onComponentCreated(com.sun.facelets.FaceletContext,
+ * javax.faces.component.UIComponent,
+ * javax.faces.component.UIComponent)
+ */
+ protected void onComponentCreated(FaceletContext ctx, UIComponent c,
+ UIComponent parent) {
+ // TODO Auto-generated method stub
+ super.onComponentCreated(ctx, c, parent);
+ }
+
+ protected void applyNextHandler(FaceletContext ctx, UIComponent component)
+ throws IOException, FacesException, ELException {
+ String path;
+ if (component instanceof UIInclude) {
+ UIInclude include = (UIInclude) component;
+ path = include.getViewId();
+ if(include.isWasNavigation()){
+ component.getChildren().clear();
+ }
+ } else {
+ path = (String) component.getAttributes().get("viewId");
+ }
+ VariableMapper orig = ctx.getVariableMapper();
+ ctx.setVariableMapper(new VariableMapperWrapper(orig));
+ try {
+ this.nextHandler.apply(ctx, component);
+ ctx.includeFacelet(component, path);
+ } catch (Exception e) {
+ throw new FacesException("UIInclude component "
+ + component.getClientId(ctx.getFacesContext())
+ + " could't include page with path " + path, e);
+ } finally {
+ ctx.setVariableMapper(orig);
+ }
+ }
+
+}
Deleted:
branches/3.2.x/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/KeepAliveHandler.java
===================================================================
---
branches/3.2.x/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/KeepAliveHandler.java 2008-04-02
00:36:29 UTC (rev 7566)
+++
branches/3.2.x/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/KeepAliveHandler.java 2008-04-07
22:49:35 UTC (rev 7649)
@@ -1,82 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.taglib.html.facelets;
-
-import java.io.IOException;
-
-import javax.el.ELException;
-import javax.faces.FacesException;
-import javax.faces.component.UIComponent;
-import javax.faces.context.FacesContext;
-import javax.faces.el.ValueBinding;
-
-import org.ajax4jsf.Messages;
-import org.ajax4jsf.event.AjaxPhaseListener;
-
-import com.sun.facelets.FaceletContext;
-import com.sun.facelets.FaceletException;
-import com.sun.facelets.tag.TagAttribute;
-import com.sun.facelets.tag.TagAttributeException;
-import com.sun.facelets.tag.TagConfig;
-import com.sun.facelets.tag.TagHandler;
-
-/**
- * @author shura
- *
- */
-public class KeepAliveHandler extends TagHandler {
-
- private final TagAttribute beanName;
-
- private final TagAttribute ajaxOnly;
- /**
- * @param config
- */
- public KeepAliveHandler(TagConfig config) {
- super(config);
- this.beanName = this.getRequiredAttribute("beanName");
- if (beanName != null) {
- if (!beanName.isLiteral()) {
- throw new TagAttributeException(this.tag, this.beanName,
Messages.getMessage(Messages.MUST_BE_LITERAL_ERROR));
- }
- }
- this.ajaxOnly = getAttribute("ajaxOnly");
- }
-
- /* (non-Javadoc)
- * @see com.sun.facelets.FaceletHandler#apply(com.sun.facelets.FaceletContext,
javax.faces.component.UIComponent)
- */
- public void apply(FaceletContext ctx, UIComponent parent)
- throws IOException, FacesException, FaceletException, ELException {
- // Get bean instance from EL expression.
- String name = beanName.getValue();
- boolean isAjaxOnly = ajaxOnly!=null?ajaxOnly.getBoolean(ctx):false;
- FacesContext facesContext = ctx.getFacesContext();
- String beanExpression = "#{"+name+"}";
- ValueBinding valueBinding =
facesContext.getApplication().createValueBinding(beanExpression);
- Object bean = valueBinding.getValue(facesContext);
- String beanAttributeName =
isAjaxOnly?AjaxPhaseListener.AJAX_BEAN_PREFIX:AjaxPhaseListener.VIEW_BEAN_PREFIX+name;
- // Put bean instance to ViewRoot.
- facesContext.getViewRoot().getAttributes().put(beanAttributeName, bean);
- }
-
-}
Copied:
branches/3.2.x/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/KeepAliveHandler.java
(from rev 7566,
branches/3.2.x/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/KeepAliveHandler.java)
===================================================================
---
branches/3.2.x/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/KeepAliveHandler.java
(rev 0)
+++
branches/3.2.x/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/KeepAliveHandler.java 2008-04-07
22:49:35 UTC (rev 7649)
@@ -0,0 +1,82 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf.taglib.html.facelets;
+
+import java.io.IOException;
+
+import javax.el.ELException;
+import javax.faces.FacesException;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.el.ValueBinding;
+
+import org.ajax4jsf.Messages;
+import org.ajax4jsf.event.AjaxPhaseListener;
+
+import com.sun.facelets.FaceletContext;
+import com.sun.facelets.FaceletException;
+import com.sun.facelets.tag.TagAttribute;
+import com.sun.facelets.tag.TagAttributeException;
+import com.sun.facelets.tag.TagConfig;
+import com.sun.facelets.tag.TagHandler;
+
+/**
+ * @author shura
+ *
+ */
+public class KeepAliveHandler extends TagHandler {
+
+ private final TagAttribute beanName;
+
+ private final TagAttribute ajaxOnly;
+ /**
+ * @param config
+ */
+ public KeepAliveHandler(TagConfig config) {
+ super(config);
+ this.beanName = this.getRequiredAttribute("beanName");
+ if (beanName != null) {
+ if (!beanName.isLiteral()) {
+ throw new TagAttributeException(this.tag, this.beanName,
Messages.getMessage(Messages.MUST_BE_LITERAL_ERROR));
+ }
+ }
+ this.ajaxOnly = getAttribute("ajaxOnly");
+ }
+
+ /* (non-Javadoc)
+ * @see com.sun.facelets.FaceletHandler#apply(com.sun.facelets.FaceletContext,
javax.faces.component.UIComponent)
+ */
+ public void apply(FaceletContext ctx, UIComponent parent)
+ throws IOException, FacesException, FaceletException, ELException {
+ // Get bean instance from EL expression.
+ String name = beanName.getValue();
+ boolean isAjaxOnly = ajaxOnly!=null?ajaxOnly.getBoolean(ctx):false;
+ FacesContext facesContext = ctx.getFacesContext();
+ String beanExpression = "#{"+name+"}";
+ ValueBinding valueBinding =
facesContext.getApplication().createValueBinding(beanExpression);
+ Object bean = valueBinding.getValue(facesContext);
+ String beanAttributeName =
isAjaxOnly?AjaxPhaseListener.AJAX_BEAN_PREFIX:AjaxPhaseListener.VIEW_BEAN_PREFIX+name;
+ // Put bean instance to ViewRoot.
+ facesContext.getViewRoot().getAttributes().put(beanAttributeName, bean);
+ }
+
+}
Deleted:
branches/3.2.x/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/MediaOutputHandler.java
===================================================================
---
branches/3.2.x/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/MediaOutputHandler.java 2008-04-02
00:36:29 UTC (rev 7566)
+++
branches/3.2.x/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/MediaOutputHandler.java 2008-04-07
22:49:35 UTC (rev 7649)
@@ -1,118 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.taglib.html.facelets;
-
-import java.io.OutputStream;
-
-import org.ajax4jsf.component.UIMediaOutput;
-
-import com.sun.facelets.FaceletContext;
-import com.sun.facelets.tag.MetaRule;
-import com.sun.facelets.tag.MetaRuleset;
-import com.sun.facelets.tag.Metadata;
-import com.sun.facelets.tag.MetadataTarget;
-import com.sun.facelets.tag.TagAttribute;
-import com.sun.facelets.tag.jsf.ComponentConfig;
-import com.sun.facelets.tag.jsf.ComponentHandler;
-
-/**
- * @author shura (latest modification by $Author: alexsmirnov $)
- * @version $Revision: 1.1.2.1 $ $Date: 2007/02/01 15:31:22 $
- *
- */
-public class MediaOutputHandler extends ComponentHandler {
-
- private static final MetaRule mmediaMetaRule = new MMediaMetaRule();
- /**
- * @param config
- */
- public MediaOutputHandler(ComponentConfig config) {
- super(config);
-
- }
-
- /* (non-Javadoc)
- * @see org.ajax4jsf.tag.AjaxComponentHandler#createMetaRuleset(java.lang.Class)
- */
- protected MetaRuleset createMetaRuleset(Class type) {
- MetaRuleset metaRules = super.createMetaRuleset(type);
- metaRules.addRule(mmediaMetaRule);
- return metaRules;
- }
-
- /**
- * @author shura (latest modification by $Author: alexsmirnov $)
- * @version $Revision: 1.1.2.1 $ $Date: 2007/02/01 15:31:22 $
- *
- */
- static class MMediaMetaRule extends MetaRule{
-
- /**
- *
- */
- public MMediaMetaRule() {
- 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(UIMediaOutput.class)) {
-
-
- if ("createContent".equals(name)) {
- return new MMediaActionMapper(attribute);
- }
- }
- return null;
- }
-
- }
- /**
- * @author shura (latest modification by $Author: alexsmirnov $)
- * @version $Revision: 1.1.2.1 $ $Date: 2007/02/01 15:31:22 $
- *
- */
- static class MMediaActionMapper extends Metadata {
-
- private static final Class<?>[] MMEDIA_ACTION_SIG = new Class[]
{OutputStream.class,Object.class};
-
- private final TagAttribute _send;
- /**
- * @param attribute
- */
- public MMediaActionMapper(TagAttribute attribute) {
- _send = attribute;
- }
-
- /* (non-Javadoc)
- * @see com.sun.facelets.tag.Metadata#applyMetadata(com.sun.facelets.FaceletContext,
java.lang.Object)
- */
- public void applyMetadata(FaceletContext ctx, Object instance) {
- ((UIMediaOutput)
instance).setCreateContentExpression(this._send.getMethodExpression(ctx, null,
- MMEDIA_ACTION_SIG));
- }
-
- }
-
-}
Copied:
branches/3.2.x/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/MediaOutputHandler.java
(from rev 7566,
branches/3.2.x/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/MediaOutputHandler.java)
===================================================================
---
branches/3.2.x/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/MediaOutputHandler.java
(rev 0)
+++
branches/3.2.x/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/MediaOutputHandler.java 2008-04-07
22:49:35 UTC (rev 7649)
@@ -0,0 +1,118 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf.taglib.html.facelets;
+
+import java.io.OutputStream;
+
+import org.ajax4jsf.component.UIMediaOutput;
+
+import com.sun.facelets.FaceletContext;
+import com.sun.facelets.tag.MetaRule;
+import com.sun.facelets.tag.MetaRuleset;
+import com.sun.facelets.tag.Metadata;
+import com.sun.facelets.tag.MetadataTarget;
+import com.sun.facelets.tag.TagAttribute;
+import com.sun.facelets.tag.jsf.ComponentConfig;
+import com.sun.facelets.tag.jsf.ComponentHandler;
+
+/**
+ * @author shura (latest modification by $Author: alexsmirnov $)
+ * @version $Revision: 1.1.2.1 $ $Date: 2007/02/01 15:31:22 $
+ *
+ */
+public class MediaOutputHandler extends ComponentHandler {
+
+ private static final MetaRule mmediaMetaRule = new MMediaMetaRule();
+ /**
+ * @param config
+ */
+ public MediaOutputHandler(ComponentConfig config) {
+ super(config);
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.ajax4jsf.tag.AjaxComponentHandler#createMetaRuleset(java.lang.Class)
+ */
+ protected MetaRuleset createMetaRuleset(Class type) {
+ MetaRuleset metaRules = super.createMetaRuleset(type);
+ metaRules.addRule(mmediaMetaRule);
+ return metaRules;
+ }
+
+ /**
+ * @author shura (latest modification by $Author: alexsmirnov $)
+ * @version $Revision: 1.1.2.1 $ $Date: 2007/02/01 15:31:22 $
+ *
+ */
+ static class MMediaMetaRule extends MetaRule{
+
+ /**
+ *
+ */
+ public MMediaMetaRule() {
+ 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(UIMediaOutput.class)) {
+
+
+ if ("createContent".equals(name)) {
+ return new MMediaActionMapper(attribute);
+ }
+ }
+ return null;
+ }
+
+ }
+ /**
+ * @author shura (latest modification by $Author: alexsmirnov $)
+ * @version $Revision: 1.1.2.1 $ $Date: 2007/02/01 15:31:22 $
+ *
+ */
+ static class MMediaActionMapper extends Metadata {
+
+ private static final Class<?>[] MMEDIA_ACTION_SIG = new Class[]
{OutputStream.class,Object.class};
+
+ private final TagAttribute _send;
+ /**
+ * @param attribute
+ */
+ public MMediaActionMapper(TagAttribute attribute) {
+ _send = attribute;
+ }
+
+ /* (non-Javadoc)
+ * @see com.sun.facelets.tag.Metadata#applyMetadata(com.sun.facelets.FaceletContext,
java.lang.Object)
+ */
+ public void applyMetadata(FaceletContext ctx, Object instance) {
+ ((UIMediaOutput)
instance).setCreateContentExpression(this._send.getMethodExpression(ctx, null,
+ MMEDIA_ACTION_SIG));
+ }
+
+ }
+
+}
Deleted:
branches/3.2.x/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/RowKeyConverterRule.java
===================================================================
---
branches/3.2.x/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/RowKeyConverterRule.java 2008-04-02
00:36:29 UTC (rev 7566)
+++
branches/3.2.x/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/RowKeyConverterRule.java 2008-04-07
22:49:35 UTC (rev 7649)
@@ -1,85 +0,0 @@
-/**
- *
- */
-package org.ajax4jsf.taglib.html.facelets;
-
-import javax.faces.convert.Converter;
-
-import org.ajax4jsf.component.UIDataAdaptor;
-
-import com.sun.facelets.FaceletContext;
-import com.sun.facelets.tag.MetaRule;
-import com.sun.facelets.tag.Metadata;
-import com.sun.facelets.tag.MetadataTarget;
-import com.sun.facelets.tag.TagAttribute;
-
-/**
- * Apply rowKeyConverter to component
- * @author Maksim Kaszynski
- *
- */
-public class RowKeyConverterRule extends MetaRule {
-
- static final class DynamicConverterMetaData extends Metadata {
-
- private final TagAttribute attribute;
-
- public DynamicConverterMetaData(TagAttribute attribute) {
- super();
- this.attribute = attribute;
- }
-
- @Override
- public void applyMetadata(FaceletContext ctx, Object instance) {
- ((UIDataAdaptor) instance).setValueExpression("rowKeyConverter",
- attribute.getValueExpression(ctx, Converter.class));
-
- }
- }
-
- static final class StaticConverterMetadata extends Metadata {
-
- private final String converterId;
-
- public StaticConverterMetadata(String converterId) {
- super();
- this.converterId = converterId;
- }
-
- @Override
- public void applyMetadata(FaceletContext ctx, Object instance) {
- Converter converter = ctx.getFacesContext().getApplication()
- .createConverter(converterId);
- ((UIDataAdaptor) instance).setRowKeyConverter(converter);
-
- }
- }
-
- public static final RowKeyConverterRule INSTANCE = new RowKeyConverterRule();
-
-
- /*
- * (non-Javadoc)
- *
- * @see com.sun.facelets.tag.MetaRule#applyRule(java.lang.String,
- * com.sun.facelets.tag.TagAttribute,
- * com.sun.facelets.tag.MetadataTarget)
- */
- @Override
- public Metadata applyRule(String name, TagAttribute attribute,
- MetadataTarget meta) {
-
- if (meta.isTargetInstanceOf(UIDataAdaptor.class)) {
- if ("rowKeyConverter".equals(name)) {
- if (attribute.isLiteral()) {
- return new StaticConverterMetadata(attribute.getValue());
- } else {
- return new DynamicConverterMetaData(attribute);
- }
- }
- }
-
- return null;
- }
-
-}
Copied:
branches/3.2.x/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/RowKeyConverterRule.java
(from rev 7566,
branches/3.2.x/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/RowKeyConverterRule.java)
===================================================================
---
branches/3.2.x/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/RowKeyConverterRule.java
(rev 0)
+++
branches/3.2.x/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/RowKeyConverterRule.java 2008-04-07
22:49:35 UTC (rev 7649)
@@ -0,0 +1,85 @@
+/**
+ *
+ */
+package org.ajax4jsf.taglib.html.facelets;
+
+import javax.faces.convert.Converter;
+
+import org.ajax4jsf.component.UIDataAdaptor;
+
+import com.sun.facelets.FaceletContext;
+import com.sun.facelets.tag.MetaRule;
+import com.sun.facelets.tag.Metadata;
+import com.sun.facelets.tag.MetadataTarget;
+import com.sun.facelets.tag.TagAttribute;
+
+/**
+ * Apply rowKeyConverter to component
+ * @author Maksim Kaszynski
+ *
+ */
+public class RowKeyConverterRule extends MetaRule {
+
+ static final class DynamicConverterMetaData extends Metadata {
+
+ private final TagAttribute attribute;
+
+ public DynamicConverterMetaData(TagAttribute attribute) {
+ super();
+ this.attribute = attribute;
+ }
+
+ @Override
+ public void applyMetadata(FaceletContext ctx, Object instance) {
+ ((UIDataAdaptor) instance).setValueExpression("rowKeyConverter",
+ attribute.getValueExpression(ctx, Converter.class));
+
+ }
+ }
+
+ static final class StaticConverterMetadata extends Metadata {
+
+ private final String converterId;
+
+ public StaticConverterMetadata(String converterId) {
+ super();
+ this.converterId = converterId;
+ }
+
+ @Override
+ public void applyMetadata(FaceletContext ctx, Object instance) {
+ Converter converter = ctx.getFacesContext().getApplication()
+ .createConverter(converterId);
+ ((UIDataAdaptor) instance).setRowKeyConverter(converter);
+
+ }
+ }
+
+ public static final RowKeyConverterRule INSTANCE = new RowKeyConverterRule();
+
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.sun.facelets.tag.MetaRule#applyRule(java.lang.String,
+ * com.sun.facelets.tag.TagAttribute,
+ * com.sun.facelets.tag.MetadataTarget)
+ */
+ @Override
+ public Metadata applyRule(String name, TagAttribute attribute,
+ MetadataTarget meta) {
+
+ if (meta.isTargetInstanceOf(UIDataAdaptor.class)) {
+ if ("rowKeyConverter".equals(name)) {
+ if (attribute.isLiteral()) {
+ return new StaticConverterMetadata(attribute.getValue());
+ } else {
+ return new DynamicConverterMetaData(attribute);
+ }
+ }
+ }
+
+ return null;
+ }
+
+}
Deleted:
branches/3.2.x/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/package-info.java
===================================================================
---
branches/3.2.x/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/package-info.java 2008-04-02
00:36:29 UTC (rev 7566)
+++
branches/3.2.x/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/package-info.java 2008-04-07
22:49:35 UTC (rev 7649)
@@ -1,4 +0,0 @@
-/**
- * Classes defining the rendering model for HTML
- */
-package org.ajax4jsf.taglib.html.facelets;
Copied:
branches/3.2.x/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/package-info.java
(from rev 7566,
branches/3.2.x/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/package-info.java)
===================================================================
---
branches/3.2.x/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/package-info.java
(rev 0)
+++
branches/3.2.x/ui/core/src/main/java/org/ajax4jsf/taglib/html/facelets/package-info.java 2008-04-07
22:49:35 UTC (rev 7649)
@@ -0,0 +1,4 @@
+/**
+ * Classes defining the rendering model for HTML
+ */
+package org.ajax4jsf.taglib.html.facelets;