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; 17 18 import java.util.List; 19 20 import javax.servlet.jsp.JspException; 21 import javax.servlet.jsp.PageContext; 22 import javax.servlet.jsp.tagext.Tag; 23 24 import org.kuali.rice.kns.web.ui.Field; 25 26 /** 27 * Methods needed by elements of accounting lines that plan on rendering themselves 28 */ 29 public interface RenderableElement { 30 /** 31 * Determines if this element is hidden or not 32 * @return true if hidden, false otherwise 33 */ 34 public abstract boolean isHidden(); 35 36 /** 37 * Determines if this element is an action block or not 38 * @return true if this is an action block, false otherwise 39 */ 40 public abstract boolean isActionBlock(); 41 42 /** 43 * Is this renderable element empty of any truly renderable content? 44 * @return true if it should not be rendered, false otherwise 45 */ 46 public abstract boolean isEmpty(); 47 48 /** 49 * Renders this element 50 * @param pageContext the context to render to 51 * @param parentTag the parent tag that is requesting this rendering 52 * @param renderingContext the context about the accounting line that this element would end up rendering 53 */ 54 public abstract void renderElement(PageContext pageContext, Tag parentTag, AccountingLineRenderingContext renderingContext) throws JspException; 55 56 /** 57 * 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 58 * and population accomplished when fields themselves are rendered 59 * @param fieldNames the List of fields to append fields to 60 */ 61 public abstract void appendFields(List<Field> fields); 62 63 /** 64 * Allows the arbitrarily high tab index to be set for controls 65 * @param reallyHighIndex a really high index for elements who should not be tabbed to 66 */ 67 public abstract void populateWithTabIndexIfRequested(int reallyHighIndex); 68 }