[pal-cvs 2218] [27] added toStringFrom* methods.

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2007年 4月 9日 (月) 07:24:00 JST


Revision: 27
          http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=pal&view=rev&rev=27
Author:   shinsuke
Date:     2007-04-09 07:24:00 +0900 (Mon, 09 Apr 2007)

Log Message:
-----------
added toStringFrom* methods.

Modified Paths:
--------------
    pal-admin/trunk/src/main/java/jp/sf/pal/admin/util/PALAdminUtil.java
    pal-admin/trunk/src/main/java/jp/sf/pal/admin/web/user/UserGroupEditPage.java


-------------- next part --------------
Modified: pal-admin/trunk/src/main/java/jp/sf/pal/admin/util/PALAdminUtil.java
===================================================================
--- pal-admin/trunk/src/main/java/jp/sf/pal/admin/util/PALAdminUtil.java	2007-04-08 22:08:54 UTC (rev 26)
+++ pal-admin/trunk/src/main/java/jp/sf/pal/admin/util/PALAdminUtil.java	2007-04-08 22:24:00 UTC (rev 27)
@@ -56,4 +56,32 @@
         }
         return list;
     }
+
+    public static String toStringFromList(List<String> list)
+    {
+        StringBuffer buf = new StringBuffer();
+        for (Iterator<String> ite = list.iterator(); ite.hasNext();)
+        {
+            buf.append(ite.next());
+            if (ite.hasNext())
+            {
+                buf.append(", ");
+            }
+        }
+        return buf.toString();
+    }
+
+    public static String toStringFromArray(String[] strs)
+    {
+        StringBuffer buf = new StringBuffer();
+        for (int i = 0; i < strs.length; i++)
+        {
+            buf.append(strs[i]);
+            if (i + 1 < strs.length)
+            {
+                buf.append(", ");
+            }
+        }
+        return buf.toString();
+    }
 }

Modified: pal-admin/trunk/src/main/java/jp/sf/pal/admin/web/user/UserGroupEditPage.java
===================================================================
--- pal-admin/trunk/src/main/java/jp/sf/pal/admin/web/user/UserGroupEditPage.java	2007-04-08 22:08:54 UTC (rev 26)
+++ pal-admin/trunk/src/main/java/jp/sf/pal/admin/web/user/UserGroupEditPage.java	2007-04-08 22:24:00 UTC (rev 27)
@@ -7,6 +7,7 @@
 
 import jp.sf.pal.admin.PALAdminException;
 import jp.sf.pal.admin.service.UserManagementService;
+import jp.sf.pal.admin.util.PALAdminUtil;
 import jp.sf.pal.admin.web.AbstractCrudPage;
 
 import org.seasar.framework.log.Logger;
@@ -193,7 +194,8 @@
         {
             getUserManagementService().removeGroupsFromUser(this);
             FacesMessageUtil.addInfoMessage("removed.groups.from.user",
-                    new Object[] { getName(), getGroups().toString() });
+                    new Object[] { getName(),
+                            PALAdminUtil.toStringFromArray(getGroups()) });
 
             // clear
             setGroups(null);


pal-cvs メーリングリストの案内
Back to archive index