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.datadictionary; 017 018 import org.kuali.kfs.sys.businessobject.AccountingLine; 019 import org.kuali.kfs.sys.document.web.AccountingLineViewField; 020 import org.kuali.kfs.sys.document.web.AccountingLineViewOverrideField; 021 import org.kuali.rice.kns.datadictionary.MaintainableFieldDefinition; 022 023 /** 024 * The definition of an override field associated with an accounting line view field 025 */ 026 public class AccountingLineViewOverrideFieldDefinition extends MaintainableFieldDefinition { 027 private boolean allowEditDespiteReadOnlyParentWhenAccoutingLineEditable = false; 028 029 /** 030 * Creates an override field 031 * @param parentField the AccountingLineViewField which will own the created OverrideField 032 * @param accountingLineClass the class of the AccountingLine being rendered 033 * @return a properly created AccountingLineViewOverrideField 034 */ 035 public AccountingLineViewOverrideField getOverrideFieldForDefinition(AccountingLineViewField parentField, Class<? extends AccountingLine> accountingLineClass) { 036 return new AccountingLineViewOverrideField(parentField, this, accountingLineClass); 037 } 038 039 /** 040 * Gets the allowEditDespiteReadOnlyParentWhenAccoutingLineEditable attribute. 041 * @return Returns the allowEditDespiteReadOnlyParentWhenAccoutingLineEditable. 042 */ 043 public boolean isAllowEditDespiteReadOnlyParentWhenAccoutingLineEditable() { 044 return allowEditDespiteReadOnlyParentWhenAccoutingLineEditable; 045 } 046 047 /** 048 * Sets the allowEditDespiteReadOnlyParentWhenAccoutingLineEditable attribute value. 049 * @param allowEditDespiteReadOnlyParentWhenAccoutingLineEditable The allowEditDespiteReadOnlyParentWhenAccoutingLineEditable to set. 050 */ 051 public void setAllowEditDespiteReadOnlyParentWhenAccoutingLineEditable(boolean allowOverrideWithReadOnlyParentWhenAccoutingLineEditable) { 052 this.allowEditDespiteReadOnlyParentWhenAccoutingLineEditable = allowOverrideWithReadOnlyParentWhenAccoutingLineEditable; 053 } 054 }