001: /*
002: * $Id: org.eclipse.jdt.ui.prefs 5004 2006-03-17 20:47:08 -0800 (Fri, 17 Mar
003: * 2006) eelco12 $ $Revision: 5004 $ $Date: 2006-03-17 20:47:08 -0800 (Fri, 17
004: * Mar 2006) $
005: *
006: * ==============================================================================
007: * Licensed under the Apache License, Version 2.0 (the "License"); you may not
008: * use this file except in compliance with the License. You may obtain a copy of
009: * the License at
010: *
011: * http://www.apache.org/licenses/LICENSE-2.0
012: *
013: * Unless required by applicable law or agreed to in writing, software
014: * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
015: * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
016: * License for the specific language governing permissions and limitations under
017: * the License.
018: */
019: package wicket.examples.wizard;
020:
021: import wicket.extensions.wizard.StaticContentStep;
022: import wicket.extensions.wizard.Wizard;
023: import wicket.extensions.wizard.WizardModel;
024: import wicket.extensions.wizard.WizardStep;
025:
026: /**
027: * This is kind of the hello world example for wizards. It doesn't do anything
028: * useful, except displaying some static text and following static flow.
029: * <p>
030: * {@link StaticContentStep static content steps} are useful when you have some
031: * text to display that you don't want to define seperate panels for. E.g. when
032: * the contents come from a database, this is a convenient class to use.
033: * </p>
034: *
035: * @author Eelco Hillenius
036: */
037: public class StaticWizardWithPanels extends Wizard {
038:
039: /**
040: * The first step of this wizard.
041: */
042: private static final class Step1 extends WizardStep {
043: /**
044: * Construct.
045: */
046: public Step1() {
047: super ("One", "The first step");
048: }
049: }
050:
051: /**
052: * The second step of this wizard.
053: */
054: private static final class Step2 extends WizardStep {
055: /**
056: * Construct.
057: */
058: public Step2() {
059: super ("Two", "The second step");
060: }
061: }
062:
063: /**
064: * The third step of this wizard.
065: */
066: private static final class Step3 extends WizardStep {
067: /**
068: * Construct.
069: */
070: public Step3() {
071: super ("Three", "The third step");
072: }
073: }
074:
075: /**
076: * Construct.
077: *
078: * @param id
079: * The component id
080: */
081: public StaticWizardWithPanels(String id) {
082: super (id);
083:
084: // create a model with a couple of custom panels
085: // still not that spectacular, but at least it
086: // will give you a hint of how nice it is to
087: // be able to work with custom panels
088: WizardModel model = new WizardModel();
089: model.add(new Step1());
090: model.add(new Step2());
091: model.add(new Step3());
092:
093: // initialize the wizard
094: init(model);
095: }
096:
097: /**
098: * @see wicket.extensions.wizard.Wizard#onCancel()
099: */
100: public void onCancel() {
101: setResponsePage(Index.class);
102: }
103:
104: /**
105: * @see wicket.extensions.wizard.Wizard#onFinish()
106: */
107: public void onFinish() {
108: setResponsePage(Index.class);
109: }
110: }
|