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;
017
018 import java.util.List;
019
020 import javax.servlet.jsp.JspException;
021 import javax.servlet.jsp.PageContext;
022 import javax.servlet.jsp.tagext.Tag;
023
024 import org.kuali.rice.kns.web.ui.Field;
025
026 /**
027 * Methods needed by elements of accounting lines that plan on rendering themselves
028 */
029 public interface RenderableElement {
030 /**
031 * Determines if this element is hidden or not
032 * @return true if hidden, false otherwise
033 */
034 public abstract boolean isHidden();
035
036 /**
037 * Determines if this element is an action block or not
038 * @return true if this is an action block, false otherwise
039 */
040 public abstract boolean isActionBlock();
041
042 /**
043 * Is this renderable element empty of any truly renderable content?
044 * @return true if it should not be rendered, false otherwise
045 */
046 public abstract boolean isEmpty();
047
048 /**
049 * Renders this element
050 * @param pageContext the context to render to
051 * @param parentTag the parent tag that is requesting this rendering
052 * @param renderingContext the context about the accounting line that this element would end up rendering
053 */
054 public abstract void renderElement(PageContext pageContext, Tag parentTag, AccountingLineRenderingContext renderingContext) throws JspException;
055
056 /**
057 * Asks that the renderable element appends any field names it knows of to the given list; this is so that proper quick finders can be generated
058 * and population accomplished when fields themselves are rendered
059 * @param fieldNames the List of fields to append fields to
060 */
061 public abstract void appendFields(List<Field> fields);
062
063 /**
064 * Allows the arbitrarily high tab index to be set for controls
065 * @param reallyHighIndex a really high index for elements who should not be tabbed to
066 */
067 public abstract void populateWithTabIndexIfRequested(int reallyHighIndex);
068 }