myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bom...@apache.org
Subject svn commit: r501446 - in /myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago: component/ taglib/component/ taglib/extension/
Date Tue, 30 Jan 2007 16:22:18 GMT
Author: bommel
Date: Tue Jan 30 08:22:17 2007
New Revision: 501446

URL: http://svn.apache.org/viewvc?view=rev&rev=501446
Log:
(TOBAGO-215) markup attribute for all input components (selectBooleanCheckbox)

Added:
    myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/UISelectBoolean.java
Modified:
    myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/ComponentUtil.java
    myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/SelectBooleanCheckboxTag.java
    myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/SelectBooleanCheckboxTagDeclaration.java
    myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/extension/SelectBooleanCheckboxExtensionTag.java

Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/ComponentUtil.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/ComponentUtil.java?view=diff&rev=501446&r1=501445&r2=501446
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/ComponentUtil.java
(original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/ComponentUtil.java
Tue Jan 30 08:22:17 2007
@@ -65,7 +65,6 @@
 import javax.faces.component.UIGraphic;
 import javax.faces.component.UIOutput;
 import javax.faces.component.UIParameter;
-import javax.faces.component.UISelectBoolean;
 import javax.faces.component.UISelectItem;
 import javax.faces.component.UISelectItems;
 import javax.faces.component.ValueHolder;

Added: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/UISelectBoolean.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/UISelectBoolean.java?view=auto&rev=501446
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/UISelectBoolean.java
(added)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/UISelectBoolean.java
Tue Jan 30 08:22:17 2007
@@ -0,0 +1,58 @@
+package org.apache.myfaces.tobago.component;
+
+/*
+ * 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 javax.faces.context.FacesContext;
+
+/*
+ * Created by IntelliJ IDEA.
+ * User: bommel
+ * Date: Jan 30, 2007
+ * Time: 8:16:45 AM
+ */
+public class UISelectBoolean extends javax.faces.component.UISelectBoolean implements SupportsMarkup
{
+
+  public static final String COMPONENT_TYPE = "org.apache.myfaces.tobago.SelectBoolean";
+
+  private String[] markup;
+
+  public void restoreState(FacesContext context, Object state) {
+    Object[] values = (Object[]) state;
+    super.restoreState(context, values[0]);
+    markup = (String[]) values[1];
+  }
+
+  public Object saveState(FacesContext context) {
+    Object[] values = new Object[2];
+    values[0] = super.saveState(context);
+    values[1] = markup;
+    return values;
+  }
+
+  public String[] getMarkup() {
+    if (markup != null) {
+      return markup;
+    }
+    return ComponentUtil.getMarkupBinding(getFacesContext(), this);
+  }
+
+  public void setMarkup(String[] markup) {
+    this.markup = markup;
+  }
+
+}

Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/SelectBooleanCheckboxTag.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/SelectBooleanCheckboxTag.java?view=diff&rev=501446&r1=501445&r2=501446
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/SelectBooleanCheckboxTag.java
(original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/SelectBooleanCheckboxTag.java
Tue Jan 30 08:22:17 2007
@@ -17,12 +17,34 @@
  * limitations under the License.
  */
 
-import javax.faces.component.UISelectBoolean;
+import org.apache.myfaces.tobago.component.ComponentUtil;
+
+import org.apache.myfaces.tobago.component.UISelectBoolean;
+import javax.faces.component.UIComponent;
 
 public class SelectBooleanCheckboxTag extends InputTag
     implements org.apache.myfaces.tobago.taglib.component.SelectBooleanCheckboxTagDeclaration
{
 
+  private String markup;
+
+  @Override
+  public void release() {
+    super.release();
+    markup = null;
+  }
+
+  @Override
+  protected void setProperties(UIComponent component) {
+    super.setProperties(component);
+    ComponentUtil.setMarkup(component, markup);
+  }
+
   public String getComponentType() {
     return UISelectBoolean.COMPONENT_TYPE;
   }
+
+  public void setMarkup(String markup) {
+    this.markup = markup;
+  }
+
 }

Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/SelectBooleanCheckboxTagDeclaration.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/SelectBooleanCheckboxTagDeclaration.java?view=diff&rev=501446&r1=501445&r2=501446
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/SelectBooleanCheckboxTagDeclaration.java
(original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/SelectBooleanCheckboxTagDeclaration.java
Tue Jan 30 08:22:17 2007
@@ -30,6 +30,7 @@
 import org.apache.myfaces.tobago.taglib.decl.IsDisabled;
 import org.apache.myfaces.tobago.taglib.decl.IsInline;
 import org.apache.myfaces.tobago.taglib.decl.IsReadonly;
+import org.apache.myfaces.tobago.taglib.decl.HasMarkup;
 
 /*
  * Created: Aug 5, 2005 5:18:50 PM
@@ -42,10 +43,10 @@
 @Tag(name = "selectBooleanCheckbox")
 @BodyContentDescription(anyTagOf = "<f:facet>* ")
 @UIComponentTag(
-    uiComponent = "javax.faces.component.UISelectBoolean",
-    rendererType = "SelectBooleanCheckbox", isComponentAlreadyDefined = true)
+    uiComponent = "org.apache.myfaces.tobago.component.UISelectBoolean",
+    rendererType = "SelectBooleanCheckbox")
 public interface SelectBooleanCheckboxTagDeclaration extends BeanTagDeclaration, HasValidator,
     HasOnchange, HasValueChangeListener, HasIdBindingAndRendered, HasLabelAndAccessKey, HasBooleanValue,
IsDisabled,
-    IsInline, HasTip, IsReadonly {
+    IsInline, HasTip, IsReadonly, HasMarkup {
 
 }

Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/extension/SelectBooleanCheckboxExtensionTag.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/extension/SelectBooleanCheckboxExtensionTag.java?view=diff&rev=501446&r1=501445&r2=501446
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/extension/SelectBooleanCheckboxExtensionTag.java
(original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/extension/SelectBooleanCheckboxExtensionTag.java
Tue Jan 30 08:22:17 2007
@@ -28,6 +28,7 @@
 import org.apache.myfaces.tobago.taglib.decl.HasValidator;
 import org.apache.myfaces.tobago.taglib.decl.IsReadonly;
 import org.apache.myfaces.tobago.taglib.decl.HasLabelWidth;
+import org.apache.myfaces.tobago.taglib.decl.HasMarkup;
 import org.apache.myfaces.tobago.taglib.component.SelectBooleanCheckboxTag;
 import org.apache.myfaces.tobago.taglib.component.TobagoTagDeclaration;
 
@@ -46,7 +47,7 @@
 @Tag(name = "selectBooleanCheckbox")
 public class SelectBooleanCheckboxExtensionTag extends BodyTagSupport implements TobagoTagDeclaration,

     HasValidator, HasOnchange, HasValueChangeListener, HasIdBindingAndRendered, HasLabel,
-    HasBooleanValue, HasLabelWidth, IsDisabled, HasTip, IsReadonly {
+    HasBooleanValue, HasLabelWidth, IsDisabled, HasTip, IsReadonly, HasMarkup {
 
   private String value;
   private String valueChangeListener;
@@ -60,6 +61,7 @@
   private String converter;
   private String validator;
   private String labelWidth;
+  private String markup;
 
   private LabelExtensionTag labelTag;
   private SelectBooleanCheckboxTag selectBooleanCheckboxTag;
@@ -126,6 +128,10 @@
     //if (required != null) {
     //  selectBooleanCheckboxTag.setRequired(required);
     //}
+
+    if (markup != null) {
+      selectBooleanCheckboxTag.setMarkup(markup);
+    }
     selectBooleanCheckboxTag.setParent(labelTag);
     selectBooleanCheckboxTag.doStartTag();
 
@@ -154,6 +160,7 @@
     tip = null;
     value = null;
     valueChangeListener = null;
+    markup = null;
   }
 
   public void setValue(String value) {
@@ -203,6 +210,10 @@
 
   public void setLabelWidth(String labelWidth) {
     this.labelWidth = labelWidth;
+  }
+
+  public void setMarkup(String markup) {
+    this.markup = markup;
   }
 
 }



Mime
View raw message