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.examples.wizard;
20:
21: import wicket.extensions.wizard.StaticContentStep;
22: import wicket.extensions.wizard.Wizard;
23: import wicket.extensions.wizard.WizardModel;
24:
25: /**
26: * This is kind of the hello world example for wizards. It doesn't do anything
27: * useful, except displaying some static text and following static flow.
28: * <p>
29: * {@link StaticContentStep static content steps} are useful when you have some
30: * text to display that you don't want to define seperate panels for. E.g. when
31: * the contents come from a database, this is a convenient class to use.
32: * </p>
33: *
34: * @author Eelco Hillenius
35: */
36: public class StaticWizard extends Wizard {
37:
38: /**
39: * Construct.
40: *
41: * @param id
42: * The component id
43: */
44: public StaticWizard(String id) {
45: super (id);
46:
47: // create a model with the stupidest steps you can think of
48: WizardModel model = new WizardModel();
49: model
50: .add(new StaticContentStep(
51: "One",
52: "The first step",
53: "The <span style=\"color:red\">first step</span> in the "
54: + "<i>wonderful world</i> of <strong>wizards</strong>",
55: true));
56: model.add(new StaticContentStep("Two", "The second step",
57: "Aren't we having fun?", true));
58: model.add(new StaticContentStep("Three",
59: "The third and last step",
60: "Owk, I'm done with this wizard", true));
61:
62: // and initialize the wizard
63: init(model);
64: }
65:
66: /**
67: * @see wicket.extensions.wizard.Wizard#onCancel()
68: */
69: public void onCancel() {
70: setResponsePage(Index.class);
71: }
72:
73: /**
74: * @see wicket.extensions.wizard.Wizard#onFinish()
75: */
76: public void onFinish() {
77: setResponsePage(Index.class);
78: }
79: }
|