01: /**
02: * Created on Dec 2, 2004
03: *
04: * @author karthikeyanr
05: *
06: */package test.wizard.ui;
07:
08: import java.awt.BorderLayout;
09:
10: import javax.swing.JCheckBox;
11:
12: import wizard.ui.AbstractMagicPanel;
13:
14: public class MockPanel extends AbstractMagicPanel {
15: private JCheckBox chkMove, chkLastPanel;
16:
17: private boolean isValidationNeeded;
18:
19: public MockPanel(String id, boolean isValidationNeeded) {
20: super (id);
21: this .isValidationNeeded = isValidationNeeded;
22: }
23:
24: public String getDescription() {
25: return "description for " + getID();
26: }
27:
28: public String getTitle() {
29: return getID() + " Card";
30: }
31:
32: public String getNextID() {
33: if (getID() == "First")
34: return chkLastPanel.isSelected() ? "Third"
35: : AbstractMagicPanel.SUCCESSOR;
36: return AbstractMagicPanel.SUCCESSOR;
37: }
38:
39: public boolean validateEarly() {
40: return (!isValidationNeeded) || chkMove.isSelected();
41: }
42:
43: public boolean validatePanel() {
44: return true;
45: }
46:
47: protected void initComponents() {
48: setLayout(new BorderLayout());
49:
50: String chkLabel = isValidationNeeded ? "Check this to proceed"
51: : "Move";
52: chkMove = new JCheckBox(chkLabel);
53: add(chkMove, BorderLayout.CENTER);
54:
55: if (getID() == "First") {
56: chkLastPanel = new JCheckBox(
57: "Check this to go to Last Panel");
58: add(chkLastPanel, BorderLayout.SOUTH);
59: }
60: }
61:
62: protected void populatePanel() {
63: }
64: }
|