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 org.kuali.rice.kns.web.ui.Field; 021 022 /** 023 * Base class for header labels 024 */ 025 public abstract class HeaderLabel implements RenderableElement { 026 private boolean labeledFieldEmptyOrHidden = false; 027 028 /** 029 * Header labels are never action blocks 030 * @see org.kuali.kfs.sys.document.web.RenderableElement#isActionBlock() 031 */ 032 public boolean isActionBlock() { 033 return false; 034 } 035 036 /** 037 * Header labels are never hidden 038 * @see org.kuali.kfs.sys.document.web.RenderableElement#isHidden() 039 */ 040 public boolean isHidden() { 041 return false; 042 } 043 044 /** 045 * Returns whether the label field is either hidden or empty; this way, any labels for 046 * moved hidden fields will be removed 047 * @see org.kuali.kfs.sys.document.web.RenderableElement#isEmpty() 048 */ 049 public boolean isEmpty() { 050 return labeledFieldEmptyOrHidden; 051 } 052 053 /** 054 * Gets the labeledFieldEmptyOrHidden attribute. 055 * @return Returns the labeledFieldEmptyOrHidden. 056 */ 057 public boolean isLabeledFieldEmptyOrHidden() { 058 return labeledFieldEmptyOrHidden; 059 } 060 061 /** 062 * Sets the labeledFieldEmptyOrHidden attribute value. 063 * @param labeledFieldEmptyOrHidden The labeledFieldEmptyOrHidden to set. 064 */ 065 public void setLabeledFieldEmptyOrHidden(boolean labeledFieldEmptyOrHidden) { 066 this.labeledFieldEmptyOrHidden = labeledFieldEmptyOrHidden; 067 } 068 069 /** 070 * Header labels aren't really fields, so they append nothing 071 * @see org.kuali.kfs.sys.document.web.RenderableElement#appendFieldNames(java.util.List) 072 */ 073 public void appendFields(List<Field> fields) { 074 // zzzz! zzzz! 075 } 076 077 /** 078 * Does nothing 079 * @see org.kuali.kfs.sys.document.web.RenderableElement#populateWithTabIndexIfRequested(int[], int) 080 */ 081 public void populateWithTabIndexIfRequested(int reallyHighIndex) {} 082 }