001 /**
002 * Copyright 2005-2013 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.rice.krad.uif.container;
017
018 import org.kuali.rice.krad.uif.lifecycle.ViewLifecycleTaskBase;
019 import org.kuali.rice.krad.uif.lifecycle.ViewLifecycle;
020 import org.kuali.rice.krad.uif.lifecycle.ViewLifecyclePhase;
021
022 /**
023 * Invoke custom initialization on the container from the view helper.
024 *
025 * @author Kuali Rice Team (rice.collab@kuali.org)
026 */
027 public class InitializeContainerFromHelperTask extends ViewLifecycleTaskBase {
028
029 /**
030 * Constructor.
031 *
032 * @param phase The initialize phase for this container.
033 */
034 public InitializeContainerFromHelperTask(ViewLifecyclePhase phase) {
035 super(phase);
036 }
037
038 /**
039 * Invoke custom initialization based on the view helper.
040 *
041 * @see ViewHelperService#
042 * @see org.kuali.rice.krad.uif.lifecycle.ViewLifecycleTaskBase#performLifecycleTask()
043 */
044 @Override
045 protected void performLifecycleTask() {
046 // invoke hook point for adding components through code
047 ViewLifecycle.getHelper().addCustomContainerComponents(getPhase().getModel(),
048 (Container) getPhase().getComponent());
049 }
050
051 }