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.LedgerPanel;
25
26 import javax.swing;
27 import java.util;
28 import java.awt.event.ActionEvent;
29
30 /**
31 * ReloadAction causes it's LedgerPanel to reload.
32 *
33 * @author $Author: bereza $
34 * @version $Revision: 1.2 $
35 * <p>
36 * $Log: ReloadAction.java,v $
37 * Revision 1.2 2000/03/30 01:57:32 bereza
38 * Added copyright header
39 *
40 * Revision 1.1 2000/03/29 02:14:36 bereza
41 * Initial revision
42 *
43 * <p>
44 * $Id: ReloadAction.java,v 1.2 2000/03/30 01:57:32 bereza Exp $
45 * @see LedgerPanel#reloadTable()
46 */
47 public class ReloadAction extends AbstractAction
48 {
49 LedgerPanel ledger;
50
51 public ReloadAction(LedgerPanel ledg, ResourceBundle guiRes)
52 {
53 ledger=ledg;
54
55 putValue(NAME, guiRes.getString(
56 "action.reload.name"));
57 putValue(SHORT_DESCRIPTION,
58 guiRes.getString(
59 "action.reload.description"));
60 putValue(SMALL_ICON, kiwi.util.KiwiUtils.getResourceManager()
61 .getIcon(guiRes.getString(
62 "action.reload.icon")));
63 }
64
65 public void actionPerformed(ActionEvent e)
66 {
67 if(isEnabled())
68 {
69 SwingUtilities.invokeLater(new Runnable()
70 {
71 public void run()
72 {
73 ledger.reloadTable();
74 }
75 });
76 }
77 }
78 }