empire-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From doeb...@apache.org
Subject svn commit: r707636 - in /incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2: html/DefaultHtmlTagDictionary.java html/HtmlTagDictionary.java jsp/components/InputControlComponent.java jsp/tags/InputControlTag.java
Date Fri, 24 Oct 2008 13:59:25 GMT
Author: doebele
Date: Fri Oct 24 06:59:25 2008
New Revision: 707636

URL: http://svn.apache.org/viewvc?rev=707636&view=rev
Log:
EMPIREDB-26

Modified:
    incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/html/DefaultHtmlTagDictionary.java
    incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/html/HtmlTagDictionary.java
    incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/jsp/components/InputControlComponent.java
    incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/jsp/tags/InputControlTag.java

Modified: incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/html/DefaultHtmlTagDictionary.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/html/DefaultHtmlTagDictionary.java?rev=707636&r1=707635&r2=707636&view=diff
==============================================================================
--- incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/html/DefaultHtmlTagDictionary.java
(original)
+++ incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/html/DefaultHtmlTagDictionary.java
Fri Oct 24 06:59:25 2008
@@ -151,6 +151,12 @@
         return null; // e.g. "<div class=\"clearBoth\"><!-- ? --></div>"
     }
 
+    @Override 
+    public String InputDefaultClass(String type, boolean disabled)
+    {
+        return null;
+    }
+    
     // ------- Anchor -------
     
     @Override

Modified: incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/html/HtmlTagDictionary.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/html/HtmlTagDictionary.java?rev=707636&r1=707635&r2=707636&view=diff
==============================================================================
--- incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/html/HtmlTagDictionary.java
(original)
+++ incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/html/HtmlTagDictionary.java
Fri Oct 24 06:59:25 2008
@@ -86,6 +86,8 @@
     public abstract String InputControlClass();
     public abstract String InputReadOnlyClass();
     public abstract String InputReadOnlyDataWrapperTag();
+    
+    public abstract String InputDefaultClass(String type, boolean disabled);
 
     // ------- Anchor -------
     public abstract String AnchorDisabledTag();

Modified: incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/jsp/components/InputControlComponent.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/jsp/components/InputControlComponent.java?rev=707636&r1=707635&r2=707636&view=diff
==============================================================================
--- incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/jsp/components/InputControlComponent.java
(original)
+++ incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/jsp/components/InputControlComponent.java
Fri Oct 24 06:59:25 2008
@@ -97,7 +97,6 @@
     protected void render(HtmlWriter writer, String body, InputControl control)
     {
         HtmlTagDictionary dic = HtmlTagDictionary.getInstance();
-        
         // Check Render Type
         if (renderType==RenderType.HIDDEN)
         {   // Render Hidden input
@@ -176,7 +175,8 @@
                 }
                 else
                 {   // Render Input as Control
-                    wrapCtrl.addAttribute("class", dic.InputControlClass());
+                    String wrapClass = (getDisabled() ? dic.InputReadOnlyClass() : dic.InputControlClass());
  
+                    wrapCtrl.addAttribute("class", wrapClass);
                     wrapCtrl.beginBody();
                     control.renderInput(writer, this);
                 }

Modified: incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/jsp/tags/InputControlTag.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/jsp/tags/InputControlTag.java?rev=707636&r1=707635&r2=707636&view=diff
==============================================================================
--- incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/jsp/tags/InputControlTag.java
(original)
+++ incubator/empire-db/trunk/struts2-ext/Empire-struts2-ext/src/org/apache/empire/struts2/jsp/tags/InputControlTag.java
Fri Oct 24 06:59:25 2008
@@ -26,6 +26,7 @@
 import org.apache.empire.commons.StringUtils;
 import org.apache.empire.data.Column;
 import org.apache.empire.data.Record;
+import org.apache.empire.struts2.html.HtmlTagDictionary;
 import org.apache.empire.struts2.jsp.components.InputControlComponent;
 import org.apache.empire.struts2.jsp.controls.InputControl;
 import org.apache.empire.struts2.jsp.controls.InputControlManager;
@@ -99,6 +100,12 @@
         // Detect control type and readOnly state
         if (controlType==null)
             controlType = getControlType();
+        // Default Class
+        if (cssClass==null)
+        {
+            HtmlTagDictionary dic = HtmlTagDictionary.getInstance();
+            cssClass = dic.InputDefaultClass(controlType, isReadOnly());             
+        }
         // Create
         InputControl control = InputControlManager.getControl(controlType);
         if (control == null)
@@ -109,7 +116,7 @@
 
     @Override
     protected void populateParams()
-    {
+    {       
         super.populateParams();
         
         if (disabledMode==null)



Mime
View raw message