1 /*
2 * Copyright 2008 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.ole.sys.document.web.renderers;
17
18 import javax.servlet.jsp.JspException;
19 import javax.servlet.jsp.PageContext;
20 import javax.servlet.jsp.tagext.Tag;
21
22 import org.kuali.rice.kns.web.ui.Field;
23
24 /**
25 * More detailed contract for renderers which render fields
26 */
27 public interface FieldRenderer extends Renderer {
28
29 /**
30 * On the renderer, sets the field to render
31 * @param field the field to render
32 */
33 public abstract void setField(Field field);
34
35 /**
36 * On the renderer, sets the name of the dynamic name label
37 * @param label the label to set
38 */
39 public abstract void setDynamicNameLabel(String label);
40
41 /**
42 * Sets that this renderer should display as in error
43 * @param error true if renderer should display as in error, false otherwise
44 */
45 public abstract void setShowError(boolean error);
46
47 /**
48 * Tells the renderer to render a quickfinder or not
49 * @return true if a quick finder should be rendered, false otherwise
50 */
51 public abstract boolean renderQuickfinder();
52
53 /**
54 * Sets the tab index the field being rendered should use - if it never ever wants to get tabbed to
55 * @param tabIndex a tab index no human will have the patience to reach
56 */
57 public abstract void setArbitrarilyHighTabIndex(int tabIndex);
58
59 /**
60 * Renders the opening of a no-wrap span
61 * @param pageContext the page contex to render to
62 * @param parentTag the tag requesting all of this rendering
63 * @throws JspException thrown if something goes wrong in rendering
64 */
65 public abstract void openNoWrapSpan(PageContext pageContext, Tag parentTag) throws JspException;
66
67 /**
68 * Renders the closing of a no wrap span
69 * @param pageContext the page contex to render to
70 * @param parentTag the tag requesting all of this rendering
71 * @throws JspException thrown if something goes wrong in rendering
72 */
73 public abstract void closeNoWrapSpan(PageContext pageContext, Tag parentTag) throws JspException;
74
75 /**
76 * Overrides the onBlur setting for this renderer
77 * @param onBlur the onBlur value to set and return from buildOnBlur
78 */
79 public abstract void overrideOnBlur(String onBlur);
80
81 /**
82 * Sets the accessible title of the current field
83 * @param accessibleTitle the given the accessible title
84 */
85 public abstract void setAccessibleTitle(String accessibleTitle);
86 }