01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17: package org.apache.wicket.examples.wizard;
18:
19: import org.apache.wicket.extensions.wizard.StaticContentStep;
20: import org.apache.wicket.extensions.wizard.Wizard;
21: import org.apache.wicket.extensions.wizard.WizardModel;
22:
23: /**
24: * This is kind of the hello world example for wizards. It doesn't do anything
25: * useful, except displaying some static text and following static flow.
26: * <p>
27: * {@link StaticContentStep static content steps} are useful when you have some
28: * text to display that you don't want to define seperate panels for. E.g. when
29: * the contents come from a database, this is a convenient class to use.
30: * </p>
31: *
32: * @author Eelco Hillenius
33: */
34: public class StaticWizard extends Wizard {
35:
36: /**
37: * Construct.
38: *
39: * @param id
40: * The component id
41: */
42: public StaticWizard(String id) {
43: super (id);
44:
45: // create a model with the stupidest steps you can think of
46: WizardModel model = new WizardModel();
47: model
48: .add(new StaticContentStep(
49: "One",
50: "The first step",
51: "The <span style=\"color:red\">first step</span> in the "
52: + "<i>wonderful world</i> of <strong>wizards</strong>",
53: true));
54: model.add(new StaticContentStep("Two", "The second step",
55: "Aren't we having fun?", true));
56: model.add(new StaticContentStep("Three",
57: "The third and last step",
58: "Owk, I'm done with this wizard", true));
59:
60: // and initialize the wizard
61: init(model);
62: }
63:
64: /**
65: * @see org.apache.wicket.extensions.wizard.Wizard#onCancel()
66: */
67: public void onCancel() {
68: setResponsePage(Index.class);
69: }
70:
71: /**
72: * @see org.apache.wicket.extensions.wizard.Wizard#onFinish()
73: */
74: public void onFinish() {
75: setResponsePage(Index.class);
76: }
77: }
|