001/** 002 * Copyright 2005-2018 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.layout; 017 018import java.util.List; 019 020import org.kuali.rice.krad.uif.container.Group; 021 022/** 023 * Layout manager interface for stacked collections. 024 * 025 * @author Kuali Rice Team (rice.collab@kuali.org) 026 */ 027public interface StackedLayoutManager extends CollectionLayoutManager { 028 029 /** 030 * Text to appears in the header for each collection lines Group. Used in 031 * conjunction with {@link #getSummaryFields()} to build up the final header 032 * text 033 * 034 * @return summary title text 035 */ 036 String getSummaryTitle(); 037 038 /** 039 * Setter for the summary title text 040 * 041 * @param summaryTitle 042 */ 043 void setSummaryTitle(String summaryTitle); 044 045 /** 046 * List of attribute names from the collection line class that should be 047 * used to build the line summary. To build the summary the value for each 048 * attribute is retrieved from the line instance. All the values are then 049 * placed together with a separator. 050 * 051 * @return summary field names 052 * @see StackedLayoutManagerBase#buildLineHeaderText(Object, org.kuali.rice.krad.uif.container.Group) 053 */ 054 List<String> getSummaryFields(); 055 056 /** 057 * Setter for the summary field name list 058 * 059 * @param summaryFields 060 */ 061 void setSummaryFields(List<String> summaryFields); 062 063 /** 064 * Group instance that is used as a prototype for creating the collection 065 * line groups. For each line a copy of the prototype is made and then 066 * adjusted as necessary 067 * 068 * @return Group instance to use as prototype 069 */ 070 Group getLineGroupPrototype(); 071 072 /** 073 * Setter for the line group prototype 074 * 075 * @param lineGroupPrototype 076 */ 077 void setLineGroupPrototype(Group lineGroupPrototype); 078 079 /** 080 * Group that will 'wrap' the generated collection lines so that they have a different layout from the general 081 * stacked layout 082 * 083 * <p> 084 * By default (when the wrapper group is null), each collection line will become a group and the groups are 085 * rendered one after another. If the wrapper group is configured, the generated groups will be inserted as the 086 * items for the wrapper group, and the layout manager configured for the wrapper group will determine how they 087 * are rendered. For example, the layout manager could be a grid layout configured for three columns, which would 088 * layout the first three lines horizontally then break to a new row. 089 * </p> 090 * 091 * @return Group instance whose items list should be populated with the generated groups, or null to use the 092 * default layout 093 */ 094 Group getWrapperGroup(); 095 096 /** 097 * Setter for the wrapper group that will receive the generated line groups 098 * 099 * @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}