001 /*
002 * Copyright 2011 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 */
016 package org.kuali.kfs.sys.document.web.renderers;
017
018 import javax.servlet.jsp.JspException;
019 import javax.servlet.jsp.PageContext;
020 import javax.servlet.jsp.tagext.Tag;
021
022 import org.kuali.rice.kns.web.ui.Field;
023
024 /**
025 * More detailed contract for renderers which render fields
026 */
027 public interface FieldRenderer extends Renderer {
028
029 /**
030 * On the renderer, sets the field to render
031 * @param field the field to render
032 */
033 public abstract void setField(Field field);
034
035 /**
036 * On the renderer, sets the name of the dynamic name label
037 * @param label the label to set
038 */
039 public abstract void setDynamicNameLabel(String label);
040
041 /**
042 * Sets that this renderer should display as in error
043 * @param error true if renderer should display as in error, false otherwise
044 */
045 public abstract void setShowError(boolean error);
046
047 /**
048 * Tells the renderer to render a quickfinder or not
049 * @return true if a quick finder should be rendered, false otherwise
050 */
051 public abstract boolean renderQuickfinder();
052
053 /**
054 * Sets the tab index the field being rendered should use - if it never ever wants to get tabbed to
055 * @param tabIndex a tab index no human will have the patience to reach
056 */
057 public abstract void setArbitrarilyHighTabIndex(int tabIndex);
058
059 /**
060 * Renders the opening of a no-wrap span
061 * @param pageContext the page contex to render to
062 * @param parentTag the tag requesting all of this rendering
063 * @throws JspException thrown if something goes wrong in rendering
064 */
065 public abstract void openNoWrapSpan(PageContext pageContext, Tag parentTag) throws JspException;
066
067 /**
068 * Renders the closing of a no wrap span
069 * @param pageContext the page contex to render to
070 * @param parentTag the tag requesting all of this rendering
071 * @throws JspException thrown if something goes wrong in rendering
072 */
073 public abstract void closeNoWrapSpan(PageContext pageContext, Tag parentTag) throws JspException;
074
075 /**
076 * Overrides the onBlur setting for this renderer
077 * @param onBlur the onBlur value to set and return from buildOnBlur
078 */
079 public abstract void overrideOnBlur(String onBlur);
080
081 /**
082 * Sets the accessible title of the current field
083 * @param accessibleTitle the given the accessible title
084 */
085 public abstract void setAccessibleTitle(String accessibleTitle);
086 }