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 org.kuali.rice.krad.uif.container.CollectionGroup; 19 import org.kuali.rice.krad.uif.container.Group; 20 import org.kuali.rice.krad.uif.container.collections.LineBuilderContext; 21 import org.kuali.rice.krad.uif.field.Field; 22 import org.kuali.rice.krad.uif.field.FieldGroup; 23 import org.kuali.rice.krad.uif.element.Pager; 24 25 /** 26 * Layout manager implementations that work with a collection (such as a table layout) should implement 27 * this interface for building the collection component instances. 28 * 29 * <p>Unlike other group instances, collection group instances need to generate new instances of the 30 * configured components for each line of the collection. The field instances for each line 31 * are wrapped differently depending on what layout manager is being applied. Therefore as the collection lines 32 * are being built (during the applyModel phase) this method will be invoked on the manager so that it may 33 * setup the line as needed.</p> 34 * 35 * @author Kuali Rice Team (rice.collab@kuali.org) 36 * @see org.kuali.rice.krad.uif.container.CollectionGroupBuilder 37 */ 38 public interface CollectionLayoutManager extends LayoutManager { 39 40 /** 41 * Call to the layout manager to build the components necessary for the given collection line, 42 * within an active view lifecycle. 43 * 44 * <p>As the collection is being iterated over by the {@link org.kuali.rice.krad.uif.container.CollectionGroupLineBuilder} 45 * this method is invoked for each line. The builder will create copies of the configured fields and actions for 46 * the line and pass into the layout manager so they can be assembled</p> 47 * 48 * @param lineBuilderContext context for the line to be built 49 */ 50 void buildLine(LineBuilderContext lineBuilderContext); 51 52 /** 53 * Invoked when a paging request occurs to carry out the paging request. 54 * 55 * @param model object containing the view's data 56 * @param collectionGroup collection group the request was made for 57 */ 58 void processPagingRequest(Object model, CollectionGroup collectionGroup); 59 60 /** 61 * Group for rendering the add line when separate (always the case for stacked layout, and a configuration 62 * for table layout). 63 * 64 * <p>This group can be used to configure how the add line will be rendered. For example the layout 65 * manager configured on the group will be used to rendered the add line fields. If the header 66 * (title) is not set on the group, it will be set from 67 * {@link org.kuali.rice.krad.uif.container.CollectionGroup#getAddLabel()}. In addition, 68 * {@link org.kuali.rice.krad.uif.container.CollectionGroup#getAddLineActions()} will be added 69 * to the group footer items.</p> 70 * 71 * @return Group instance for the collection add line 72 */ 73 Group getAddLineGroup(); 74 75 /** 76 * @see CollectionLayoutManager#getAddLineGroup() 77 */ 78 void setAddLineGroup(Group addLineGroup); 79 80 /** 81 * Field group instance that is used as a prototype for creating the sub-collection field groups. 82 * 83 * @return GroupField instance to use as prototype 84 */ 85 FieldGroup getSubCollectionFieldGroupPrototype(); 86 87 /** 88 * @see CollectionLayoutManager#getSubCollectionFieldGroupPrototype() 89 */ 90 void setSubCollectionFieldGroupPrototype(FieldGroup subCollectionFieldGroupPrototype); 91 92 /** 93 * Field instance that serves as a prototype for creating the select field on each line when 94 * {@link org.kuali.rice.krad.uif.container.CollectionGroup#isIncludeLineSelectionField()} is 95 * true. 96 * 97 * <p>This prototype can be used to set the control used for the select field (generally will be a 98 * checkbox control) in addition to styling and other setting. The binding path will be formed 99 * with using the 100 * {@link org.kuali.rice.krad.uif.container.CollectionGroup#getLineSelectPropertyName()} or if 101 * not set the framework will use 102 * {@link org.kuali.rice.krad.web.form.UifFormBase#getSelectedCollectionLines()}</p> 103 * 104 * @return select field prototype instance 105 */ 106 Field getSelectFieldPrototype(); 107 108 /** 109 * @see CollectionLayoutManager#getSelectFieldPrototype() 110 */ 111 void setSelectFieldPrototype(Field selectFieldPrototype); 112 113 /** 114 * Widget used to page the collection. 115 * 116 * <p>The settings in this widget are only used by TableLayoutManagers which DO NOT take advantage 117 * of the RichTable option (this has its own paging implementation). To turn off RichTable and 118 * use a basic table with server paging set richTable.render="false" and useServerPaging="true" 119 * on the CollectionGroup which uses this layout manager.</p> 120 * 121 * @return the Pager widget 122 */ 123 Pager getPagerWidget(); 124 125 /** 126 * @see CollectionLayoutManager#getPagerWidget() 127 */ 128 void setPagerWidget(Pager pagerWidget); 129 }