You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by bo...@apache.org on 2008/04/06 23:53:37 UTC
svn commit: r645313 [2/4] - in /myfaces/tobago/trunk: ./ core/
core/src/main/faces-config/
core/src/main/java/org/apache/myfaces/tobago/component/
core/src/main/java/org/apache/myfaces/tobago/taglib/component/
core/src/main/java/org/apache/myfaces/toba...
Added: myfaces/tobago/trunk/extension/tobago-taglib-extension/src/main/java/org/apache/myfaces/tobago/taglib/extension12/MenuCheckboxExtensionTag.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/extension/tobago-taglib-extension/src/main/java/org/apache/myfaces/tobago/taglib/extension12/MenuCheckboxExtensionTag.java?rev=645313&view=auto
==============================================================================
--- myfaces/tobago/trunk/extension/tobago-taglib-extension/src/main/java/org/apache/myfaces/tobago/taglib/extension12/MenuCheckboxExtensionTag.java (added)
+++ myfaces/tobago/trunk/extension/tobago-taglib-extension/src/main/java/org/apache/myfaces/tobago/taglib/extension12/MenuCheckboxExtensionTag.java Sun Apr 6 14:53:32 2008
@@ -0,0 +1,277 @@
+package org.apache.myfaces.tobago.taglib.extension12;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.apache.myfaces.tobago.apt.annotation.ExtensionTag;
+import org.apache.myfaces.tobago.apt.annotation.Tag;
+import org.apache.myfaces.tobago.apt.annotation.TagAttribute;
+import org.apache.myfaces.tobago.apt.annotation.UIComponentTagAttribute;
+import org.apache.myfaces.tobago.apt.annotation.DynamicExpression;
+import org.apache.myfaces.tobago.internal.taglib.SelectBooleanCheckboxTag;
+import org.apache.myfaces.tobago.internal.taglib.MenuItemTag;
+
+import javax.faces.webapp.FacetTag;
+import javax.servlet.jsp.JspException;
+import javax.servlet.jsp.tagext.BodyTagSupport;
+import javax.el.MethodExpression;
+
+/*
+ * Date: 09.05.2006
+ * Time: 00:00:49
+ */
+
+/**
+ * Renders a checkable menuitem.
+ */
+
+@Tag(name = "menuCheckbox", tagExtraInfoClassName = "org.apache.myfaces.tobago.taglib.component.CommandTagExtraInfo")
+@ExtensionTag(baseClassName = "org.apache.myfaces.tobago.taglib.component.MenuCheckboxTag")
+public class MenuCheckboxExtensionTag extends BodyTagSupport {
+ private javax.el.ValueExpression rendered;
+ private javax.el.ValueExpression value;
+
+ private MenuItemTag menuCommandTag;
+ private SelectBooleanCheckboxTag selectBooleanCheckbox;
+ private FacetTag facetTag;
+ private javax.el.MethodExpression action;
+ private javax.el.MethodExpression actionListener;
+ private javax.el.ValueExpression onclick;
+ private javax.el.ValueExpression link;
+ private javax.el.ValueExpression disabled;
+ private javax.el.ValueExpression binding;
+ private javax.el.ValueExpression label;
+ private javax.el.ValueExpression immediate;
+ private javax.el.ValueExpression transition;
+ private javax.el.ValueExpression renderedPartially;
+
+ @Override
+ public int doStartTag() throws JspException {
+
+ menuCommandTag = new MenuItemTag();
+ menuCommandTag.setPageContext(pageContext);
+ menuCommandTag.setParent(getParent()); // ???
+ if (rendered != null) {
+ menuCommandTag.setRendered(rendered);
+ }
+ if (action != null) {
+ menuCommandTag.setAction(action);
+ }
+ if (actionListener != null) {
+ menuCommandTag.setActionListener(actionListener);
+ }
+ if (onclick != null) {
+ menuCommandTag.setOnclick(onclick);
+ }
+ if (link != null) {
+ menuCommandTag.setLink(link);
+ }
+ if (disabled != null) {
+ menuCommandTag.setDisabled(disabled);
+ }
+ if (binding != null) {
+ menuCommandTag.setBinding(binding);
+ }
+ if (label != null) {
+ menuCommandTag.setLabel(label);
+ }
+ if (immediate != null) {
+ menuCommandTag.setImmediate(immediate);
+ }
+ if (transition != null) {
+ menuCommandTag.setTransition(transition);
+ }
+ if (renderedPartially != null) {
+ menuCommandTag.setRenderedPartially(renderedPartially);
+ }
+ menuCommandTag.doStartTag();
+
+ facetTag = new FacetTag();
+ facetTag.setPageContext(pageContext);
+ facetTag.setParent(menuCommandTag);
+ facetTag.setName(org.apache.myfaces.tobago.TobagoConstants.FACET_ITEMS);
+
+ facetTag.doStartTag();
+ selectBooleanCheckbox = new SelectBooleanCheckboxTag();
+ selectBooleanCheckbox.setPageContext(pageContext);
+ if (value != null) {
+ selectBooleanCheckbox.setValue(value);
+ }
+ selectBooleanCheckbox.setParent(facetTag);
+ selectBooleanCheckbox.doStartTag();
+ return super.doStartTag();
+ }
+
+ @Override
+ public int doEndTag() throws JspException {
+ selectBooleanCheckbox.doEndTag();
+ facetTag.doEndTag();
+ menuCommandTag.doEndTag();
+ return super.doEndTag();
+ }
+
+ /**
+ * Action to invoke when clicked.
+ * This must be a MethodBinding or a String representing the application action to invoke when
+ * this component is activated by the user.
+ * The MethodBinding must evaluate to a public method that takes no parameters,
+ * and returns a String (the logical outcome) which is passed to the
+ * NavigationHandler for this application.
+ * The String is directly passed to the Navigationhandler.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(type = {}, expression = DynamicExpression.METHOD_BINDING,
+ methodReturnType = "java.lang.Object")
+ public void setAction(MethodExpression action) {
+ this.action = action;
+ }
+
+ /**
+ * MethodBinding representing an action listener method that will be
+ * notified when this component is activated by the user.
+ * The expression must evaluate to a public method that takes an ActionEvent
+ * parameter, with a return type of void.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(type = {}, expression = DynamicExpression.METHOD_BINDING_REQUIRED,
+ methodSignature = "javax.faces.event.ActionEvent")
+ public void setActionListener(javax.el.MethodExpression actionListener) {
+ this.actionListener = actionListener;
+ }
+
+ /**
+ * Script to be invoked when clicked
+ *
+ * @param onclick
+ */
+ @TagAttribute
+ @UIComponentTagAttribute()
+ public void setOnclick(javax.el.ValueExpression onclick) {
+ this.onclick = onclick;
+ }
+
+ /**
+ * Link to an arbitrary URL
+ *
+ * @param link
+ */
+ @TagAttribute
+ @UIComponentTagAttribute()
+ public void setLink(javax.el.ValueExpression link) {
+ this.link = link;
+ }
+
+ /**
+ * The value binding expression linking this
+ * component to a property in a backing bean.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(type = "javax.faces.component.UIComponent")
+ public void setBinding(javax.el.ValueExpression binding) throws JspException {
+ this.binding = binding;
+ }
+
+ /**
+ * Flag indicating whether or not this component should be rendered
+ * (during Render Response Phase), or processed on any subsequent form submit.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(type = "java.lang.Boolean", defaultValue = "true")
+ public void setRendered(javax.el.ValueExpression rendered) {
+ this.rendered = rendered;
+ }
+
+ /**
+ * Flag indicating that this element is disabled.
+ */
+ @TagAttribute(type = String.class)
+ @UIComponentTagAttribute(type = "java.lang.Boolean", defaultValue = "false")
+ public void setDisabled(javax.el.ValueExpression disabled) {
+ this.disabled = disabled;
+ }
+
+ /**
+ * The current value of this component.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(type = "java.lang.Object")
+ public void setValue(javax.el.ValueExpression value) {
+ this.value = value;
+ }
+
+ /**
+ * Text value to display as label.
+ * If text contains an underscore the next character is used as accesskey.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute()
+ public void setLabel(javax.el.ValueExpression label) {
+ this.label = label;
+ }
+
+ /**
+ * Flag indicating that, if this component is activated by the user,
+ * notifications should be delivered to interested listeners and actions
+ * immediately (that is, during Apply Request Values phase) rather than
+ * waiting until Invoke Application phase.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(type = "java.lang.Boolean", defaultValue = "false")
+ public void setImmediate(javax.el.ValueExpression immediate) {
+ this.immediate = immediate;
+ }
+
+ /**
+ * Specify, if the command calls an JSF-Action.
+ * Useful to switch off the Double-Submit-Check and Waiting-Behavior.
+ *
+ * @param transition Indicates the transition.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(type = "java.lang.Boolean", defaultValue = "true")
+ public void setTransition(javax.el.ValueExpression transition) {
+ this.transition = transition;
+ }
+
+ /**
+ * Indicate the partially rendered Components in a case of a submit.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(type = "java.lang.String[]")
+ public void setRenderedPartially(javax.el.ValueExpression renderedPartially) {
+ this.renderedPartially = renderedPartially;
+ }
+
+ public void release() {
+ super.release();
+ rendered = null;
+ value = null;
+ action = null;
+ actionListener = null;
+ onclick = null;
+ link = null;
+ disabled = null;
+ binding = null;
+ label = null;
+ immediate = null;
+ transition = null;
+ renderedPartially = null;
+ menuCommandTag = null;
+ facetTag = null;
+ selectBooleanCheckbox = null;
+ }
+}
\ No newline at end of file
Propchange: myfaces/tobago/trunk/extension/tobago-taglib-extension/src/main/java/org/apache/myfaces/tobago/taglib/extension12/MenuCheckboxExtensionTag.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/tobago/trunk/extension/tobago-taglib-extension/src/main/java/org/apache/myfaces/tobago/taglib/extension12/MenuCheckboxExtensionTag.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: myfaces/tobago/trunk/extension/tobago-taglib-extension/src/main/java/org/apache/myfaces/tobago/taglib/extension12/MenuRadioExtensionTag.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/extension/tobago-taglib-extension/src/main/java/org/apache/myfaces/tobago/taglib/extension12/MenuRadioExtensionTag.java?rev=645313&view=auto
==============================================================================
--- myfaces/tobago/trunk/extension/tobago-taglib-extension/src/main/java/org/apache/myfaces/tobago/taglib/extension12/MenuRadioExtensionTag.java (added)
+++ myfaces/tobago/trunk/extension/tobago-taglib-extension/src/main/java/org/apache/myfaces/tobago/taglib/extension12/MenuRadioExtensionTag.java Sun Apr 6 14:53:32 2008
@@ -0,0 +1,302 @@
+package org.apache.myfaces.tobago.taglib.extension12;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.apache.myfaces.tobago.apt.annotation.ExtensionTag;
+import org.apache.myfaces.tobago.apt.annotation.Tag;
+import org.apache.myfaces.tobago.apt.annotation.TagAttribute;
+import org.apache.myfaces.tobago.apt.annotation.UIComponentTagAttribute;
+import org.apache.myfaces.tobago.apt.annotation.DynamicExpression;
+import org.apache.myfaces.tobago.internal.taglib.SelectOneRadioTag;
+import org.apache.myfaces.tobago.internal.taglib.MenuItemTag;
+
+import javax.faces.webapp.FacetTag;
+import javax.servlet.jsp.JspException;
+import javax.servlet.jsp.tagext.BodyTagSupport;
+
+/*
+ * Date: 09.05.2006
+ * Time: 17:41:39
+ */
+
+/**
+ * Renders a submenu with select one items (like a radio button).
+ */
+
+@Tag(name = "menuRadio", tagExtraInfoClassName = "org.apache.myfaces.tobago.taglib.component.CommandTagExtraInfo")
+@ExtensionTag(baseClassName = "org.apache.myfaces.tobago.internal.taglib.MenuRadioTag")
+public class MenuRadioExtensionTag extends BodyTagSupport {
+
+ private javax.el.ValueExpression rendered;
+ private javax.el.ValueExpression value;
+
+ private MenuItemTag menuCommandTag;
+ private SelectOneRadioTag selectOneRadio;
+ private FacetTag facetTag;
+ private javax.el.MethodExpression action;
+ private javax.el.MethodExpression actionListener;
+ private javax.el.ValueExpression onclick;
+ private javax.el.ValueExpression link;
+ private javax.el.ValueExpression disabled;
+ private javax.el.ValueExpression binding;
+ private javax.el.ValueExpression label;
+ private javax.el.ValueExpression immediate;
+ private javax.el.ValueExpression transition;
+ private javax.el.ValueExpression converter;
+ private javax.el.ValueExpression renderedPartially;
+
+ @Override
+ public int doStartTag() throws JspException {
+
+ menuCommandTag = new MenuItemTag();
+ menuCommandTag.setPageContext(pageContext);
+ menuCommandTag.setParent(getParent());
+
+ if (rendered != null) {
+ menuCommandTag.setRendered(rendered);
+ }
+ if (action != null) {
+ menuCommandTag.setAction(action);
+ }
+ if (actionListener != null) {
+ menuCommandTag.setActionListener(actionListener);
+ }
+ if (onclick != null) {
+ menuCommandTag.setOnclick(onclick);
+ }
+ if (link != null) {
+ menuCommandTag.setLink(link);
+ }
+ if (disabled != null) {
+ menuCommandTag.setDisabled(disabled);
+ }
+ if (binding != null) {
+ menuCommandTag.setBinding(binding);
+ }
+ if (label != null) {
+ menuCommandTag.setLabel(label);
+ }
+ if (immediate != null) {
+ menuCommandTag.setImmediate(immediate);
+ }
+ if (transition != null) {
+ menuCommandTag.setTransition(transition);
+ }
+ if (renderedPartially != null) {
+ menuCommandTag.setRenderedPartially(renderedPartially);
+ }
+ menuCommandTag.doStartTag();
+
+ facetTag = new FacetTag();
+ facetTag.setPageContext(pageContext);
+ facetTag.setParent(menuCommandTag);
+ facetTag.setName(org.apache.myfaces.tobago.TobagoConstants.FACET_ITEMS);
+
+ facetTag.doStartTag();
+ selectOneRadio = new SelectOneRadioTag();
+ selectOneRadio.setPageContext(pageContext);
+ selectOneRadio.setParent(facetTag);
+ if (converter != null) {
+ selectOneRadio.setConverter(converter);
+ }
+ if (value != null) {
+ selectOneRadio.setValue(value);
+ }
+ selectOneRadio.doStartTag();
+
+ return super.doStartTag();
+ }
+
+ @Override
+ public int doEndTag() throws JspException {
+ selectOneRadio.doEndTag();
+ facetTag.doEndTag();
+ menuCommandTag.doEndTag();
+
+ return super.doEndTag();
+ }
+
+ /**
+ * Action to invoke when clicked.
+ * This must be a MethodBinding or a String representing the application action to invoke when
+ * this component is activated by the user.
+ * The MethodBinding must evaluate to a public method that takes no parameters,
+ * and returns a String (the logical outcome) which is passed to the
+ * NavigationHandler for this application.
+ * The String is directly passed to the Navigationhandler.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(type = {}, expression = DynamicExpression.METHOD_BINDING,
+ methodReturnType = "java.lang.Object")
+ public void setAction(javax.el.MethodExpression action) {
+ this.action = action;
+ }
+
+ /**
+ * MethodBinding representing an action listener method that will be
+ * notified when this component is activated by the user.
+ * The expression must evaluate to a public method that takes an ActionEvent
+ * parameter, with a return type of void.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(type = {}, expression = DynamicExpression.METHOD_BINDING_REQUIRED,
+ methodSignature = "javax.faces.event.ActionEvent")
+ public void setActionListener(javax.el.MethodExpression actionListener) {
+ this.actionListener = actionListener;
+ }
+
+ /**
+ * Script to be invoked when clicked
+ *
+ * @param onclick
+ */
+ @TagAttribute
+ @UIComponentTagAttribute()
+ public void setOnclick(javax.el.ValueExpression onclick) {
+ this.onclick = onclick;
+ }
+
+ /**
+ * Link to an arbitrary URL
+ *
+ * @param link
+ */
+ @TagAttribute
+ @UIComponentTagAttribute()
+ public void setLink(javax.el.ValueExpression link) {
+ this.link = link;
+ }
+
+ /**
+ * The value binding expression linking this
+ * component to a property in a backing bean.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(type = "javax.faces.component.UIComponent")
+ public void setBinding(javax.el.ValueExpression binding) throws JspException {
+ this.binding = binding;
+ }
+
+ /**
+ * Flag indicating whether or not this component should be rendered
+ * (during Render Response Phase), or processed on any subsequent form submit.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(type = "java.lang.Boolean", defaultValue = "true")
+ public void setRendered(javax.el.ValueExpression rendered) {
+ this.rendered = rendered;
+ }
+
+ /**
+ * Flag indicating that this element is disabled.
+ */
+ @TagAttribute(type = String.class)
+ @UIComponentTagAttribute(type = "java.lang.Boolean", defaultValue = "false")
+ public void setDisabled(javax.el.ValueExpression disabled) {
+ this.disabled = disabled;
+ }
+
+ /**
+ * The current value of this component.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(type = "java.lang.Object")
+ public void setValue(javax.el.ValueExpression value) {
+ this.value = value;
+ }
+
+ /**
+ * Text value to display as label.
+ * If text contains an underscore the next character is used as accesskey.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute()
+ public void setLabel(javax.el.ValueExpression label) {
+ this.label = label;
+ }
+
+ /**
+ * Flag indicating that, if this component is activated by the user,
+ * notifications should be delivered to interested listeners and actions
+ * immediately (that is, during Apply Request Values phase) rather than
+ * waiting until Invoke Application phase.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(type = "java.lang.Boolean", defaultValue = "false")
+ public void setImmediate(javax.el.ValueExpression immediate) {
+ this.immediate = immediate;
+ }
+
+ /**
+ * Specify, if the command calls an JSF-Action.
+ * Useful to switch off the Double-Submit-Check and Waiting-Behavior.
+ *
+ * @param transition Indicates the transition.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(type = "java.lang.Boolean", defaultValue = "true")
+ public void setTransition(javax.el.ValueExpression transition) {
+ this.transition = transition;
+ }
+
+ /**
+ * An expression that specifies the Converter for this component.
+ * If the value binding expression is a String,
+ * the String is used as an ID to look up a Converter.
+ * If the value binding expression is a Converter,
+ * uses that instance as the converter.
+ * The value can either be a static value (ID case only)
+ * or an EL expression.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(type = "javax.faces.convert.Converter",
+ expression = DynamicExpression.VALUE_BINDING)
+ public void setConverter(javax.el.ValueExpression converter) {
+ this.converter = converter;
+ }
+
+ /**
+ * Indicate the partially rendered Components in a case of a submit.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(type = "java.lang.String[]")
+ public void setRenderedPartially(javax.el.ValueExpression renderedPartially) {
+ this.renderedPartially = renderedPartially;
+ }
+
+ public void release() {
+ super.release();
+ rendered = null;
+ value = null;
+ action = null;
+ actionListener = null;
+ onclick = null;
+ link = null;
+ disabled = null;
+ binding = null;
+ label = null;
+ immediate = null;
+ transition = null;
+ converter = null;
+ renderedPartially = null;
+ menuCommandTag = null;
+ facetTag = null;
+ selectOneRadio = null;
+ }
+
+}
\ No newline at end of file
Propchange: myfaces/tobago/trunk/extension/tobago-taglib-extension/src/main/java/org/apache/myfaces/tobago/taglib/extension12/MenuRadioExtensionTag.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/tobago/trunk/extension/tobago-taglib-extension/src/main/java/org/apache/myfaces/tobago/taglib/extension12/MenuRadioExtensionTag.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: myfaces/tobago/trunk/extension/tobago-taglib-extension/src/main/java/org/apache/myfaces/tobago/taglib/extension12/SelectBooleanCheckboxExtensionTag.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/extension/tobago-taglib-extension/src/main/java/org/apache/myfaces/tobago/taglib/extension12/SelectBooleanCheckboxExtensionTag.java?rev=645313&view=auto
==============================================================================
--- myfaces/tobago/trunk/extension/tobago-taglib-extension/src/main/java/org/apache/myfaces/tobago/taglib/extension12/SelectBooleanCheckboxExtensionTag.java (added)
+++ myfaces/tobago/trunk/extension/tobago-taglib-extension/src/main/java/org/apache/myfaces/tobago/taglib/extension12/SelectBooleanCheckboxExtensionTag.java Sun Apr 6 14:53:32 2008
@@ -0,0 +1,341 @@
+package org.apache.myfaces.tobago.taglib.extension12;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.apache.myfaces.tobago.apt.annotation.ExtensionTag;
+import org.apache.myfaces.tobago.apt.annotation.Tag;
+import org.apache.myfaces.tobago.apt.annotation.TagAttribute;
+import org.apache.myfaces.tobago.apt.annotation.UIComponentTagAttribute;
+import org.apache.myfaces.tobago.apt.annotation.DynamicExpression;
+import org.apache.myfaces.tobago.internal.taglib.SelectBooleanCheckboxTag;
+
+import javax.servlet.jsp.JspException;
+
+/*
+ * Date: Oct 7, 2006
+ * Time: 9:13:21 AM
+ */
+/**
+ * Renders a checkbox.
+ */
+@Tag(name = "selectBooleanCheckbox")
+@ExtensionTag(baseClassName = "org.apache.myfaces.tobago.internal.taglib.SelectBooleanCheckboxTag")
+public class SelectBooleanCheckboxExtensionTag extends TobagoExtensionBodyTagSupport {
+
+ private javax.el.ValueExpression value;
+ private javax.el.MethodExpression valueChangeListener;
+ private javax.el.ValueExpression disabled;
+ private javax.el.ValueExpression readonly;
+ private javax.el.ValueExpression onchange;
+ private javax.el.ValueExpression label;
+ private javax.el.ValueExpression rendered;
+ private javax.el.ValueExpression binding;
+ private javax.el.ValueExpression tip;
+ private javax.el.ValueExpression converter;
+ private javax.el.MethodExpression validator;
+ private javax.el.ValueExpression labelWidth;
+ private javax.el.ValueExpression markup;
+ private javax.el.ValueExpression tabIndex;
+ private javax.el.ValueExpression required;
+ private javax.el.ValueExpression focus;
+
+ private LabelExtensionTag labelTag;
+ private SelectBooleanCheckboxTag selectBooleanCheckboxTag;
+
+ @Override
+ public int doStartTag() throws JspException {
+
+ labelTag = new LabelExtensionTag();
+ labelTag.setPageContext(pageContext);
+ if (label != null) {
+ labelTag.setValue(label);
+ }
+ if (tip != null) {
+ labelTag.setTip(tip);
+ }
+ if (rendered != null) {
+ labelTag.setRendered(rendered);
+ }
+ if (labelWidth != null) {
+ labelTag.setColumns(createStringValueExpression(labelWidth.getExpressionString() + ";*"));
+ }
+ /* TODO accessKey
+ if (labelWithAccessKey != null) {
+ label.setLabelWithAccessKey(labelWithAccessKey);
+ }
+ if (accessKey !=null) {
+ label.setAccessKey(accessKey);
+ } */
+ labelTag.setParent(getParent());
+ labelTag.doStartTag();
+
+ selectBooleanCheckboxTag = new SelectBooleanCheckboxTag();
+ selectBooleanCheckboxTag.setPageContext(pageContext);
+ if (value != null) {
+ selectBooleanCheckboxTag.setValue(value);
+ }
+ if (valueChangeListener != null) {
+ selectBooleanCheckboxTag.setValueChangeListener(valueChangeListener);
+ }
+ if (binding != null) {
+ selectBooleanCheckboxTag.setBinding(binding);
+ }
+ if (onchange != null) {
+ selectBooleanCheckboxTag.setOnchange(onchange);
+ }
+ if (validator != null) {
+ selectBooleanCheckboxTag.setValidator(validator);
+ }
+ if (converter != null) {
+ selectBooleanCheckboxTag.setConverter(converter);
+ }
+ if (disabled != null) {
+ selectBooleanCheckboxTag.setDisabled(disabled);
+ }
+
+ if (id != null) {
+ selectBooleanCheckboxTag.setId(id);
+ }
+
+ if (readonly != null) {
+ selectBooleanCheckboxTag.setReadonly(readonly);
+ }
+
+ if (focus != null) {
+ selectBooleanCheckboxTag.setFocus(focus);
+ }
+
+ if (required != null) {
+ selectBooleanCheckboxTag.setRequired(required);
+ }
+ // TODO item Label
+ //if (itemLabel != null) {
+ // selectOneRadioTag.setLabel(itemLabel);
+ //}
+
+ if (markup != null) {
+ selectBooleanCheckboxTag.setMarkup(markup);
+ }
+ if (tabIndex != null) {
+ selectBooleanCheckboxTag.setTabIndex(tabIndex);
+ }
+ selectBooleanCheckboxTag.setParent(labelTag);
+ selectBooleanCheckboxTag.doStartTag();
+
+ return super.doStartTag();
+ }
+
+ @Override
+ public int doEndTag() throws JspException {
+ selectBooleanCheckboxTag.doEndTag();
+ labelTag.doEndTag();
+ return super.doEndTag();
+ }
+
+ @Override
+ public void release() {
+ super.release();
+ binding = null;
+ onchange = null;
+ disabled = null;
+ label = null;
+ labelWidth = null;
+ readonly = null;
+ rendered = null;
+ converter = null;
+ validator = null;
+ tip = null;
+ value = null;
+ valueChangeListener = null;
+ markup = null;
+ tabIndex = null;
+ focus = null;
+ required = null;
+ selectBooleanCheckboxTag = null;
+ labelTag = null;
+ }
+
+ /**
+ * The current value of this component.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(type = "java.lang.Boolean")
+ public void setValue(javax.el.ValueExpression value) {
+ this.value = value;
+ }
+
+ /**
+ * MethodBinding representing a value change listener method
+ * that will be notified when a new value has been set for this input component.
+ * The expression must evaluate to a public method that takes a ValueChangeEvent
+ * parameter, with a return type of void.
+ *
+ * @param valueChangeListener
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(
+ type = {},
+ expression = DynamicExpression.METHOD_BINDING_REQUIRED,
+ methodSignature = "javax.faces.event.ValueChangeEvent")
+ public void setValueChangeListener(javax.el.MethodExpression valueChangeListener) {
+ this.valueChangeListener = valueChangeListener;
+ }
+
+ /**
+ * Flag indicating that this element is disabled.
+ */
+ @TagAttribute(type = String.class)
+ @UIComponentTagAttribute(type = "java.lang.Boolean", defaultValue = "false")
+ public void setDisabled(javax.el.ValueExpression disabled) {
+ this.disabled = disabled;
+ }
+
+ /**
+ * Flag indicating that this component will prohibit changes by the user.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(type = "java.lang.Boolean")
+ public void setReadonly(javax.el.ValueExpression readonly) {
+ this.readonly = readonly;
+ }
+
+ /**
+ * Clientside script function to add to this component's onchange handler.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute()
+ public void setOnchange(javax.el.ValueExpression onchange) {
+ this.onchange = onchange;
+ }
+
+ /**
+ * Text value to display as label.
+ * If text contains an underscore the next character is used as accesskey.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute()
+ public void setLabel(javax.el.ValueExpression label) {
+ this.label = label;
+ }
+
+ /**
+ * A method binding EL expression,
+ * accepting FacesContext, UIComponent,
+ * and Object parameters, and returning void, that validates
+ * the component's local value.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(type = {},
+ expression = DynamicExpression.METHOD_BINDING,
+ methodSignature = { "javax.faces.context.FacesContext", "javax.faces.component.UIComponent", "java.lang.Object" })
+ public void setValidator(javax.el.MethodExpression validator) {
+ this.validator = validator;
+ }
+
+ /**
+ * An expression that specifies the Converter for this component.
+ * If the value binding expression is a String,
+ * the String is used as an ID to look up a Converter.
+ * If the value binding expression is a Converter,
+ * uses that instance as the converter.
+ * The value can either be a static value (ID case only)
+ * or an EL expression.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(type = "javax.faces.convert.Converter",
+ expression = DynamicExpression.VALUE_BINDING)
+ public void setConverter(javax.el.ValueExpression converter) {
+ this.converter = converter;
+ }
+
+ /**
+ * Flag indicating whether or not this component should be rendered
+ * (during Render Response Phase), or processed on any subsequent form submit.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(type = "java.lang.Boolean", defaultValue = "true")
+ public void setRendered(javax.el.ValueExpression rendered) {
+ this.rendered = rendered;
+ }
+
+ /**
+ * The value binding expression linking this
+ * component to a property in a backing bean.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(type = "javax.faces.component.UIComponent")
+ public void setBinding(javax.el.ValueExpression binding) {
+ this.binding = binding;
+ }
+
+ /**
+ * Text value to display as tooltip.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute()
+ public void setTip(javax.el.ValueExpression tip) {
+ this.tip = tip;
+ }
+
+ /**
+ * The width for the label component. Default: 'fixed'.
+ * This value is used in the gridLayouts columns attribute.
+ * See gridLayout tag for valid values.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute()
+ public void setLabelWidth(javax.el.ValueExpression labelWidth) {
+ this.labelWidth = labelWidth;
+ }
+
+ /**
+ * Indicate markup of this component.
+ * Possible value is 'none'. But this can be overridden in the theme.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(defaultValue = "none", type = "java.lang.String[]")
+ public void setMarkup(javax.el.ValueExpression markup) {
+ this.markup = markup;
+ }
+
+ @TagAttribute
+ @UIComponentTagAttribute(type = "java.lang.Integer")
+ public void setTabIndex(javax.el.ValueExpression tabIndex) {
+ this.tabIndex = tabIndex;
+ }
+
+ /**
+ * Flag indicating this component should recieve the focus.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(type = "java.lang.Boolean")
+ public void setFocus(javax.el.ValueExpression focus) {
+ this.focus = focus;
+ }
+
+ /**
+ * Flag indicating that a value is required.
+ * If the value is an empty string a
+ * ValidationError occurs and a Error Message is rendered.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(type = "java.lang.Boolean")
+ public void setRequired(javax.el.ValueExpression required) {
+ this.required = required;
+ }
+}
\ No newline at end of file
Propchange: myfaces/tobago/trunk/extension/tobago-taglib-extension/src/main/java/org/apache/myfaces/tobago/taglib/extension12/SelectBooleanCheckboxExtensionTag.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/tobago/trunk/extension/tobago-taglib-extension/src/main/java/org/apache/myfaces/tobago/taglib/extension12/SelectBooleanCheckboxExtensionTag.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: myfaces/tobago/trunk/extension/tobago-taglib-extension/src/main/java/org/apache/myfaces/tobago/taglib/extension12/SelectManyCheckboxExtensionTag.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/extension/tobago-taglib-extension/src/main/java/org/apache/myfaces/tobago/taglib/extension12/SelectManyCheckboxExtensionTag.java?rev=645313&view=auto
==============================================================================
--- myfaces/tobago/trunk/extension/tobago-taglib-extension/src/main/java/org/apache/myfaces/tobago/taglib/extension12/SelectManyCheckboxExtensionTag.java (added)
+++ myfaces/tobago/trunk/extension/tobago-taglib-extension/src/main/java/org/apache/myfaces/tobago/taglib/extension12/SelectManyCheckboxExtensionTag.java Sun Apr 6 14:53:32 2008
@@ -0,0 +1,365 @@
+package org.apache.myfaces.tobago.taglib.extension12;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.apache.myfaces.tobago.internal.taglib.SelectManyCheckboxTag;
+import org.apache.myfaces.tobago.apt.annotation.Tag;
+import org.apache.myfaces.tobago.apt.annotation.ExtensionTag;
+import org.apache.myfaces.tobago.apt.annotation.TagAttribute;
+import org.apache.myfaces.tobago.apt.annotation.UIComponentTagAttribute;
+import org.apache.myfaces.tobago.apt.annotation.DynamicExpression;
+import javax.servlet.jsp.JspException;
+
+/**
+ * Render a group of checkboxes.
+ */
+@Tag(name = "selectManyCheckbox")
+@ExtensionTag(baseClassName = "org.apache.myfaces.tobago.internal.taglib.SelectManyCheckboxTag")
+public class SelectManyCheckboxExtensionTag extends TobagoExtensionBodyTagSupport {
+
+ private javax.el.ValueExpression required;
+ private javax.el.ValueExpression value;
+ private javax.el.MethodExpression valueChangeListener;
+ private javax.el.ValueExpression disabled;
+ private javax.el.ValueExpression readonly;
+ private javax.el.ValueExpression onchange;
+ private javax.el.ValueExpression inline;
+ private javax.el.ValueExpression label;
+ private javax.el.ValueExpression rendered;
+ private javax.el.ValueExpression binding;
+ private javax.el.ValueExpression tip;
+ //private javax.el.ValueExpression height;
+ private javax.el.ValueExpression converter;
+ private javax.el.MethodExpression validator;
+ private javax.el.ValueExpression labelWidth;
+ private javax.el.ValueExpression markup;
+ private javax.el.ValueExpression tabIndex;
+ private javax.el.ValueExpression focus;
+ private javax.el.ValueExpression renderRange;
+
+ private LabelExtensionTag labelTag;
+ private SelectManyCheckboxTag selectManyCheckboxTag;
+
+ @Override
+ public int doStartTag() throws JspException {
+
+ labelTag = new LabelExtensionTag();
+ labelTag.setPageContext(pageContext);
+ labelTag.setRows("*");
+ if (label != null) {
+ labelTag.setValue(label);
+ }
+ if (tip != null) {
+ labelTag.setTip(tip);
+ }
+ if (rendered != null) {
+ labelTag.setRendered(rendered);
+ }
+ if (labelWidth != null) {
+ labelTag.setColumns(createStringValueExpression(labelWidth.getExpressionString() + ";*"));
+ }
+ /* TODO accessKey
+ if (labelWithAccessKey != null) {
+ label.setLabelWithAccessKey(labelWithAccessKey);
+ }
+ if (accessKey !=null) {
+ label.setAccessKey(accessKey);
+ } */
+ labelTag.setParent(getParent());
+ labelTag.doStartTag();
+
+ selectManyCheckboxTag = new SelectManyCheckboxTag();
+ selectManyCheckboxTag.setPageContext(pageContext);
+ if (value != null) {
+ selectManyCheckboxTag.setValue(value);
+ }
+ if (valueChangeListener != null) {
+ selectManyCheckboxTag.setValueChangeListener(valueChangeListener);
+ }
+ if (binding != null) {
+ selectManyCheckboxTag.setBinding(binding);
+ }
+ if (onchange != null) {
+ selectManyCheckboxTag.setOnchange(onchange);
+ }
+ if (validator != null) {
+ selectManyCheckboxTag.setValidator(validator);
+ }
+ if (converter != null) {
+ selectManyCheckboxTag.setConverter(converter);
+ }
+ if (disabled != null) {
+ selectManyCheckboxTag.setDisabled(disabled);
+ }
+ if (inline != null) {
+ selectManyCheckboxTag.setInline(inline);
+ }
+ if (focus != null) {
+ selectManyCheckboxTag.setFocus(focus);
+ }
+ if (id != null) {
+ selectManyCheckboxTag.setId(id);
+ }
+ /*if (height != null) {
+ selectManyCheckboxTag.setHeight(height);
+ }*/
+ if (readonly != null) {
+ selectManyCheckboxTag.setReadonly(readonly);
+ }
+ if (required != null) {
+ selectManyCheckboxTag.setRequired(required);
+ }
+ if (markup != null) {
+ selectManyCheckboxTag.setMarkup(markup);
+ }
+ if (renderRange != null) {
+ selectManyCheckboxTag.setRenderRange(renderRange);
+ }
+ if (tabIndex != null) {
+ selectManyCheckboxTag.setTabIndex(tabIndex);
+ }
+ selectManyCheckboxTag.setParent(labelTag);
+ selectManyCheckboxTag.doStartTag();
+
+ return super.doStartTag();
+ }
+
+ @Override
+ public int doEndTag() throws JspException {
+ selectManyCheckboxTag.doEndTag();
+ labelTag.doEndTag();
+ return super.doEndTag();
+ }
+
+ @Override
+ public void release() {
+ super.release();
+ binding = null;
+ onchange = null;
+ disabled = null;
+ inline = null;
+ label = null;
+ labelWidth = null;
+ //height = null;
+ readonly = null;
+ rendered = null;
+ converter = null;
+ validator = null;
+ required = null;
+ tip = null;
+ value = null;
+ valueChangeListener = null;
+ markup = null;
+ tabIndex = null;
+ selectManyCheckboxTag = null;
+ labelTag = null;
+ focus = null;
+ renderRange = null;
+ }
+
+ /**
+ * Flag indicating that a value is required.
+ * If the value is an empty string a
+ * ValidationError occurs and a Error Message is rendered.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(type = "java.lang.Boolean")
+ public void setRequired(javax.el.ValueExpression required) {
+ this.required = required;
+ }
+
+ /**
+ * The current value of this component.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(type = "java.lang.Object")
+ public void setValue(javax.el.ValueExpression value) {
+ this.value = value;
+ }
+
+ /**
+ * MethodBinding representing a value change listener method
+ * that will be notified when a new value has been set for this input component.
+ * The expression must evaluate to a public method that takes a ValueChangeEvent
+ * parameter, with a return type of void.
+ *
+ * @param valueChangeListener
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(
+ type = {},
+ expression = DynamicExpression.METHOD_BINDING_REQUIRED,
+ methodSignature = "javax.faces.event.ValueChangeEvent")
+ public void setValueChangeListener(javax.el.MethodExpression valueChangeListener) {
+ this.valueChangeListener = valueChangeListener;
+ }
+
+ /**
+ * Flag indicating that this element is disabled.
+ */
+ @TagAttribute(type = String.class)
+ @UIComponentTagAttribute(type = "java.lang.Boolean", defaultValue = "false")
+ public void setDisabled(javax.el.ValueExpression disabled) {
+ this.disabled = disabled;
+ }
+
+ /**
+ * Flag indicating that this component will prohibit changes by the user.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(type = "java.lang.Boolean")
+ public void setReadonly(javax.el.ValueExpression readonly) {
+ this.readonly = readonly;
+ }
+
+ /**
+ * Clientside script function to add to this component's onchange handler.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute()
+ public void setOnchange(javax.el.ValueExpression onchange) {
+ this.onchange = onchange;
+ }
+
+ /**
+ * Flag indicating this component should rendered as an inline element.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(type = "java.lang.Boolean")
+ public void setInline(javax.el.ValueExpression inline) {
+ this.inline = inline;
+ }
+
+ /**
+ * Text value to display as label.
+ * If text contains an underscore the next character is used as accesskey.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute()
+ public void setLabel(javax.el.ValueExpression label) {
+ this.label = label;
+ }
+
+ /*public void setHeight(String height) {
+ this.height = height;
+ } */
+
+ /**
+ * A method binding EL expression,
+ * accepting FacesContext, UIComponent,
+ * and Object parameters, and returning void, that validates
+ * the component's local value.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(type = {},
+ expression = DynamicExpression.METHOD_BINDING,
+ methodSignature = { "javax.faces.context.FacesContext", "javax.faces.component.UIComponent", "java.lang.Object" })
+ public void setValidator(javax.el.MethodExpression validator) {
+ this.validator = validator;
+ }
+
+ /**
+ * An expression that specifies the Converter for this component.
+ * If the value binding expression is a String,
+ * the String is used as an ID to look up a Converter.
+ * If the value binding expression is a Converter,
+ * uses that instance as the converter.
+ * The value can either be a static value (ID case only)
+ * or an EL expression.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(type = "javax.faces.convert.Converter",
+ expression = DynamicExpression.VALUE_BINDING)
+ public void setConverter(javax.el.ValueExpression converter) {
+ this.converter = converter;
+ }
+
+ /**
+ * Flag indicating whether or not this component should be rendered
+ * (during Render Response Phase), or processed on any subsequent form submit.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(type = "java.lang.Boolean", defaultValue = "true")
+ public void setRendered(javax.el.ValueExpression rendered) {
+ this.rendered = rendered;
+ }
+
+ /**
+ * The value binding expression linking this
+ * component to a property in a backing bean.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(type = "javax.faces.component.UIComponent")
+ public void setBinding(javax.el.ValueExpression binding) {
+ this.binding = binding;
+ }
+
+ /**
+ * Text value to display as tooltip.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute()
+ public void setTip(javax.el.ValueExpression tip) {
+ this.tip = tip;
+ }
+
+ /**
+ * The width for the label component. Default: 'fixed'.
+ * This value is used in the gridLayouts columns attribute.
+ * See gridLayout tag for valid values.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute()
+ public void setLabelWidth(javax.el.ValueExpression labelWidth) {
+ this.labelWidth = labelWidth;
+ }
+
+ /**
+ * Indicate markup of this component.
+ * Possible value is 'none'. But this can be overridden in the theme.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(defaultValue = "none", type = "java.lang.String[]")
+ public void setMarkup(javax.el.ValueExpression markup) {
+ this.markup = markup;
+ }
+
+ @TagAttribute
+ @UIComponentTagAttribute(type = "java.lang.Integer")
+ public void setTabIndex(javax.el.ValueExpression tabIndex) {
+ this.tabIndex = tabIndex;
+ }
+
+ /**
+ * Flag indicating this component should recieve the focus.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(type = "java.lang.Boolean")
+ public void setFocus(javax.el.ValueExpression focus) {
+ this.focus = focus;
+ }
+
+ /**
+ * Range of items to render.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute()
+ public void setRenderRange(javax.el.ValueExpression renderRange) {
+ this.renderRange = renderRange;
+ }
+}
\ No newline at end of file
Propchange: myfaces/tobago/trunk/extension/tobago-taglib-extension/src/main/java/org/apache/myfaces/tobago/taglib/extension12/SelectManyCheckboxExtensionTag.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/tobago/trunk/extension/tobago-taglib-extension/src/main/java/org/apache/myfaces/tobago/taglib/extension12/SelectManyCheckboxExtensionTag.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: myfaces/tobago/trunk/extension/tobago-taglib-extension/src/main/java/org/apache/myfaces/tobago/taglib/extension12/SelectManyListboxExtensionTag.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/extension/tobago-taglib-extension/src/main/java/org/apache/myfaces/tobago/taglib/extension12/SelectManyListboxExtensionTag.java?rev=645313&view=auto
==============================================================================
--- myfaces/tobago/trunk/extension/tobago-taglib-extension/src/main/java/org/apache/myfaces/tobago/taglib/extension12/SelectManyListboxExtensionTag.java (added)
+++ myfaces/tobago/trunk/extension/tobago-taglib-extension/src/main/java/org/apache/myfaces/tobago/taglib/extension12/SelectManyListboxExtensionTag.java Sun Apr 6 14:53:32 2008
@@ -0,0 +1,358 @@
+package org.apache.myfaces.tobago.taglib.extension12;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.apache.myfaces.tobago.apt.annotation.ExtensionTag;
+import org.apache.myfaces.tobago.apt.annotation.Tag;
+import org.apache.myfaces.tobago.apt.annotation.TagAttribute;
+import org.apache.myfaces.tobago.apt.annotation.UIComponentTagAttribute;
+import org.apache.myfaces.tobago.apt.annotation.DynamicExpression;
+import org.apache.myfaces.tobago.internal.taglib.SelectManyListboxTag;
+
+import javax.servlet.jsp.JspException;
+
+/*
+ * Date: 16.12.2005
+ * Time: 19:12:33
+ */
+
+/**
+ * Renders a multi selection option listbox with a label.
+ */
+
+@Tag(name = "selectManyListbox")
+@ExtensionTag(baseClassName = "org.apache.myfaces.tobago.internal.taglib.SelectManyListboxTag")
+public class SelectManyListboxExtensionTag extends TobagoExtensionBodyTagSupport {
+
+ private javax.el.ValueExpression required;
+ private javax.el.ValueExpression value;
+ private javax.el.MethodExpression valueChangeListener;
+ private javax.el.ValueExpression disabled;
+ private javax.el.ValueExpression readonly;
+ private javax.el.ValueExpression onchange;
+ private javax.el.ValueExpression inline;
+ private javax.el.ValueExpression label;
+ private javax.el.ValueExpression rendered;
+ private javax.el.ValueExpression binding;
+ private javax.el.ValueExpression tip;
+ private javax.el.ValueExpression height;
+ private javax.el.ValueExpression converter;
+ private javax.el.MethodExpression validator;
+ private javax.el.ValueExpression labelWidth;
+ private javax.el.ValueExpression markup;
+ private javax.el.ValueExpression tabIndex;
+ private javax.el.ValueExpression focus;
+
+ private LabelExtensionTag labelTag;
+ private SelectManyListboxTag selectManyListboxTag;
+
+ @Override
+ public int doStartTag() throws JspException {
+
+ labelTag = new LabelExtensionTag();
+ labelTag.setPageContext(pageContext);
+ labelTag.setRows("*");
+ if (label != null) {
+ labelTag.setValue(label);
+ }
+ if (tip != null) {
+ labelTag.setTip(tip);
+ }
+ if (rendered != null) {
+ labelTag.setRendered(rendered);
+ }
+ if (labelWidth != null) {
+ labelTag.setColumns(createStringValueExpression(labelWidth.getExpressionString() + ";*"));
+ }
+ /* TODO accessKey
+ if (labelWithAccessKey != null) {
+ label.setLabelWithAccessKey(labelWithAccessKey);
+ }
+ if (accessKey !=null) {
+ label.setAccessKey(accessKey);
+ } */
+ labelTag.setParent(getParent());
+ labelTag.doStartTag();
+
+ selectManyListboxTag = new SelectManyListboxTag();
+ selectManyListboxTag.setPageContext(pageContext);
+ if (value != null) {
+ selectManyListboxTag.setValue(value);
+ }
+ if (valueChangeListener != null) {
+ selectManyListboxTag.setValueChangeListener(valueChangeListener);
+ }
+ if (binding != null) {
+ selectManyListboxTag.setBinding(binding);
+ }
+ if (onchange != null) {
+ selectManyListboxTag.setOnchange(onchange);
+ }
+ if (validator != null) {
+ selectManyListboxTag.setValidator(validator);
+ }
+ if (converter != null) {
+ selectManyListboxTag.setConverter(converter);
+ }
+ if (disabled != null) {
+ selectManyListboxTag.setDisabled(disabled);
+ }
+ if (inline != null) {
+ selectManyListboxTag.setInline(inline);
+ }
+ if (focus != null) {
+ selectManyListboxTag.setFocus(focus);
+ }
+ if (id != null) {
+ selectManyListboxTag.setId(id);
+ }
+ if (height != null) {
+ selectManyListboxTag.setHeight(height);
+ }
+ if (readonly != null) {
+ selectManyListboxTag.setReadonly(readonly);
+ }
+ if (required != null) {
+ selectManyListboxTag.setRequired(required);
+ }
+ if (markup != null) {
+ selectManyListboxTag.setMarkup(markup);
+ }
+ if (tabIndex != null) {
+ selectManyListboxTag.setTabIndex(tabIndex);
+ }
+ selectManyListboxTag.setParent(labelTag);
+ selectManyListboxTag.doStartTag();
+
+ return super.doStartTag();
+ }
+
+ @Override
+ public int doEndTag() throws JspException {
+ selectManyListboxTag.doEndTag();
+ labelTag.doEndTag();
+ return super.doEndTag();
+ }
+
+ @Override
+ public void release() {
+ super.release();
+ binding = null;
+ onchange = null;
+ disabled = null;
+ inline = null;
+ label = null;
+ labelWidth = null;
+ height = null;
+ readonly = null;
+ rendered = null;
+ converter = null;
+ validator = null;
+ required = null;
+ tip = null;
+ value = null;
+ valueChangeListener = null;
+ markup = null;
+ tabIndex = null;
+ selectManyListboxTag = null;
+ labelTag = null;
+ focus = null;
+ }
+
+ /**
+ * Flag indicating that a value is required.
+ * If the value is an empty string a
+ * ValidationError occurs and a Error Message is rendered.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(type = "java.lang.Boolean")
+ public void setRequired(javax.el.ValueExpression required) {
+ this.required = required;
+ }
+
+ /**
+ * The current value of this component.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(type = "java.lang.Object")
+ public void setValue(javax.el.ValueExpression value) {
+ this.value = value;
+ }
+
+ /**
+ * MethodBinding representing a value change listener method
+ * that will be notified when a new value has been set for this input component.
+ * The expression must evaluate to a public method that takes a ValueChangeEvent
+ * parameter, with a return type of void.
+ *
+ * @param valueChangeListener
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(
+ type = {},
+ expression = DynamicExpression.METHOD_BINDING_REQUIRED,
+ methodSignature = "javax.faces.event.ValueChangeEvent")
+ public void setValueChangeListener(javax.el.MethodExpression valueChangeListener) {
+ this.valueChangeListener = valueChangeListener;
+ }
+
+ /**
+ * Flag indicating that this element is disabled.
+ */
+ @TagAttribute(type = String.class)
+ @UIComponentTagAttribute(type = "java.lang.Boolean", defaultValue = "false")
+ public void setDisabled(javax.el.ValueExpression disabled) {
+ this.disabled = disabled;
+ }
+
+ /**
+ * Flag indicating that this component will prohibit changes by the user.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(type = "java.lang.Boolean")
+ public void setReadonly(javax.el.ValueExpression readonly) {
+ this.readonly = readonly;
+ }
+
+ /**
+ * Clientside script function to add to this component's onchange handler.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute()
+ public void setOnchange(javax.el.ValueExpression onchange) {
+ this.onchange = onchange;
+ }
+
+ /**
+ * Flag indicating this component should rendered as an inline element.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(type = "java.lang.Boolean")
+ public void setInline(javax.el.ValueExpression inline) {
+ this.inline = inline;
+ }
+
+ /**
+ * Text value to display as label.
+ * If text contains an underscore the next character is used as accesskey.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute()
+ public void setLabel(javax.el.ValueExpression label) {
+ this.label = label;
+ }
+
+ public void setHeight(javax.el.ValueExpression height) {
+ this.height = height;
+ }
+
+ /**
+ * A method binding EL expression,
+ * accepting FacesContext, UIComponent,
+ * and Object parameters, and returning void, that validates
+ * the component's local value.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(type = {},
+ expression = DynamicExpression.METHOD_BINDING,
+ methodSignature = { "javax.faces.context.FacesContext", "javax.faces.component.UIComponent", "java.lang.Object" })
+ public void setValidator(javax.el.MethodExpression validator) {
+ this.validator = validator;
+ }
+
+ /**
+ * An expression that specifies the Converter for this component.
+ * If the value binding expression is a String,
+ * the String is used as an ID to look up a Converter.
+ * If the value binding expression is a Converter,
+ * uses that instance as the converter.
+ * The value can either be a static value (ID case only)
+ * or an EL expression.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(type = "javax.faces.convert.Converter",
+ expression = DynamicExpression.VALUE_BINDING)
+ public void setConverter(javax.el.ValueExpression converter) {
+ this.converter = converter;
+ }
+
+ /**
+ * Flag indicating whether or not this component should be rendered
+ * (during Render Response Phase), or processed on any subsequent form submit.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(type = "java.lang.Boolean", defaultValue = "true")
+ public void setRendered(javax.el.ValueExpression rendered) {
+ this.rendered = rendered;
+ }
+
+ /**
+ * The value binding expression linking this
+ * component to a property in a backing bean.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(type = "javax.faces.component.UIComponent")
+ public void setBinding(javax.el.ValueExpression binding) {
+ this.binding = binding;
+ }
+
+ /**
+ * Text value to display as tooltip.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute()
+ public void setTip(javax.el.ValueExpression tip) {
+ this.tip = tip;
+ }
+
+ /**
+ * The width for the label component. Default: 'fixed'.
+ * This value is used in the gridLayouts columns attribute.
+ * See gridLayout tag for valid values.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute()
+ public void setLabelWidth(javax.el.ValueExpression labelWidth) {
+ this.labelWidth = labelWidth;
+ }
+
+ /**
+ * Indicate markup of this component.
+ * Possible value is 'none'. But this can be overridden in the theme.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(defaultValue = "none", type = "java.lang.String[]")
+ public void setMarkup(javax.el.ValueExpression markup) {
+ this.markup = markup;
+ }
+
+ @TagAttribute
+ @UIComponentTagAttribute(type = "java.lang.Integer")
+ public void setTabIndex(javax.el.ValueExpression tabIndex) {
+ this.tabIndex = tabIndex;
+ }
+
+ /**
+ * Flag indicating this component should recieve the focus.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(type = "java.lang.Boolean")
+ public void setFocus(javax.el.ValueExpression focus) {
+ this.focus = focus;
+ }
+}
\ No newline at end of file
Propchange: myfaces/tobago/trunk/extension/tobago-taglib-extension/src/main/java/org/apache/myfaces/tobago/taglib/extension12/SelectManyListboxExtensionTag.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/tobago/trunk/extension/tobago-taglib-extension/src/main/java/org/apache/myfaces/tobago/taglib/extension12/SelectManyListboxExtensionTag.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: myfaces/tobago/trunk/extension/tobago-taglib-extension/src/main/java/org/apache/myfaces/tobago/taglib/extension12/SelectOneChoiceExtensionTag.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/extension/tobago-taglib-extension/src/main/java/org/apache/myfaces/tobago/taglib/extension12/SelectOneChoiceExtensionTag.java?rev=645313&view=auto
==============================================================================
--- myfaces/tobago/trunk/extension/tobago-taglib-extension/src/main/java/org/apache/myfaces/tobago/taglib/extension12/SelectOneChoiceExtensionTag.java (added)
+++ myfaces/tobago/trunk/extension/tobago-taglib-extension/src/main/java/org/apache/myfaces/tobago/taglib/extension12/SelectOneChoiceExtensionTag.java Sun Apr 6 14:53:32 2008
@@ -0,0 +1,336 @@
+package org.apache.myfaces.tobago.taglib.extension12;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.apache.myfaces.tobago.apt.annotation.ExtensionTag;
+import org.apache.myfaces.tobago.apt.annotation.Tag;
+import org.apache.myfaces.tobago.apt.annotation.TagAttribute;
+import org.apache.myfaces.tobago.apt.annotation.UIComponentTagAttribute;
+import org.apache.myfaces.tobago.apt.annotation.DynamicExpression;
+import org.apache.myfaces.tobago.internal.taglib.SelectOneChoiceTag;
+
+import javax.servlet.jsp.JspException;
+
+/**
+ * Render a single selection dropdown list with a label.
+ */
+
+@Tag(name = "selectOneChoice")
+@ExtensionTag(baseClassName = "org.apache.myfaces.tobago.internal.taglib.SelectOneChoiceTag")
+public class SelectOneChoiceExtensionTag extends TobagoExtensionBodyTagSupport {
+
+ private javax.el.ValueExpression required;
+ private javax.el.ValueExpression value;
+ private javax.el.MethodExpression valueChangeListener;
+ private javax.el.ValueExpression disabled;
+ private javax.el.ValueExpression readonly;
+ private javax.el.ValueExpression onchange;
+ private javax.el.ValueExpression inline;
+ private javax.el.ValueExpression label;
+ private javax.el.ValueExpression rendered;
+ private javax.el.ValueExpression binding;
+ private javax.el.ValueExpression tip;
+ private javax.el.MethodExpression validator;
+ private javax.el.ValueExpression converter;
+ private javax.el.ValueExpression labelWidth;
+ private javax.el.ValueExpression tabIndex;
+ private javax.el.ValueExpression focus;
+ private javax.el.ValueExpression markup;
+
+ private LabelExtensionTag labelTag;
+ private SelectOneChoiceTag selectOneChoiceTag;
+
+ @Override
+ public int doStartTag() throws JspException {
+
+ labelTag = new LabelExtensionTag();
+ labelTag.setPageContext(pageContext);
+ if (label != null) {
+ labelTag.setValue(label);
+ }
+ if (tip != null) {
+ labelTag.setTip(tip);
+ }
+ if (rendered != null) {
+ labelTag.setRendered(rendered);
+ }
+ if (labelWidth != null) {
+ labelTag.setColumns(createStringValueExpression(labelWidth.getExpressionString() + ";*"));
+ }
+ labelTag.setParent(getParent());
+ labelTag.doStartTag();
+
+ selectOneChoiceTag = new SelectOneChoiceTag();
+ selectOneChoiceTag.setPageContext(pageContext);
+ if (value != null) {
+ selectOneChoiceTag.setValue(value);
+ }
+ if (valueChangeListener != null) {
+ selectOneChoiceTag.setValueChangeListener(valueChangeListener);
+ }
+ if (validator != null) {
+ selectOneChoiceTag.setValidator(validator);
+ }
+ if (converter != null) {
+ selectOneChoiceTag.setConverter(converter);
+ }
+ if (binding != null) {
+ selectOneChoiceTag.setBinding(binding);
+ }
+ if (onchange != null) {
+ selectOneChoiceTag.setOnchange(onchange);
+ }
+ if (disabled != null) {
+ selectOneChoiceTag.setDisabled(disabled);
+ }
+ if (markup != null) {
+ selectOneChoiceTag.setMarkup(markup);
+ }
+ if (inline != null) {
+ selectOneChoiceTag.setInline(inline);
+ }
+ if (focus != null) {
+ selectOneChoiceTag.setFocus(focus);
+ }
+ if (id != null) {
+ selectOneChoiceTag.setId(id);
+ }
+ if (readonly != null) {
+ selectOneChoiceTag.setReadonly(readonly);
+ }
+ if (required != null) {
+ selectOneChoiceTag.setRequired(required);
+ }
+ if (tabIndex != null) {
+ selectOneChoiceTag.setTabIndex(tabIndex);
+ }
+ selectOneChoiceTag.setParent(labelTag);
+ selectOneChoiceTag.doStartTag();
+
+ return super.doStartTag();
+ }
+
+ @Override
+ public int doEndTag() throws JspException {
+ selectOneChoiceTag.doEndTag();
+ labelTag.doEndTag();
+ return super.doEndTag();
+ }
+
+ @Override
+ public void release() {
+ super.release();
+ binding = null;
+ onchange = null;
+ disabled = null;
+ inline = null;
+ label = null;
+ labelWidth = null;
+ converter = null;
+ validator = null;
+ readonly = null;
+ rendered = null;
+ required = null;
+ tip = null;
+ value = null;
+ valueChangeListener = null;
+ tabIndex = null;
+ selectOneChoiceTag = null;
+ labelTag = null;
+ focus = null;
+ markup = null;
+ }
+
+ /**
+ * Flag indicating that a value is required.
+ * If the value is an empty string a
+ * ValidationError occurs and a Error Message is rendered.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(type = "java.lang.Boolean")
+ public void setRequired(javax.el.ValueExpression required) {
+ this.required = required;
+ }
+
+ /**
+ * The current value of this component.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(type = "java.lang.Object")
+ public void setValue(javax.el.ValueExpression value) {
+ this.value = value;
+ }
+
+ /**
+ * MethodBinding representing a value change listener method
+ * that will be notified when a new value has been set for this input component.
+ * The expression must evaluate to a public method that takes a ValueChangeEvent
+ * parameter, with a return type of void.
+ *
+ * @param valueChangeListener
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(
+ type = {},
+ expression = DynamicExpression.METHOD_BINDING_REQUIRED,
+ methodSignature = "javax.faces.event.ValueChangeEvent")
+ public void setValueChangeListener(javax.el.MethodExpression valueChangeListener) {
+ this.valueChangeListener = valueChangeListener;
+ }
+
+ /**
+ * A method binding EL expression,
+ * accepting FacesContext, UIComponent,
+ * and Object parameters, and returning void, that validates
+ * the component's local value.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(type = {},
+ expression = DynamicExpression.METHOD_BINDING,
+ methodSignature = { "javax.faces.context.FacesContext", "javax.faces.component.UIComponent", "java.lang.Object" })
+ public void setValidator(javax.el.MethodExpression validator) {
+ this.validator = validator;
+ }
+
+ /**
+ * Flag indicating that this element is disabled.
+ */
+ @TagAttribute(type = String.class)
+ @UIComponentTagAttribute(type = "java.lang.Boolean", defaultValue = "false")
+ public void setDisabled(javax.el.ValueExpression disabled) {
+ this.disabled = disabled;
+ }
+
+ /**
+ * Flag indicating that this component will prohibit changes by the user.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(type = "java.lang.Boolean")
+ public void setReadonly(javax.el.ValueExpression readonly) {
+ this.readonly = readonly;
+ }
+
+ /**
+ * Clientside script function to add to this component's onchange handler.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute()
+ public void setOnchange(javax.el.ValueExpression onchange) {
+ this.onchange = onchange;
+ }
+
+ /**
+ * An expression that specifies the Converter for this component.
+ * If the value binding expression is a String,
+ * the String is used as an ID to look up a Converter.
+ * If the value binding expression is a Converter,
+ * uses that instance as the converter.
+ * The value can either be a static value (ID case only)
+ * or an EL expression.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(type = "javax.faces.convert.Converter",
+ expression = DynamicExpression.VALUE_BINDING)
+ public void setConverter(javax.el.ValueExpression converter) {
+ this.converter = converter;
+ }
+
+ /**
+ * Flag indicating this component should rendered as an inline element.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(type = "java.lang.Boolean")
+ public void setInline(javax.el.ValueExpression inline) {
+ this.inline = inline;
+ }
+
+ /**
+ * Text value to display as label.
+ * If text contains an underscore the next character is used as accesskey.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute()
+ public void setLabel(javax.el.ValueExpression label) {
+ this.label = label;
+ }
+
+ /**
+ * Flag indicating whether or not this component should be rendered
+ * (during Render Response Phase), or processed on any subsequent form submit.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(type = "java.lang.Boolean", defaultValue = "true")
+ public void setRendered(javax.el.ValueExpression rendered) {
+ this.rendered = rendered;
+ }
+
+ /**
+ * The value binding expression linking this
+ * component to a property in a backing bean.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(type = "javax.faces.component.UIComponent")
+ public void setBinding(javax.el.ValueExpression binding) {
+ this.binding = binding;
+ }
+
+ /**
+ * Text value to display as tooltip.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute()
+ public void setTip(javax.el.ValueExpression tip) {
+ this.tip = tip;
+ }
+
+ /**
+ * The width for the label component. Default: 'fixed'.
+ * This value is used in the gridLayouts columns attribute.
+ * See gridLayout tag for valid values.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute()
+ public void setLabelWidth(javax.el.ValueExpression labelWidth) {
+ this.labelWidth = labelWidth;
+ }
+
+ @TagAttribute
+ @UIComponentTagAttribute(type = "java.lang.Integer")
+ public void setTabIndex(javax.el.ValueExpression tabIndex) {
+ this.tabIndex = tabIndex;
+ }
+
+ /**
+ * Flag indicating this component should recieve the focus.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(type = "java.lang.Boolean")
+ public void setFocus(javax.el.ValueExpression focus) {
+ this.focus = focus;
+ }
+
+ /**
+ * Indicate markup of this component.
+ * Possible value is 'none'. But this can be overridden in the theme.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(defaultValue = "none", type = "java.lang.String[]")
+ public void setMarkup(javax.el.ValueExpression markup) {
+ this.markup = markup;
+ }
+}
\ No newline at end of file
Propchange: myfaces/tobago/trunk/extension/tobago-taglib-extension/src/main/java/org/apache/myfaces/tobago/taglib/extension12/SelectOneChoiceExtensionTag.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/tobago/trunk/extension/tobago-taglib-extension/src/main/java/org/apache/myfaces/tobago/taglib/extension12/SelectOneChoiceExtensionTag.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: myfaces/tobago/trunk/extension/tobago-taglib-extension/src/main/java/org/apache/myfaces/tobago/taglib/extension12/SelectOneListboxExtensionTag.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/extension/tobago-taglib-extension/src/main/java/org/apache/myfaces/tobago/taglib/extension12/SelectOneListboxExtensionTag.java?rev=645313&view=auto
==============================================================================
--- myfaces/tobago/trunk/extension/tobago-taglib-extension/src/main/java/org/apache/myfaces/tobago/taglib/extension12/SelectOneListboxExtensionTag.java (added)
+++ myfaces/tobago/trunk/extension/tobago-taglib-extension/src/main/java/org/apache/myfaces/tobago/taglib/extension12/SelectOneListboxExtensionTag.java Sun Apr 6 14:53:32 2008
@@ -0,0 +1,323 @@
+package org.apache.myfaces.tobago.taglib.extension12;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.apache.myfaces.tobago.apt.annotation.ExtensionTag;
+import org.apache.myfaces.tobago.apt.annotation.Tag;
+import org.apache.myfaces.tobago.apt.annotation.TagAttribute;
+import org.apache.myfaces.tobago.apt.annotation.UIComponentTagAttribute;
+import org.apache.myfaces.tobago.apt.annotation.DynamicExpression;
+import org.apache.myfaces.tobago.internal.taglib.SelectOneListboxTag;
+
+import javax.servlet.jsp.JspException;
+
+/**
+ * Render a single selection option listbox.
+ */
+@Tag(name = "selectOneListbox")
+@ExtensionTag(baseClassName = "org.apache.myfaces.tobago.internal.taglib.SelectOneListboxTag")
+public class SelectOneListboxExtensionTag extends TobagoExtensionBodyTagSupport {
+ private javax.el.ValueExpression required;
+ private javax.el.ValueExpression value;
+ private javax.el.MethodExpression valueChangeListener;
+ private javax.el.ValueExpression disabled;
+ private javax.el.ValueExpression readonly;
+ private javax.el.ValueExpression onchange;
+ //private javax.el.ValueExpression inline;
+ private javax.el.ValueExpression label;
+ private javax.el.ValueExpression rendered;
+ private javax.el.ValueExpression binding;
+ private javax.el.ValueExpression tip;
+ private javax.el.ValueExpression height;
+ private javax.el.ValueExpression converter;
+ private javax.el.MethodExpression validator;
+ private javax.el.ValueExpression labelWidth;
+ private javax.el.ValueExpression tabIndex;
+ private javax.el.ValueExpression focus;
+
+ private LabelExtensionTag labelTag;
+ private SelectOneListboxTag selectOneListboxTag;
+
+ @Override
+ public int doStartTag() throws JspException {
+
+ labelTag = new LabelExtensionTag();
+ labelTag.setPageContext(pageContext);
+ labelTag.setRows("*");
+ if (label != null) {
+ labelTag.setValue(label);
+ }
+ if (tip != null) {
+ labelTag.setTip(tip);
+ }
+ if (rendered != null) {
+ labelTag.setRendered(rendered);
+ }
+ if (labelWidth != null) {
+ labelTag.setColumns(createStringValueExpression(labelWidth.getExpressionString() + ";*"));
+ }
+ labelTag.setParent(getParent());
+ labelTag.doStartTag();
+
+ selectOneListboxTag = new SelectOneListboxTag();
+ selectOneListboxTag.setPageContext(pageContext);
+ if (value != null) {
+ selectOneListboxTag.setValue(value);
+ }
+ if (valueChangeListener != null) {
+ selectOneListboxTag.setValueChangeListener(valueChangeListener);
+ }
+ if (binding != null) {
+ selectOneListboxTag.setBinding(binding);
+ }
+ if (onchange != null) {
+ selectOneListboxTag.setOnchange(onchange);
+ }
+ if (validator != null) {
+ selectOneListboxTag.setValidator(validator);
+ }
+ if (converter != null) {
+ selectOneListboxTag.setConverter(converter);
+ }
+ if (disabled != null) {
+ selectOneListboxTag.setDisabled(disabled);
+ }
+ /*if (inline != null) {
+ selectOneListboxTag.setInline(inline);
+ }*/
+ if (focus != null) {
+ selectOneListboxTag.setFocus(focus);
+ }
+ if (id != null) {
+ selectOneListboxTag.setId(id);
+ }
+ if (height != null) {
+ selectOneListboxTag.setHeight(height);
+ }
+ if (readonly != null) {
+ selectOneListboxTag.setReadonly(readonly);
+ }
+ if (required != null) {
+ selectOneListboxTag.setRequired(required);
+ }
+ if (tabIndex != null) {
+ selectOneListboxTag.setTabIndex(tabIndex);
+ }
+ selectOneListboxTag.setParent(labelTag);
+ selectOneListboxTag.doStartTag();
+
+ return super.doStartTag();
+ }
+
+ @Override
+ public int doEndTag() throws JspException {
+ selectOneListboxTag.doEndTag();
+ labelTag.doEndTag();
+ return super.doEndTag();
+ }
+
+ @Override
+ public void release() {
+ super.release();
+ binding = null;
+ onchange = null;
+ disabled = null;
+ //inline = null;
+ labelWidth = null;
+ label = null;
+ height = null;
+ readonly = null;
+ rendered = null;
+ converter = null;
+ validator = null;
+ required = null;
+ tip = null;
+ value = null;
+ valueChangeListener = null;
+ tabIndex = null;
+ selectOneListboxTag = null;
+ labelTag = null;
+ focus = null;
+ }
+ /**
+ * Flag indicating that a value is required.
+ * If the value is an empty string a
+ * ValidationError occurs and a Error Message is rendered.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(type = "java.lang.Boolean")
+ public void setRequired(javax.el.ValueExpression required) {
+ this.required = required;
+ }
+
+ /**
+ * The current value of this component.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(type = "java.lang.Object")
+ public void setValue(javax.el.ValueExpression value) {
+ this.value = value;
+ }
+
+ /**
+ * MethodBinding representing a value change listener method
+ * that will be notified when a new value has been set for this input component.
+ * The expression must evaluate to a public method that takes a ValueChangeEvent
+ * parameter, with a return type of void.
+ *
+ * @param valueChangeListener
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(
+ type = {},
+ expression = DynamicExpression.METHOD_BINDING_REQUIRED,
+ methodSignature = "javax.faces.event.ValueChangeEvent")
+ public void setValueChangeListener(javax.el.MethodExpression valueChangeListener) {
+ this.valueChangeListener = valueChangeListener;
+ }
+
+ /**
+ * Flag indicating that this element is disabled.
+ */
+ @TagAttribute(type = String.class)
+ @UIComponentTagAttribute(type = "java.lang.Boolean", defaultValue = "false")
+ public void setDisabled(javax.el.ValueExpression disabled) {
+ this.disabled = disabled;
+ }
+
+ /**
+ * Flag indicating that this component will prohibit changes by the user.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(type = "java.lang.Boolean")
+ public void setReadonly(javax.el.ValueExpression readonly) {
+ this.readonly = readonly;
+ }
+
+ /**
+ * Clientside script function to add to this component's onchange handler.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute()
+ public void setOnchange(javax.el.ValueExpression onchange) {
+ this.onchange = onchange;
+ }
+
+/* public void setInline(String inline) {
+ this.inline = inline;
+ }*/
+
+ /**
+ * Text value to display as label.
+ * If text contains an underscore the next character is used as accesskey.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute()
+ public void setLabel(javax.el.ValueExpression label) {
+ this.label = label;
+ }
+
+ public void setHeight(javax.el.ValueExpression height) {
+ this.height = height;
+ }
+
+ /**
+ * A method binding EL expression,
+ * accepting FacesContext, UIComponent,
+ * and Object parameters, and returning void, that validates
+ * the component's local value.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(type = {},
+ expression = DynamicExpression.METHOD_BINDING,
+ methodSignature = { "javax.faces.context.FacesContext", "javax.faces.component.UIComponent", "java.lang.Object" })
+ public void setValidator(javax.el.MethodExpression validator) {
+ this.validator = validator;
+ }
+
+ /**
+ * An expression that specifies the Converter for this component.
+ * If the value binding expression is a String,
+ * the String is used as an ID to look up a Converter.
+ * If the value binding expression is a Converter,
+ * uses that instance as the converter.
+ * The value can either be a static value (ID case only)
+ * or an EL expression.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(type = "javax.faces.convert.Converter",
+ expression = DynamicExpression.VALUE_BINDING)
+ public void setConverter(javax.el.ValueExpression converter) {
+ this.converter = converter;
+ }
+
+ /**
+ * Flag indicating whether or not this component should be rendered
+ * (during Render Response Phase), or processed on any subsequent form submit.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(type = "java.lang.Boolean", defaultValue = "true")
+ public void setRendered(javax.el.ValueExpression rendered) {
+ this.rendered = rendered;
+ }
+
+ /**
+ * The value binding expression linking this
+ * component to a property in a backing bean.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(type = "javax.faces.component.UIComponent")
+ public void setBinding(javax.el.ValueExpression binding) {
+ this.binding = binding;
+ }
+
+ /**
+ * Text value to display as tooltip.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute()
+ public void setTip(javax.el.ValueExpression tip) {
+ this.tip = tip;
+ }
+
+ /**
+ * The width for the label component. Default: 'fixed'.
+ * This value is used in the gridLayouts columns attribute.
+ * See gridLayout tag for valid values.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute()
+ public void setLabelWidth(javax.el.ValueExpression labelWidth) {
+ this.labelWidth = labelWidth;
+ }
+
+ @TagAttribute
+ @UIComponentTagAttribute(type = "java.lang.Integer")
+ public void setTabIndex(javax.el.ValueExpression tabIndex) {
+ this.tabIndex = tabIndex;
+ }
+
+ /**
+ * Flag indicating this component should recieve the focus.
+ */
+ @TagAttribute
+ @UIComponentTagAttribute(type = "java.lang.Boolean")
+ public void setFocus(javax.el.ValueExpression focus) {
+ this.focus = focus;
+ }
+}
\ No newline at end of file
Propchange: myfaces/tobago/trunk/extension/tobago-taglib-extension/src/main/java/org/apache/myfaces/tobago/taglib/extension12/SelectOneListboxExtensionTag.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/tobago/trunk/extension/tobago-taglib-extension/src/main/java/org/apache/myfaces/tobago/taglib/extension12/SelectOneListboxExtensionTag.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL