View Javadoc
1   /**
2    * Copyright 2005-2016 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.layout;
17  
18  import java.util.List;
19  
20  import org.kuali.rice.krad.uif.container.Group;
21  
22  /**
23   * Layout manager interface for stacked collections. 
24   * 
25   * @author Kuali Rice Team (rice.collab@kuali.org)
26   */
27  public interface StackedLayoutManager extends CollectionLayoutManager {
28  
29      /**
30       * Text to appears in the header for each collection lines Group. Used in
31       * conjunction with {@link #getSummaryFields()} to build up the final header
32       * text
33       *
34       * @return summary title text
35       */
36      String getSummaryTitle();
37  
38      /**
39       * Setter for the summary title text
40       *
41       * @param summaryTitle
42       */
43      void setSummaryTitle(String summaryTitle);
44  
45      /**
46       * List of attribute names from the collection line class that should be
47       * used to build the line summary. To build the summary the value for each
48       * attribute is retrieved from the line instance. All the values are then
49       * placed together with a separator.
50       *
51       * @return summary field names
52       * @see StackedLayoutManagerBase#buildLineHeaderText(Object, org.kuali.rice.krad.uif.container.Group)
53       */
54      List<String> getSummaryFields();
55  
56      /**
57       * Setter for the summary field name list
58       *
59       * @param summaryFields
60       */
61      void setSummaryFields(List<String> summaryFields);
62  
63      /**
64       * Group instance that is used as a prototype for creating the collection
65       * line groups. For each line a copy of the prototype is made and then
66       * adjusted as necessary
67       *
68       * @return Group instance to use as prototype
69       */
70      Group getLineGroupPrototype();
71  
72      /**
73       * Setter for the line group prototype
74       *
75       * @param lineGroupPrototype
76       */
77      void setLineGroupPrototype(Group lineGroupPrototype);
78  
79      /**
80       * Group that will 'wrap' the generated collection lines so that they have a different layout from the general
81       * stacked layout
82       *
83       * <p>
84       * By default (when the wrapper group is null), each collection line will become a group and the groups are
85       * rendered one after another. If the wrapper group is configured, the generated groups will be inserted as the
86       * items for the wrapper group, and the layout manager configured for the wrapper group will determine how they
87       * are rendered. For example, the layout manager could be a grid layout configured for three columns, which would
88       * layout the first three lines horizontally then break to a new row.
89       * </p>
90       *
91       * @return Group instance whose items list should be populated with the generated groups, or null to use the
92       *         default layout
93       */
94      Group getWrapperGroup();
95  
96      /**
97       * Setter for the wrapper group that will receive the generated line groups
98       *
99       * @param wrapperGroup
100      */
101     void setWrapperGroup(Group wrapperGroup);
102 
103     /**
104      * Final {@code List} of Groups to render for the collection
105      *
106      * @return collection groups
107      */
108     List<Group> getStackedGroups();
109 
110     /**
111      * Used by reflection during the lifecycle to get groups for the lifecycle when not using a wrapper group
112      *
113      * <p>There are no references to this method in the code, this is intentional.  DO NOT REMOVE.</p>
114      *
115      * @return the stacked groups, if any
116      */
117     List<Group> getStackedGroupsNoWrapper();
118 
119     /**
120      * Setter for the collection groups
121      *
122      * @param stackedGroups
123      */
124     void setStackedGroups(List<Group> stackedGroups);
125 
126     /**
127      * Flag that indicates whether actions will be added in the same group as the line items instead of in the
128      * footer of the line group
129      *
130      * @return boolean
131      */
132     boolean isRenderLineActionsInLineGroup();
133 
134     /**
135      * Set flag to add actions in the same group as the line items
136      *
137      * @param actionsInLineGroup
138      */
139     void setRenderLineActionsInLineGroup(boolean actionsInLineGroup);
140 
141     /**
142      * When true, actions specified in lineActions will appear to the very right of the header
143      * (appears in the corner of the stacked item) by placing the actions in the Header's rightGroup.
144      *
145      * @return true if rendering actions at the header level, false otherwise
146      */
147     public boolean isRenderLineActionsInHeader();
148 
149     /**
150      * @see StackedLayoutManager#isRenderLineActionsInHeader()
151      */
152     public void setRenderLineActionsInHeader(boolean renderLineActionsInHeader);
153     
154    /**
155     * Get a string representation of all style classes defined by this layout manager.
156     * 
157     * @return string representing CSS classes
158     */
159     String getStyleClassesAsString();
160 
161 }