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.AboutFrame;
31
32 /**
33 * UpdatesAction sets the updates.
34 *
35 * @author $Author: bereza $
36 * @version $Revision: 1.2 $
37 * <p>
38 * $Log: UpdatesAction.java,v $
39 * Revision 1.2 2000/03/30 01:57:33 bereza
40 * Added copyright header
41 *
42 * Revision 1.1 2000/03/29 02:01:14 bereza
43 * Initial revision
44 *
45 * <p>
46 * $Id: UpdatesAction.java,v 1.2 2000/03/30 01:57:33 bereza Exp $
47 */
48 public class UpdatesAction extends AbstractAction
49 {
50 java.awt.Frame parentFrame;
51 AboutFrame docFrame;
52 ResourceBundle guiRes;
53
54 public UpdatesAction(java.awt.Frame parent, ResourceBundle guiRes)
55 {
56 parentFrame=parent;
57 this.guiRes=guiRes;
58
59 putValue(NAME, guiRes.getString(
60 "action.help.updates.name"));
61 putValue(SHORT_DESCRIPTION,
62 guiRes.getString(
63 "action.help.updates.description"));
64 putValue(SMALL_ICON, kiwi.util.KiwiUtils.getResourceManager()
65 .getIcon(guiRes.getString(
66 "action.help.updates.icon")));
67 }
68
69 public void actionPerformed(ActionEvent e)
70 {
71 if(isEnabled())
72 {
73 SwingUtilities.invokeLater(new Runnable()
74 {
75 public void run()
76 {
77 try
78 {
79 if(docFrame == null)
80 {
81 docFrame=new AboutFrame(guiRes.getString(
82 "action.help.updates.frame.title"),
83 new java.net.URL(guiRes.getString(
84 "action.help.updates.frame.url")));
85
86
87 kiwi.util.KiwiUtils.cascadeWindow(parentFrame, docFrame);
88 //docFrame.setSize(540, 360);
89 docFrame.setIconImage(Main.iconImage);
90 }
91 docFrame.setVisible(true);
92 }
93 catch(java.net.MalformedURLException me)
94 {
95 kiwi.ui.dialog.DialogSet.getInstance().showMessageDialog(me.getMessage());
96 }
97 }
98 });
99 }
100 }
101 }