1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 package net.sf.jour.rt.swingmonitor.ui.action;
22
23 import java.awt.Component;
24 import java.awt.event.ActionEvent;
25
26 import javax.swing.AbstractAction;
27 import javax.swing.JTabbedPane;
28
29 import net.sf.jour.rt.swingmonitor.MonitoringJPanel;
30
31
32
33 /***
34 * TODO Add docs
35 *
36 * Created on 15.12.2004
37 * Contributing Author(s):
38 *
39 * Misha Lifschitz <mishalifschitz at users.sourceforge.net> (Inital implementation)
40 * Vlad Skarzhevskyy <vlads at users.sourceforge.net> (Inital implementation)
41 *
42 * @author vlads
43 * @version $Revision: 1.2 $ ($Author: vlads $) $Date: 2004/12/16 05:35:55 $
44 */
45 public class UpdateCurrentTabAction extends AbstractAction {
46
47 private JTabbedPane tabbedPane = null;
48
49 /***
50 * @param tabbedPane
51 */
52 public UpdateCurrentTabAction(JTabbedPane tabbedPane) {
53 super("Update");
54 this.tabbedPane = tabbedPane;
55 }
56
57 public boolean isEnabled() {
58 return true;
59 }
60
61 public boolean isEnabled_TODO() {
62 Component comp = tabbedPane.getSelectedComponent();
63 if (comp instanceof MonitoringJPanel) {
64 return true;
65 }
66 return false;
67 }
68
69 /***
70 * Method actionPerformed
71 */
72 public void actionPerformed(ActionEvent e) {
73 Component comp = tabbedPane.getSelectedComponent();
74 if (!isEnabled_TODO()) {
75 return;
76 }
77 ((MonitoringJPanel) comp).updateData();
78 }
79 }