001    /**
002     * Copyright 2005-2013 The Kuali Foundation
003     *
004     * Licensed under the Educational Community License, Version 2.0 (the "License");
005     * you may not use this file except in compliance with the License.
006     * You may obtain a copy of the License at
007     *
008     * http://www.opensource.org/licenses/ecl2.php
009     *
010     * Unless required by applicable law or agreed to in writing, software
011     * distributed under the License is distributed on an "AS IS" BASIS,
012     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013     * See the License for the specific language governing permissions and
014     * limitations under the License.
015     */
016    package org.kuali.rice.krad.uif.container;
017    
018    import org.kuali.rice.krad.datadictionary.parse.BeanTag;
019    import org.kuali.rice.krad.datadictionary.parse.BeanTagAttribute;
020    import org.kuali.rice.krad.datadictionary.parse.BeanTags;
021    
022    /**
023     * Special <code>Group</code> that presents a grouping on links, which can
024     * also include nested groupings of links
025     *
026     * <p>
027     * Generally this group outputs a list of <code>LinkField</code> instances, however
028     * it can be configured to place separates between the fields and also delimiters
029     * for the grouping
030     * </p>
031     *
032     * @author Kuali Rice Team (rice.collab@kuali.org)
033     */
034    @BeanTags({@BeanTag(name = "linkGroup-bean", parent = "Uif-LinkGroup"),
035            @BeanTag(name = "linkSubGroup-bean", parent = "Uif-LinkSubGroup"),
036            @BeanTag(name = "lookupView-resultActions-bean", parent = "Uif-LookupView-ResultActions")})
037    public class LinkGroup extends Group {
038        private static final long serialVersionUID = -4173031543626881250L;
039    
040        private String groupBeginDelimiter;
041        private String groupEndDelimiter;
042        private String linkSeparator;
043        private String emptyLinkGroupString;
044    
045        public LinkGroup() {
046            super();
047        }
048    
049        /**
050         * String that will be rendered before the group of links are rendered
051         *
052         * <p>
053         * If the list of links is empty, the start delimiter will not be
054         * rendered but instead the #emptyLinkGroupString will be outputted
055         * </p>
056         *
057         * e.g. '['
058         *
059         * @return String group begin delimiter
060         */
061        @BeanTagAttribute(name = "groupBeginDelimiter")
062        public String getGroupBeginDelimiter() {
063            return groupBeginDelimiter;
064        }
065    
066        /**
067         * Setter for the group begin delimiter
068         *
069         * @param groupBeginDelimiter
070         */
071        public void setGroupBeginDelimiter(String groupBeginDelimiter) {
072            this.groupBeginDelimiter = groupBeginDelimiter;
073        }
074    
075        /**
076         * String that will be rendered after the group of links are rendered
077         *
078         * <p>
079         * If the list of links is empty, the end delimiter will not be
080         * rendered but instead the #emptyLinkGroupString will be outputted
081         * </p>
082         *
083         * e.g. ']'
084         *
085         * @return String group end delimiter
086         */
087        @BeanTagAttribute(name = "groupEndDelimiter")
088        public String getGroupEndDelimiter() {
089            return groupEndDelimiter;
090        }
091    
092        /**
093         * Setter for the group end delimiter
094         *
095         * @param groupEndDelimiter
096         */
097        public void setGroupEndDelimiter(String groupEndDelimiter) {
098            this.groupEndDelimiter = groupEndDelimiter;
099        }
100    
101        /**
102         * String that will be rendered between each rendered link
103         *
104         * e.g. '|'
105         *
106         * @return String link separator
107         */
108        @BeanTagAttribute(name = "linkSeparator")
109        public String getLinkSeparator() {
110            return linkSeparator;
111        }
112    
113        /**
114         * Setter for the link separator
115         *
116         * @param linkSeparator
117         */
118        public void setLinkSeparator(String linkSeparator) {
119            this.linkSeparator = linkSeparator;
120        }
121    
122        /**
123         * String that will be outputted when the list backing the
124         * link group is empty
125         *
126         * @return String empty group string
127         */
128        @BeanTagAttribute(name = "emptyLinkGroupString")
129        public String getEmptyLinkGroupString() {
130            return emptyLinkGroupString;
131        }
132    
133        /**
134         * Setter for the empty group string
135         *
136         * @param emptyLinkGroupString
137         */
138        public void setEmptyLinkGroupString(String emptyLinkGroupString) {
139            this.emptyLinkGroupString = emptyLinkGroupString;
140        }
141    }