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.examples.WicketExamplePage;
22: import wicket.markup.html.link.Link;
23:
24: /**
25: * Index page for the wizard example.
26: *
27: * @author Eelco Hillenius
28: */
29: public class Index extends WicketExamplePage {
30: /**
31: * Link to the wizard. It's an internal link instead of a bookmarkable page
32: * to help us with backbutton surpression. Wizards by default do not
33: * partipcate in versioning, which has the effect that whenever a button is
34: * clicked in the wizard, it will never result in a change of the
35: * redirection url. However, though that'll work just fine when you are
36: * already in the wizard, there is still the first access to the wizard. But
37: * if you link to the page that renders it using and internal link, you'll
38: * circumvent that.
39: */
40: private static final class WizardLink extends Link {
41: private final Class wizardClass;
42:
43: /**
44: * Construct.
45: *
46: * @param id
47: * Component id
48: * @param wizardClass
49: * Class of the wizard to instantiate
50: */
51: public WizardLink(String id, Class wizardClass) {
52: super (id);
53: this .wizardClass = wizardClass;
54: }
55:
56: /**
57: * @see wicket.markup.html.link.Link#onClick()
58: */
59: public void onClick() {
60: setResponsePage(new WizardPage(wizardClass));
61: }
62: }
63:
64: /**
65: * Construct.
66: */
67: public Index() {
68: add(new WizardLink("staticWizardLink", StaticWizard.class));
69: add(new WizardLink("staticWizardWithPanelsLink",
70: StaticWizardWithPanels.class));
71: add(new WizardLink("newUserWizardLink", NewUserWizard.class));
72: }
73: }
|