1 /*
2 * Copyright (C) 2000 Bill Bereza
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program 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
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 *
18 * Author: Bill Bereza
19 * email : bereza@pobox.com
20 * url : http://www.pobox.com/~bereza/
21 */
22 package net.bereza.money.gui.action;
23
24 import net.bereza.money.gui.Main;
25
26 import javax.swing;
27 import java.util;
28 import java.awt.event.ActionEvent;
29
30 import kiwi.ui.model.DocumentDataSource;
31 import kiwi.ui.DocumentBrowserFrame;
32
33 /**
34 * IndexAction sets the index.
35 *
36 * @author $Author: bereza $
37 * @version $Revision: 1.2 $
38 * <p>
39 * $Log: IndexAction.java,v $
40 * Revision 1.2 2000/03/30 01:57:31 bereza
41 * Added copyright header
42 *
43 * Revision 1.1 2000/03/29 02:02:21 bereza
44 * Initial revision
45 *
46 * <p>
47 * $Id: IndexAction.java,v 1.2 2000/03/30 01:57:31 bereza Exp $
48 */
49 public class IndexAction extends AbstractAction
50 {
51 java.awt.Frame parentFrame;
52 DocumentBrowserFrame docFrame;
53 ResourceBundle guiRes;
54 DocumentDataSource docData;
55
56 public IndexAction(java.awt.Frame parent, ResourceBundle guiRes)
57 {
58 parentFrame=parent;
59 this.guiRes=guiRes;
60
61 putValue(NAME, guiRes.getString(
62 "action.help.index.name"));
63 putValue(SHORT_DESCRIPTION,
64 guiRes.getString(
65 "action.help.index.description"));
66 putValue(SMALL_ICON, kiwi.util.KiwiUtils.getResourceManager()
67 .getIcon(guiRes.getString(
68 "action.help.index.icon")));
69 }
70
71 public void actionPerformed(ActionEvent e)
72 {
73 if(isEnabled())
74 {
75 SwingUtilities.invokeLater(new Runnable()
76 {
77 public void run()
78 {
79 if(docFrame == null)
80 {
81 if(docData == null)
82 {
83 docData=new DocumentDataSource(Main.resMgr,
84 guiRes.getString(
85 "action.help.index.doc.description"),
86 guiRes.getString(
87 "action.help.index.doc.basePath"));
88 }
89 docFrame=new DocumentBrowserFrame(guiRes.getString(
90 "action.help.index.doc.frame.title"),
91 guiRes.getString(
92 "action.help.index.doc.frame.comment"),
93 docData);
94
95 kiwi.util.KiwiUtils.cascadeWindow(parentFrame, docFrame);
96 docFrame.setSize(540, 360);
97 docFrame.setIconImage(Main.iconImage);
98 }
99 docFrame.setVisible(true);
100 }
101 });
102 }
103 }
104 }