01: /*
02: * Copyright 2005-2007 The Kuali Foundation.
03: *
04: * Licensed under the Educational Community License, Version 1.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.opensource.org/licenses/ecl1.php
09: *
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.module.financial.web.struts.action;
17:
18: import java.util.List;
19:
20: import org.kuali.kfs.bo.AccountingLine;
21: import org.kuali.kfs.document.AccountingDocument;
22: import org.kuali.kfs.web.struts.action.KualiAccountingDocumentActionBase;
23: import org.kuali.kfs.web.struts.form.KualiAccountingDocumentFormBase;
24: import org.kuali.kfs.web.ui.AccountingLineDecorator;
25:
26: /**
27: * This class handles Actions for <ocde>IndirectCostAdjustmentDocument</code>s
28: */
29: public class IndirectCostAdjustmentAction extends
30: KualiAccountingDocumentActionBase {
31:
32: /**
33: * added target line baseline creation for lines created by source add
34: *
35: * @see org.kuali.module.financial.web.struts.action.KualiFinancialDocumentActionBase#insertAccountingLine(boolean,
36: * org.kuali.module.financial.web.struts.form.KualiFinancialDocumentFormBase, org.kuali.core.bo.AccountingLine)
37: */
38: @Override
39: protected void insertAccountingLine(boolean isSource,
40: KualiAccountingDocumentFormBase financialDocumentForm,
41: AccountingLine line) {
42: super .insertAccountingLine(isSource, financialDocumentForm,
43: line);
44: if (isSource) {
45: AccountingLineDecorator decorator = new AccountingLineDecorator();
46: decorator.setRevertible(false);
47:
48: // add it to the baseline, to prevent generation of spurious update events
49: AccountingDocument tDoc = (AccountingDocument) financialDocumentForm
50: .getDocument();
51: List targetLines = tDoc.getTargetAccountingLines();
52: financialDocumentForm.getBaselineTargetAccountingLines()
53: .add(targetLines.get(targetLines.size() - 1));
54:
55: // add the decorator
56: financialDocumentForm.getTargetLineDecorators().add(
57: decorator);
58: }
59: }
60: }
|