KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * $Id: CollapseAction.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 a collape action which
20  * would be invoked on a tree like structure.
21  *
22  * @author Ramesh Gupta
23  */

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