View Javadoc

1   /*
2    * Copyright 2011 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/ecl1.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.rice.krad.uif.lifecycle.model;
17  
18  import org.kuali.rice.krad.uif.lifecycle.AbstractViewLifecycleTask;
19  import org.kuali.rice.krad.uif.lifecycle.ApplyModelComponentPhase;
20  import org.kuali.rice.krad.uif.lifecycle.ViewLifecyclePhase;
21  
22  /**
23   * Perform default apply model behavior defined for the component.
24   * 
25   * @author Kuali Rice Team (rice.collab@kuali.org)
26   */
27  public class ComponentDefaultApplyModelTask extends AbstractViewLifecycleTask {
28  
29      /**
30       * Create a task to assign component IDs during the apply model phase.
31       * 
32       * @param phase The apply model phase for the component.
33       */
34      public ComponentDefaultApplyModelTask(ViewLifecyclePhase phase) {
35          super(phase);
36      }
37  
38      /**
39       * @see org.kuali.rice.krad.uif.lifecycle.AbstractViewLifecycleTask#getPhase()
40       */
41      @Override
42      public ApplyModelComponentPhase getPhase() {
43          return (ApplyModelComponentPhase) super.getPhase();
44      }
45  
46      /**
47       * @see org.kuali.rice.krad.uif.lifecycle.AbstractViewLifecycleTask#performLifecycleTask()
48       */
49      @SuppressWarnings("deprecation")
50      @Override
51      protected void performLifecycleTask() {
52          ApplyModelComponentPhase phase = getPhase();
53          phase.getComponent().performApplyModel(phase.getModel(), phase.getParent());
54      }
55  
56  }