01: /*
02: * Beryl - A web platform based on XML, XSLT and Java
03: * This file is part of the Beryl XML GUI
04: *
05: * Copyright (C) 2004 Wenzel Jakob <wazlaf@tigris.org>
06: *
07: * This program is free software; you can redistribute it and/or
08: * modify it under the terms of the GNU Lesser General Public
09: * License as published by the Free Software Foundation; either
10: * version 2.1 of the License, or (at your option) any later version.
11:
12: * This program is distributed in the hope that it will be useful,
13: * but WITHOUT ANY WARRANTY; without even the implied warranty of
14: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15: * Lesser General Public License for more details.
16: *
17: * You should have received a copy of the GNU Lesser General Public
18: * License along with this program; if not, write to the Free Software
19: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-3107 USA
20: */
21:
22: package org.beryl.gui.widgets;
23:
24: import org.beryl.gui.GUIException;
25: import org.beryl.gui.Widget;
26: import org.beryl.gui.WizardPageAdapter;
27:
28: public class WizardPage extends Panel {
29: private boolean enabled = true;
30: private String title = null, description = null;
31: private WizardPageAdapter adapter = null;
32:
33: public WizardPage(Widget parent, String name) throws GUIException {
34: super (parent, name);
35: if (name == null)
36: throw new GUIException(
37: "WizardPage widgets need to have a name");
38: }
39:
40: public void setProperty(String name, Object value)
41: throws GUIException {
42: if ("enabled".equals(name)) {
43: enabled = ((Boolean) value).booleanValue();
44: } else if ("title".equals(name)) {
45: title = (String) value;
46: } else if ("description".equals(name)) {
47: description = (String) value;
48: } else {
49: super .setProperty(name, value);
50: }
51: }
52:
53: public boolean isEnabled() {
54: return enabled;
55: }
56:
57: public String getTitle() {
58: return title;
59: }
60:
61: public String getDescription() {
62: return description;
63: }
64:
65: public void setEnabled(boolean enabled) {
66: this .enabled = enabled;
67: }
68:
69: public WizardPageAdapter getAdapter() {
70: return adapter;
71: }
72:
73: public void setAdapter(WizardPageAdapter adapter)
74: throws GUIException {
75: this .adapter = adapter;
76: ((Wizard) getParentWidget()).updateButtons();
77: }
78: }
|