01: /*
02: * $Id: org.eclipse.jdt.ui.prefs 5004 2006-03-17 20:47:08 -0800 (Fri, 17 Mar
03: * 2006) eelco12 $ $Revision: 5004 $ $Date: 2006-03-17 20:47:08 -0800 (Fri, 17
04: * Mar 2006) $
05: *
06: * ==============================================================================
07: * Licensed under the Apache License, Version 2.0 (the "License"); you may not
08: * use this file except in compliance with the License. You may obtain a copy of
09: * the License at
10: *
11: * http://www.apache.org/licenses/LICENSE-2.0
12: *
13: * Unless required by applicable law or agreed to in writing, software
14: * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
15: * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
16: * License for the specific language governing permissions and limitations under
17: * the License.
18: */
19: package wicket.extensions.wizard;
20:
21: import java.io.Serializable;
22:
23: import wicket.Component;
24:
25: /**
26: * Models one step in a wizard, and is the equivalent of one panel in a wizard
27: * from an end-user's perspective.
28: * <p>
29: * Typically, you would extend {@link WizardStep panel based wizard steps} and
30: * provide a custom panel for the step instead of directly implementing this
31: * interface.
32: * </p>
33: *
34: * <p>
35: * <a href="https://wizard-framework.dev.java.net/">Swing Wizard Framework</a>
36: * served as a valuable source of inspiration.
37: * </p>
38: *
39: * @author Eelco Hillenius
40: */
41: public interface IWizardStep extends Serializable {
42: /**
43: * This method is called whenever the user presses next while this step is
44: * active.
45: * <p>
46: * This method will only be called if {@link IWizardModel#isNextAvailable}
47: * and {@link #isComplete} return true.
48: */
49: void applyState();
50:
51: /**
52: * Gets the header component for this step. This component is displayed in a
53: * special section of the wizard.
54: *
55: * @param id
56: * The id that the component should be created with
57: * @param parent
58: * The parent component (for post 1.2)
59: * @param wizard
60: * The wizard component the header will be placed on
61: * @return The header component
62: */
63: Component getHeader(String id, Component parent, IWizard wizard);
64:
65: /**
66: * Returns the current view this step is displaying. This component will be
67: * displayed in the main section of the wizard with this step is active.
68: * This may changed at any time by as long as an appropriate property change
69: * event is fired.
70: *
71: * @param id
72: * The id that the component should be created with
73: * @param parent
74: * The parent component (for post 1.2)
75: * @param wizard
76: * The wizard component the header will be placed on
77: * @return The current view of the step.
78: */
79: Component getView(String id, Component parent, IWizard wizard);
80:
81: /**
82: * Initializes this step with the model it will belong to.
83: *
84: * @param wizardModel
85: * the owning wizard model
86: */
87: void init(IWizardModel wizardModel);
88:
89: /**
90: * Checks if this step is compete. This method should return true if the
91: * wizard can proceed to the next step.
92: *
93: * @return <tt>true</tt> if the wizard can proceed from this step,
94: * <tt>false</tt> otherwise.
95: */
96: boolean isComplete();
97: }
|