Changeset 3930
- Timestamp:
- Nov 1, 2010, 11:19:04 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/client/servlet/src/org/proteios/gui/form/FormFactory.java
r3929 r3930 3656 3656 if (this.sc == null) 3657 3657 this.sc = sc; 3658 } 3659 3660 /** 3661 * Converts a list String to a list with String elements. If the list string 3662 * contains two delimiter strings directly after each other, an empty string 3663 * element will be added to the list in the corresponding place. Example: 3664 * List string "one, two, three" will be converted to a list with the three 3665 * String elements "one", "two", and "three" using delimiter regular 3666 * expression ",\\ ". 3667 * 3668 * @param listString String A string with a list 3669 * @param delimiterRegex String A regular expression for the delimiter 3670 * between list elements 3671 * @return List<String> A list of String elements 3672 */ 3673 private List<String> listStringToStringList(String listString, 3674 String delimiterRegex) 3675 { 3676 List<String> stringList = null; 3677 if (listString != null) 3678 { 3679 stringList = new ArrayList<String>(0); 3680 for (String part : listString.split(delimiterRegex, -1)) 3681 { 3682 // Add list part if not already in list 3683 if (part != null && !stringList.contains(part)) 3684 { 3685 stringList.add(part); 3686 } 3687 } 3688 } 3689 return stringList; 3690 } 3658 } 3691 3659 }
Note: See TracChangeset
for help on using the changeset viewer.