01: //WebOnSwing - Web Application Framework
02: //Copyright (C) 2003 Fernando Damian Petrola
03: //
04: //This library is free software; you can redistribute it and/or
05: //modify it under the terms of the GNU Lesser General Public
06: //License as published by the Free Software Foundation; either
07: //version 2.1 of the License, or (at your option) any later version.
08: //
09: //This library is distributed in the hope that it will be useful,
10: //but WITHOUT ANY WARRANTY; without even the implied warranty of
11: //MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12: //Lesser General Public License for more details.
13: //
14: //You should have received a copy of the GNU Lesser General Public
15: //License along with this library; if not, write to the Free Software
16: //Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17:
18: package net.ar.webonswing.swing.components;
19:
20: import java.awt.*;
21: import java.awt.event.*;
22:
23: import javax.swing.*;
24:
25: import net.ar.webonswing.*;
26:
27: /**
28: * Componente que permite recargar ciertos administradores del framework
29: *
30: * @author Fernando Damian Petrola
31: */
32: public class JWosReloader extends JPanel {
33: public JWosReloader(LayoutManager layout) {
34: super (layout);
35: addComponents();
36: }
37:
38: public JWosReloader() {
39: addComponents();
40: }
41:
42: private void addComponents() {
43: JButton thePageManagerButton = new JButton(
44: "Reload Page Manager");
45: JButton theTemplateManagerButton = new JButton(
46: "Reload Template Manager");
47: JButton theTreeStateManager = new JButton(
48: "Reload WindowTreeState Manager");
49:
50: thePageManagerButton.addActionListener(new ActionListener() {
51: public void actionPerformed(ActionEvent e) {
52: WosFramework.getInstance().initPageManager();
53: WosFramework.getInstance().persistPageManager();
54: }
55: });
56:
57: theTemplateManagerButton
58: .addActionListener(new ActionListener() {
59: public void actionPerformed(ActionEvent e) {
60: WosFramework.getInstance()
61: .initTemplateManager();
62: WosFramework.getInstance()
63: .persistTemplateManager();
64: }
65: });
66:
67: theTreeStateManager.addActionListener(new ActionListener() {
68: public void actionPerformed(ActionEvent e) {
69: WosFramework.getInstance().initWindowTreeStateManager();
70: WosFramework.getInstance()
71: .persistWindowTreeStateManager();
72: }
73: });
74:
75: add(thePageManagerButton, "theElement1");
76: add(theTemplateManagerButton, "theElement2");
77: add(theTreeStateManager, "theElement3");
78: }
79: }
|