1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package org.xnap.gui.action;
21
22 import java.awt.event.ActionEvent;
23
24 import javax.swing.AbstractAction;
25 import javax.swing.Action;
26 import javax.swing.JTree;
27
28 import org.xnap.XNap;
29 import org.xnap.gui.util.GUIHelper;
30 import org.xnap.gui.util.IconHelper;
31
32 /***
33 * Provides an action that expands all nodes of a {@link JTree}.
34 */
35 public class ExpandAllNodesAction extends AbstractAction
36 {
37
38
39
40
41
42 private JTree jt;
43
44
45
46 public ExpandAllNodesAction(JTree jt)
47 {
48 this.jt = jt;
49
50 putValue(Action.NAME, XNap.tr("Expand All"));
51 putValue(Action.SHORT_DESCRIPTION, XNap.tr("Expands all nodes."));
52 putValue(IconHelper.XNAP_ICON, "edit_add.png");
53 }
54
55
56
57 public void actionPerformed(ActionEvent event)
58 {
59 GUIHelper.expandAllNodes(jt);
60 }
61
62 }