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.io.Serializable; 019import java.util.List; 020import java.util.Map; 021 022import org.kuali.rice.krad.datadictionary.uif.UifDictionaryBean; 023import org.kuali.rice.krad.uif.component.PropertyReplacer; 024import org.kuali.rice.krad.uif.container.Container; 025import org.kuali.rice.krad.uif.util.LifecycleElement; 026 027/** 028 * Manages the rendering of <code>Component</code> instances within a 029 * <code>Container</code> 030 * 031 * @author Kuali Rice Team (rice.collab@kuali.org) 032 */ 033public interface LayoutManager extends UifDictionaryBean, LifecycleElement, Serializable { 034 035 /** 036 * The path to the JSP file that should be called to invoke the layout 037 * manager 038 * 039 * <p> 040 * The path should be relative to the web root. All layout manager templates 041 * receive the list of items of be placed, the configured layout manager, 042 * and the container to which the layout manager applies 043 * </p> 044 * 045 * <p> 046 * e.g. '/krad/WEB-INF/jsp/tiles/boxLayout.jsp' 047 * </p> 048 * 049 * @return String representing the template path 050 */ 051 public String getTemplate(); 052 053 /** 054 * Setter for the layout managers template 055 * 056 * @param template 057 */ 058 public void setTemplate(String template); 059 060 /** 061 * The name for which the template can be invoked by 062 * 063 * <p> 064 * Whether the template name is needed depends on the underlying rendering engine being used. In the example of 065 * Freemarker, the template points to the actual source file, which then loads a macro. From then on the macro is 066 * simply invoked to execute the template 067 * </p> 068 * 069 * <p> 070 * e.g. 'uif_grid' 071 * </p> 072 * 073 * @return template name 074 */ 075 public String getTemplateName(); 076 077 /** 078 * Setter for the name of the template (a name which can be used to invoke) 079 * 080 * @param templateName 081 */ 082 public void setTemplateName(String templateName); 083 084 /** 085 * Determines what <code>Container</code> classes are supported by the 086 * <code>LayoutManager</code> 087 * 088 * @return Class<? extends Container> container class supported 089 */ 090 public Class<? extends Container> getSupportedContainer(); 091 092 /** 093 * CSS style string to be applied to the area (div) the layout manager 094 * generates for the items 095 * 096 * <p> 097 * Note the styleClass/style configured on the <code>Container</code> 098 * applies to all the container content (header, body, footer), while the 099 * styleClass/style configured on the <code>LayoutManager</code> only 100 * applies to the div surrounding the items placed by the manager (the 101 * container's body) 102 * </p> 103 * 104 * <p> 105 * Any style override or additions can be specified with this attribute. 106 * This is used by the renderer to set the style attribute on the 107 * corresponding element. 108 * </p> 109 * 110 * <p> 111 * e.g. 'color: #000000;text-decoration: underline;' 112 * </p> 113 * 114 * @return String css style string 115 */ 116 public String getStyle(); 117 118 /** 119 * Setter for the layout manager div style 120 * 121 * @param style 122 */ 123 public void setStyle(String style); 124 125 public List<String> getLibraryCssClasses(); 126 127 public void setLibraryCssClasses(List<String> libraryClasses); 128 129 /** 130 * CSS style class(s) to be applied to the area (div) the layout manager 131 * generates for the items 132 * 133 * <p> 134 * Note the styleClass/style configured on the <code>Container</code> 135 * applies to all the container content (header, body, footer), while the 136 * styleClass/style configured on the <code>LayoutManager</code> only 137 * applies to the div surrounding the items placed by the manager (the 138 * container's body) 139 * </p> 140 * 141 * <p> 142 * Declares additional style classes for the div. Multiple classes are 143 * specified with a space delimiter. This is used by the renderer to set the 144 * class attribute on the corresponding element. The class(s) declared must 145 * be available in the common style sheets or the style sheets specified for 146 * the view 147 * </p> 148 * 149 * <p> 150 * e.g. 'header left' 151 * </p> 152 * 153 * @return List<String> css style classes to apply 154 */ 155 public List<String> getCssClasses(); 156 157 /** 158 * Setter for the layout manager div style class 159 * 160 * @param styleClasses 161 */ 162 public void setCssClasses(List<String> styleClasses); 163 164 public List<String> getAdditionalCssClasses(); 165 166 public void setAdditionalCssClasses(List<String> libraryClasses); 167 168 /** 169 * This method adds a single style class to the list of css style classes on this component 170 * 171 * @param styleClass 172 */ 173 public void addStyleClass(String styleClass); 174 175 /** 176 * Appends to the inline style set on this layoutManager 177 * 178 * @param styleRules 179 */ 180 public void appendToStyle(String styleRules); 181 182 /** 183 * List of <code>PropertyReplacer</code> instances that will be 184 * evaluated during the view lifecycle to conditional set properties on the 185 * <code>LayoutManager</code> based on expression evaluations 186 * 187 * @return List<PropertyReplacer> replacers to evaluate 188 */ 189 public List<PropertyReplacer> getPropertyReplacers(); 190 191 /** 192 * Setter for the layout managers property substitutions 193 * 194 * @param propertyReplacers 195 */ 196 public void setPropertyReplacers(List<PropertyReplacer> propertyReplacers); 197 198}