1 /** 2 * Copyright 2005-2014 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/ecl2.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; 17 18 import org.kuali.rice.krad.uif.component.Component; 19 import org.kuali.rice.krad.uif.lifecycle.ViewLifecycle.LifecycleEvent; 20 21 import java.util.List; 22 23 /** 24 * Represents a phase in the view lifecycle. 25 * 26 * @author Kuali Rice Team (rice.collab@kuali.org) 27 */ 28 public interface ViewLifecyclePhase extends LifecycleElementState, Runnable { 29 30 /** 31 * Gets the model to use in processing this phase. 32 * 33 * @return model to use in processing this phase 34 */ 35 Object getModel(); 36 37 /** 38 * Gets the parent component. 39 * 40 * @return parent component 41 */ 42 Component getParent(); 43 44 /** 45 * When a refresh component lifecycle is being processed, list of paths the lifecycle should be invoked 46 * on (including the path for the component that is being refreshed). 47 * 48 * @return list of component paths (relative to the view) 49 */ 50 List<String> getRefreshPaths(); 51 52 /** 53 * Determines if this lifecycle phase has completed processing. 54 * 55 * <p> 56 * This method will return true when this phase's tasks have been processed, but does not 57 * necessarily indicate that successor phases have been completed. Use {@link #isComplete()} to 58 * determine if the lifecycle has been fully completed for this phase. 59 * </p> 60 * 61 * @return true if this phase has been processed, false if not 62 */ 63 boolean isProcessed(); 64 65 /** 66 * Determines if this lifecycle phase and all successor phases, have completed processing. 67 * 68 * @return true if this phase and all successor phases have been processed, false if not 69 * @see Component#notifyCompleted(ViewLifecyclePhase) 70 */ 71 boolean isComplete(); 72 73 /** 74 * Gets the task currently running. 75 * 76 * @return the task currently running, null if this phase is not active. 77 */ 78 ViewLifecycleTask<?> getCurrentTask(); 79 80 /** 81 * Gets the event to notify on completion. 82 * 83 * @return lifecycle event to notify on completion 84 * @see ViewLifecycle.LifecycleEvent 85 */ 86 LifecycleEvent getEventToNotify(); 87 88 /** 89 * Gets the expected view status prior to phase execution. 90 * 91 * @return expected view status prior to phase execution 92 */ 93 String getStartViewStatus(); 94 95 /** 96 * Gets the expected view status after phase execution. 97 * 98 * @return expected view status after phase execution 99 */ 100 String getEndViewStatus(); 101 102 /** 103 * Gets the lifecycle phase that directly precedes this phase. 104 * 105 * @return lifecycle phase that directly precedes this phase 106 */ 107 ViewLifecyclePhase getPredecessor(); 108 109 }