View Javadoc
1   /**
2    * Copyright 2005-2015 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.io.Serializable;
19  import java.util.List;
20  import java.util.Map;
21  
22  import org.kuali.rice.krad.datadictionary.uif.UifDictionaryBean;
23  import org.kuali.rice.krad.uif.component.PropertyReplacer;
24  import org.kuali.rice.krad.uif.container.Container;
25  import org.kuali.rice.krad.uif.util.LifecycleElement;
26  
27  /**
28   * Manages the rendering of <code>Component</code> instances within a
29   * <code>Container</code>
30   *
31   * @author Kuali Rice Team (rice.collab@kuali.org)
32   */
33  public interface LayoutManager extends UifDictionaryBean, LifecycleElement, Serializable {
34  
35  	/**
36  	 * The path to the JSP file that should be called to invoke the layout
37  	 * manager
38  	 *
39  	 * <p>
40  	 * The path should be relative to the web root. All layout manager templates
41  	 * receive the list of items of be placed, the configured layout manager,
42  	 * and the container to which the layout manager applies
43  	 * </p>
44  	 *
45  	 * <p>
46  	 * e.g. '/krad/WEB-INF/jsp/tiles/boxLayout.jsp'
47  	 * </p>
48  	 *
49  	 * @return String representing the template path
50  	 */
51  	public String getTemplate();
52  
53  	/**
54  	 * Setter for the layout managers template
55  	 *
56  	 * @param template
57  	 */
58  	public void setTemplate(String template);
59  
60      /**
61       * The name for which the template can be invoked by
62       *
63       * <p>
64       * Whether the template name is needed depends on the underlying rendering engine being used. In the example of
65       * Freemarker, the template points to the actual source file, which then loads a macro. From then on the macro is
66       * simply invoked to execute the template
67       * </p>
68       *
69       * <p>
70       * e.g. 'uif_grid'
71       * </p>
72       *
73       * @return template name
74       */
75      public String getTemplateName();
76  
77      /**
78       * Setter for the name of the template (a name which can be used to invoke)
79       *
80       * @param templateName
81       */
82      public void setTemplateName(String templateName);
83  
84  	/**
85  	 * Determines what <code>Container</code> classes are supported by the
86  	 * <code>LayoutManager</code>
87  	 *
88  	 * @return Class<? extends Container> container class supported
89  	 */
90  	public Class<? extends Container> getSupportedContainer();
91  
92  	/**
93  	 * CSS style string to be applied to the area (div) the layout manager
94  	 * generates for the items
95  	 *
96  	 * <p>
97  	 * Note the styleClass/style configured on the <code>Container</code>
98  	 * applies to all the container content (header, body, footer), while the
99  	 * 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 }