01: package fr.aliacom.dbmjui.wizard;
02:
03: import java.beans.PropertyChangeListener;
04:
05: import fr.aliacom.common.ui.wizard.IWizardModel;
06:
07: /**
08: * @author tom
09: *
10: * (C) 2001, 2003 Thomas Cataldo
11: */
12: public class WizardModel implements IWizardModel {
13:
14: private static final String[] CARDS = { "1", "2", "3", "4", "5",
15: "6", "7", "8" };
16: private int currentCard;
17:
18: public WizardModel() {
19: currentCard = 0;
20: }
21:
22: /**
23: * @see fr.aliacom.common.ui.wizard.IWizardModel#isLinear()
24: */
25: public boolean isLinear() {
26: return true;
27: }
28:
29: /**
30: * @see fr.aliacom.common.ui.wizard.IWizardModel#isNextEnabled()
31: */
32: public boolean isNextEnabled() {
33: return currentCard != CARDS.length - 1;
34: }
35:
36: /**
37: * @see fr.aliacom.common.ui.wizard.IWizardModel#next()
38: */
39: public String next() {
40: return CARDS[++currentCard];
41: }
42:
43: /**
44: * @see fr.aliacom.common.ui.wizard.IWizardModel#isPreviousEnabled()
45: */
46: public boolean isPreviousEnabled() {
47: return currentCard != 0;
48: }
49:
50: /**
51: * @see fr.aliacom.common.ui.wizard.IWizardModel#previous()
52: */
53: public String previous() {
54: return CARDS[--currentCard];
55: }
56:
57: /**
58: * @see fr.aliacom.common.ui.wizard.IWizardModel#isFinishEnabled()
59: */
60: public boolean isFinishEnabled() {
61: return false;
62: }
63:
64: /**
65: * @see fr.aliacom.common.ui.wizard.IWizardModel#addPropertyChangeListener(java.beans.PropertyChangeListener)
66: */
67: public void addPropertyChangeListener(
68: PropertyChangeListener listener) {
69: }
70:
71: /**
72: * @see fr.aliacom.common.ui.wizard.IWizardModel#removePropertyChangeListener(java.beans.PropertyChangeListener)
73: */
74: public void removePropertyChangeListener(
75: PropertyChangeListener listener) {
76: }
77:
78: }
|