myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From grantsm...@apache.org
Subject svn commit: r331918 - /myfaces/tomahawk/trunk/src/java/org/apache/myfaces/component/html/ext/HtmlSelectBooleanCheckbox.java
Date Tue, 08 Nov 2005 22:54:00 GMT
Author: grantsmith
Date: Tue Nov  8 14:53:58 2005
New Revision: 331918

URL: http://svn.apache.org/viewcvs?rev=331918&view=rev
Log:
Implemented escape attribute for HtmlSelectBooleanCheckbox tomahawk component. MYFACES-407

Modified:
    myfaces/tomahawk/trunk/src/java/org/apache/myfaces/component/html/ext/HtmlSelectBooleanCheckbox.java

Modified: myfaces/tomahawk/trunk/src/java/org/apache/myfaces/component/html/ext/HtmlSelectBooleanCheckbox.java
URL: http://svn.apache.org/viewcvs/myfaces/tomahawk/trunk/src/java/org/apache/myfaces/component/html/ext/HtmlSelectBooleanCheckbox.java?rev=331918&r1=331917&r2=331918&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/src/java/org/apache/myfaces/component/html/ext/HtmlSelectBooleanCheckbox.java
(original)
+++ myfaces/tomahawk/trunk/src/java/org/apache/myfaces/component/html/ext/HtmlSelectBooleanCheckbox.java
Tue Nov  8 14:53:58 2005
@@ -18,6 +18,7 @@
 import org.apache.myfaces.component.UserRoleAware;
 import org.apache.myfaces.component.UserRoleUtils;
 import org.apache.myfaces.component.DisplayValueOnlyCapable;
+import org.apache.myfaces.component.EscapeCapable;
 import org.apache.myfaces.component.html.util.HtmlComponentUtils;
 
 import javax.faces.context.FacesContext;
@@ -29,8 +30,10 @@
  */
 public class HtmlSelectBooleanCheckbox
         extends javax.faces.component.html.HtmlSelectBooleanCheckbox
-        implements UserRoleAware, DisplayValueOnlyCapable
+        implements UserRoleAware, DisplayValueOnlyCapable, EscapeCapable
 {
+
+
     public String getClientId(FacesContext context)
     {
         String clientId = HtmlComponentUtils.getClientId(this, getRenderer(context), context);
@@ -46,12 +49,14 @@
 
     public static final String COMPONENT_TYPE = "org.apache.myfaces.HtmlSelectBooleanCheckbox";
     private static final boolean DEFAULT_DISPLAYVALUEONLY = false;
-
+    private static final boolean DEFAULT_ESCAPE = true;
+    
     private String _enabledOnUserRole = null;
     private String _visibleOnUserRole = null;
     private Boolean _displayValueOnly = null;
 	private String _displayValueOnlyStyle = null;
 	private String _displayValueOnlyStyleClass = null;
+    private Boolean _escape = null;
 
     public HtmlSelectBooleanCheckbox()
     {
@@ -87,7 +92,7 @@
         ValueBinding vb = getValueBinding("displayValueOnly");
         Boolean v = vb != null ? (Boolean)vb.getValue(getFacesContext()) : null;
         return v != null;
-    }    
+    }
 
     public boolean isDisplayValueOnly() {
         if (_displayValueOnly != null) return _displayValueOnly.booleanValue();
@@ -120,7 +125,18 @@
         _displayValueOnlyStyleClass = displayValueOnlyStyleClass;
     }
 
+public void setEscape(boolean escape)
+    {
+        _escape = Boolean.valueOf(escape);
+    }
 
+    public boolean isEscape()
+    {
+        if (_escape != null) return _escape.booleanValue();
+        ValueBinding vb = getValueBinding("escape");
+        Boolean v = vb != null ? (Boolean)vb.getValue(getFacesContext()) : null;
+        return v != null ? v.booleanValue() : DEFAULT_ESCAPE;
+    }
     public boolean isRendered()
     {
         if (!UserRoleUtils.isVisibleOnUserRole(this)) return false;



Mime
View raw message