001/**
002 * Copyright 2005-2016 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 */
016package org.kuali.rice.krad.uif.container;
017
018/**
019 * Special <code>Group</code> that presents a grouping on links, which can
020 * also include nested groupings of links
021 *
022 * <p>
023 * Generally this group outputs a list of <code>LinkField</code> instances, however
024 * it can be configured to place separates between the fields and also delimiters
025 * for the grouping
026 * </p>
027 *
028 * @author Kuali Rice Team (rice.collab@kuali.org)
029 */
030public class LinkGroup extends Group {
031    private static final long serialVersionUID = -4173031543626881250L;
032
033    private String groupBeginDelimiter;
034    private String groupEndDelimiter;
035    private String linkSeparator;
036    private String emptyLinkGroupString;
037
038    public LinkGroup() {
039        super();
040    }
041
042    /**
043     * String that will be rendered before the group of links are rendered
044     *
045     * <p>
046     * If the list of links is empty, the start delimiter will not be
047     * rendered but instead the #emptyLinkGroupString will be outputted
048     * </p>
049     *
050     * e.g. '['
051     *
052     * @return String group begin delimiter
053     */
054    public String getGroupBeginDelimiter() {
055        return groupBeginDelimiter;
056    }
057
058    /**
059     * Setter for the group begin delimiter
060     *
061     * @param groupBeginDelimiter
062     */
063    public void setGroupBeginDelimiter(String groupBeginDelimiter) {
064        this.groupBeginDelimiter = groupBeginDelimiter;
065    }
066
067    /**
068     * String that will be rendered after the group of links are rendered
069     *
070     * <p>
071     * If the list of links is empty, the end delimiter will not be
072     * rendered but instead the #emptyLinkGroupString will be outputted
073     * </p>
074     *
075     * e.g. ']'
076     *
077     * @return String group end delimiter
078     */
079    public String getGroupEndDelimiter() {
080        return groupEndDelimiter;
081    }
082
083    /**
084     * Setter for the group end delimiter
085     *
086     * @param groupEndDelimiter
087     */
088    public void setGroupEndDelimiter(String groupEndDelimiter) {
089        this.groupEndDelimiter = groupEndDelimiter;
090    }
091
092    /**
093     * String that will be rendered between each rendered link
094     *
095     * e.g. '|'
096     *
097     * @return String link separator
098     */
099    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}