struts-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From musa...@apache.org
Subject svn commit: r752222 - in /struts/sandbox/trunk/struts2-jquery-plugin/src: main/java/org/apache/struts2/jquery/components/ main/java/org/apache/struts2/jquery/views/jsp/ui/ main/resources/template/jquery-simple/ site/docs/
Date Tue, 10 Mar 2009 19:27:09 GMT
Author: musachy
Date: Tue Mar 10 19:27:09 2009
New Revision: 752222

URL: http://svn.apache.org/viewvc?rev=752222&view=rev
Log:
Add changeMonth and changeYear attributes

Modified:
    struts/sandbox/trunk/struts2-jquery-plugin/src/main/java/org/apache/struts2/jquery/components/JQueryDatepicker.java
    struts/sandbox/trunk/struts2-jquery-plugin/src/main/java/org/apache/struts2/jquery/views/jsp/ui/JQueryDatepickerTag.java
    struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery-simple/datepicker.ftl
    struts/sandbox/trunk/struts2-jquery-plugin/src/site/docs/datepicker.html

Modified: struts/sandbox/trunk/struts2-jquery-plugin/src/main/java/org/apache/struts2/jquery/components/JQueryDatepicker.java
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-jquery-plugin/src/main/java/org/apache/struts2/jquery/components/JQueryDatepicker.java?rev=752222&r1=752221&r2=752222&view=diff
==============================================================================
--- struts/sandbox/trunk/struts2-jquery-plugin/src/main/java/org/apache/struts2/jquery/components/JQueryDatepicker.java
(original)
+++ struts/sandbox/trunk/struts2-jquery-plugin/src/main/java/org/apache/struts2/jquery/components/JQueryDatepicker.java
Tue Mar 10 19:27:09 2009
@@ -57,6 +57,8 @@
     private String imageUrl;
     private String imageTooltip;
     private String options;
+    private String changeYear;
+    private String changeMonth;
 
     public JQueryDatepicker(ValueStack stack, HttpServletRequest request, HttpServletResponse
response) {
         super(stack, request, response);
@@ -79,6 +81,16 @@
         else
             addParameter("imageTooltip", "Pick a date");
 
+        if (this.changeMonth != null)
+            addParameter("changeMonth", findString(this.changeMonth));
+        else
+            addParameter("changeMonth", "true");
+
+        if (this.changeYear != null)
+            addParameter("changeYear", findString(this.changeYear));
+        else
+            addParameter("changeYear", "true");
+
         if (this.options != null) {
             String ops = findString(this.options);
             if (TextUtils.stringSet(ops))
@@ -166,6 +178,7 @@
     public static void main(String[] s) {
         System.out.print(SimpleDateFormat.getDateInstance(DateFormat.SHORT).format(new Date()));
     }
+
     protected String getDefaultTemplate() {
         return TEMPLATE;
     }
@@ -196,4 +209,14 @@
     public void setOptions(String options) {
         this.options = options;
     }
+
+    @StrutsTagAttribute(description = "Allows you to change the month by selecting from a
drop-down list", type = "Boolean", defaultValue = "true")
+    public void setChangeMonth(String changeMonth) {
+        this.changeMonth = changeMonth;
+    }
+
+    @StrutsTagAttribute(description = "Allows you to change the year by selecting from a
drop-down list", type = "Boolean", defaultValue = "true")
+    public void setChangeYear(String changeYear) {
+        this.changeYear = changeYear;
+    }
 }

Modified: struts/sandbox/trunk/struts2-jquery-plugin/src/main/java/org/apache/struts2/jquery/views/jsp/ui/JQueryDatepickerTag.java
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-jquery-plugin/src/main/java/org/apache/struts2/jquery/views/jsp/ui/JQueryDatepickerTag.java?rev=752222&r1=752221&r2=752222&view=diff
==============================================================================
--- struts/sandbox/trunk/struts2-jquery-plugin/src/main/java/org/apache/struts2/jquery/views/jsp/ui/JQueryDatepickerTag.java
(original)
+++ struts/sandbox/trunk/struts2-jquery-plugin/src/main/java/org/apache/struts2/jquery/views/jsp/ui/JQueryDatepickerTag.java
Tue Mar 10 19:27:09 2009
@@ -33,6 +33,8 @@
     private String imageUrl;
     private String imageTooltip;
     private String options;
+    private String changeYear;
+    private String changeMonth;
 
     public Component getBean(ValueStack stack, HttpServletRequest req, HttpServletResponse
res) {
         return new JQueryDatepicker(stack, req, res);
@@ -45,6 +47,8 @@
         picker.setImageTooltip(imageTooltip);
         picker.setImageUrl(imageUrl);
         picker.setOptions(options);
+        picker.setChangeMonth(changeMonth);
+        picker.setChangeYear(changeYear);
     }
 
     public void setDisplayFormat(String displayFormat) {
@@ -62,4 +66,12 @@
     public void setOptions(String options) {
         this.options = options;
     }
+
+    public void setChangeYear(String changeYear) {
+        this.changeYear = changeYear;
+    }
+
+    public void setChangeMonth(String changeMonth) {
+        this.changeMonth = changeMonth;
+    }
 }

Modified: struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery-simple/datepicker.ftl
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery-simple/datepicker.ftl?rev=752222&r1=752221&r2=752222&view=diff
==============================================================================
--- struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery-simple/datepicker.ftl
(original)
+++ struts/sandbox/trunk/struts2-jquery-plugin/src/main/resources/template/jquery-simple/datepicker.ftl
Tue Mar 10 19:27:09 2009
@@ -71,7 +71,9 @@
             </#if>
             buttonImageOnly: true,
             showOn: "both",
-            buttonText: "${parameters.imageTooltip}"
+            buttonText: "${parameters.imageTooltip}",
+            changeMonth: ${parameters.changeMonth},
+            changeYear: ${parameters.changeYear}
         };
 
         <#if parameters.options??>

Modified: struts/sandbox/trunk/struts2-jquery-plugin/src/site/docs/datepicker.html
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-jquery-plugin/src/site/docs/datepicker.html?rev=752222&r1=752221&r2=752222&view=diff
==============================================================================
--- struts/sandbox/trunk/struts2-jquery-plugin/src/site/docs/datepicker.html (original)
+++ struts/sandbox/trunk/struts2-jquery-plugin/src/site/docs/datepicker.html Tue Mar 10 19:27:09
2009
@@ -42,6 +42,22 @@
 					<td align="left" valign="top">Set the html accesskey attribute on rendered html
element</td>
 				</tr>
 				<tr>
+					<td align="left" valign="top">changeMonth</td>
+					<td align="left" valign="top">false</td>
+					<td align="left" valign="top">true</td>
+					<td align="left" valign="top">false</td>
+					<td align="left" valign="top">Boolean</td>
+					<td align="left" valign="top">Allows you to change the month by selecting from
a drop-down list</td>
+				</tr>
+				<tr>
+					<td align="left" valign="top">changeYear</td>
+					<td align="left" valign="top">false</td>
+					<td align="left" valign="top">true</td>
+					<td align="left" valign="top">false</td>
+					<td align="left" valign="top">Boolean</td>
+					<td align="left" valign="top">Allows you to change the year by selecting from
a drop-down list</td>
+				</tr>
+				<tr>
 					<td align="left" valign="top">cssClass</td>
 					<td align="left" valign="top">false</td>
 					<td align="left" valign="top"></td>



Mime
View raw message