01: /**
02: * Created on Dec 2, 2004
03: *
04: * @author karthikeyanr
05: *
06: */package example;
07:
08: import javax.swing.*;
09:
10: import wizard.ui.AbstractMagicPanel;
11:
12: public class DummyCard extends AbstractMagicPanel {
13: private final String text;
14:
15: private final boolean shouldValidate;
16:
17: private JCheckBox chb;
18:
19: public DummyCard(String text) {
20: this (text, false);
21: }
22:
23: public DummyCard(String text, boolean shouldValidate) {
24: super (text);
25: this .text = text;
26: this .shouldValidate = shouldValidate;
27: }
28:
29: public String getTitle() {
30: return text + " Card";
31: }
32:
33: public boolean validatePanel() {
34: return true;
35: }
36:
37: protected void initComponents() {
38: add(new JLabel("This is the " + text + " page of the wizard."));
39: if (shouldValidate) {
40: chb = new JCheckBox("check this to proceed");
41: add(chb);
42: }
43: }
44:
45: protected void populatePanel() {
46: }
47:
48: public boolean validateEarly() {
49: return (!shouldValidate) || chb.isSelected();
50: }
51:
52: public String getDescription() {
53: return "description for " + text;
54: }
55: }
|