View Javadoc

1   /**
2    * Copyright 2005-2012 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl2.php
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.kuali.rice.krad.uif.container;
17  
18  /**
19   * Special <code>Group</code> that presents a grouping on links, which can
20   * also include nested groupings of links
21   *
22   * <p>
23   * Generally this group outputs a list of <code>LinkField</code> instances, however
24   * it can be configured to place separates between the fields and also delimiters
25   * for the grouping
26   * </p>
27   *
28   * @author Kuali Rice Team (rice.collab@kuali.org)
29   */
30  public class LinkGroup extends Group {
31      private static final long serialVersionUID = -4173031543626881250L;
32  
33      private String groupBeginDelimiter;
34      private String groupEndDelimiter;
35      private String linkSeparator;
36      private String emptyLinkGroupString;
37  
38      public LinkGroup() {
39          super();
40      }
41  
42      /**
43       * String that will be rendered before the group of links are rendered
44       *
45       * <p>
46       * If the list of links is empty, the start delimiter will not be
47       * rendered but instead the #emptyLinkGroupString will be outputted
48       * </p>
49       *
50       * e.g. '['
51       *
52       * @return String group begin delimiter
53       */
54      public String getGroupBeginDelimiter() {
55          return groupBeginDelimiter;
56      }
57  
58      /**
59       * Setter for the group begin delimiter
60       *
61       * @param groupBeginDelimiter
62       */
63      public void setGroupBeginDelimiter(String groupBeginDelimiter) {
64          this.groupBeginDelimiter = groupBeginDelimiter;
65      }
66  
67      /**
68       * String that will be rendered after the group of links are rendered
69       *
70       * <p>
71       * If the list of links is empty, the end delimiter will not be
72       * rendered but instead the #emptyLinkGroupString will be outputted
73       * </p>
74       *
75       * e.g. ']'
76       *
77       * @return String group end delimiter
78       */
79      public String getGroupEndDelimiter() {
80          return groupEndDelimiter;
81      }
82  
83      /**
84       * Setter for the group end delimiter
85       *
86       * @param groupEndDelimiter
87       */
88      public void setGroupEndDelimiter(String groupEndDelimiter) {
89          this.groupEndDelimiter = groupEndDelimiter;
90      }
91  
92      /**
93       * String that will be rendered between each rendered link
94       *
95       * e.g. '|'
96       *
97       * @return String link separator
98       */
99      public String getLinkSeparator() {
100         return linkSeparator;
101     }
102 
103     /**
104      * Setter for the link separator
105      *
106      * @param linkSeparator
107      */
108     public void setLinkSeparator(String linkSeparator) {
109         this.linkSeparator = linkSeparator;
110     }
111 
112     /**
113      * String that will be outputted when the list backing the
114      * link group is empty
115      *
116      * @return String empty group string
117      */
118     public String getEmptyLinkGroupString() {
119         return emptyLinkGroupString;
120     }
121 
122     /**
123      * Setter for the empty group string
124      *
125      * @param emptyLinkGroupString
126      */
127     public void setEmptyLinkGroupString(String emptyLinkGroupString) {
128         this.emptyLinkGroupString = emptyLinkGroupString;
129     }
130 }