struts-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lukaszlen...@apache.org
Subject [02/12] git commit: Adds additional field to allow set label key used in I18N lookup
Date Fri, 27 Jun 2014 11:06:47 GMT
Adds additional field to allow set label key used in I18N lookup


Project: http://git-wip-us.apache.org/repos/asf/struts/repo
Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/90189362
Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/90189362
Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/90189362

Branch: refs/heads/feature/WW-4295-localization
Commit: 901893628b31ee3b38b2fc9196045a097a0f4217
Parents: 7f586d3
Author: Lukasz Lenart <lukaszlenart@apache.org>
Authored: Thu Mar 20 08:08:03 2014 +0100
Committer: Lukasz Lenart <lukaszlenart@apache.org>
Committed: Thu Mar 20 08:08:03 2014 +0100

----------------------------------------------------------------------
 .../java/org/apache/struts2/components/ListUIBean.java   | 11 +++++++++++
 .../org/apache/struts2/views/jsp/ui/AbstractListTag.java |  6 ++++++
 2 files changed, 17 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/struts/blob/90189362/core/src/main/java/org/apache/struts2/components/ListUIBean.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/struts2/components/ListUIBean.java b/core/src/main/java/org/apache/struts2/components/ListUIBean.java
index b1a4493..11e59aa 100644
--- a/core/src/main/java/org/apache/struts2/components/ListUIBean.java
+++ b/core/src/main/java/org/apache/struts2/components/ListUIBean.java
@@ -49,6 +49,7 @@ public abstract class ListUIBean extends UIBean {
     protected Object list;
     protected String listKey;
     protected String listValue;
+    protected String listLabelKey;
     protected String listCssClass;
     protected String listCssStyle;
     protected String listTitle;
@@ -115,6 +116,11 @@ public abstract class ListUIBean extends UIBean {
             addParameter("listValue", "value");
         }
 
+        if (listLabelKey != null) {
+            listLabelKey = stripExpressionIfAltSyntax(listLabelKey);
+            addParameter("listLabelKey", listLabelKey);
+        }
+
         if (listCssClass != null && listCssClass.trim().length() > 0) {
             addParameter("listCssClass", listCssClass);
         }
@@ -152,6 +158,11 @@ public abstract class ListUIBean extends UIBean {
         this.listValue = listValue;
     }
 
+    @StrutsTagAttribute(description = "Property of list objects to be used to lookup for
localised version of field label")
+    public void setListLabelKey(String listLabelKey) {
+        this.listLabelKey = listLabelKey;
+    }
+
     @StrutsTagAttribute(description = "Property of list objects to get css class from")
     public void setListCssClass(String listCssClass) {
         this.listCssClass = listCssClass;

http://git-wip-us.apache.org/repos/asf/struts/blob/90189362/core/src/main/java/org/apache/struts2/views/jsp/ui/AbstractListTag.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/struts2/views/jsp/ui/AbstractListTag.java b/core/src/main/java/org/apache/struts2/views/jsp/ui/AbstractListTag.java
index 1f2ebb4..4972ff0 100644
--- a/core/src/main/java/org/apache/struts2/views/jsp/ui/AbstractListTag.java
+++ b/core/src/main/java/org/apache/struts2/views/jsp/ui/AbstractListTag.java
@@ -29,6 +29,7 @@ public abstract class AbstractListTag extends AbstractUITag {
     protected String list;
     protected String listKey;
     protected String listValue;
+    protected String listLabelKey;
     protected String listCssClass;
     protected String listCssStyle;
     protected String listTitle;
@@ -40,6 +41,7 @@ public abstract class AbstractListTag extends AbstractUITag {
         listUIBean.setList(list);
         listUIBean.setListKey(listKey);
         listUIBean.setListValue(listValue);
+        listUIBean.setListLabelKey(listLabelKey);
         listUIBean.setListCssClass(listCssClass);
         listUIBean.setListCssStyle(listCssStyle);
         listUIBean.setListTitle(listTitle);
@@ -57,6 +59,10 @@ public abstract class AbstractListTag extends AbstractUITag {
         this.listValue = listValue;
     }
 
+    public void setListLabelKey(String listLabelKey) {
+        this.listLabelKey = listLabelKey;
+    }
+
     public void setListCssClass(String listCssClass) {
         this.listCssClass = listCssClass;
     }


Mime
View raw message