KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jdesktop > jdnc > actions > ExpandAction


1 /*
2  * $Id: ExpandAction.java,v 1.1.1.1 2004/06/16 01:43:40 davidson1 Exp $
3  *
4  * Copyright 2004 Sun Microsystems, Inc., 4150 Network Circle,
5  * Santa Clara, California 95054, U.S.A. All rights reserved.
6  */

7
8 package org.jdesktop.jdnc.actions;
9
10 import java.net.URL JavaDoc;
11
12 import javax.swing.Action JavaDoc;
13 import javax.swing.Icon JavaDoc;
14 import javax.swing.ImageIcon JavaDoc;
15
16 import org.jdesktop.swing.actions.TargetableAction;
17
18 /**
19  * Contains the visible properties of an expand action which
20  * would be invoked on a tree like structure.
21  */

22 public class ExpandAction extends TargetableAction {
23     private final static Icon JavaDoc defaultIcon;
24
25     static {
26         URL JavaDoc url = ExpandAction.class.getResource("resources/expandAll.gif");
27         defaultIcon = url == null ? null : new ImageIcon JavaDoc(url);
28     }
29
30     public ExpandAction() {
31         this("Expand All", "expand-all", defaultIcon);
32     }
33
34     public ExpandAction(String JavaDoc name, String JavaDoc id, Icon JavaDoc icon) {
35         super(name, id, icon);
36         putValue(Action.SHORT_DESCRIPTION, name);
37     }
38 }
39
Popular Tags