KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * $Id: FindAction.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 import javax.swing.KeyStroke JavaDoc;
16
17 import org.jdesktop.swing.actions.TargetableAction;
18
19 public class FindAction extends TargetableAction {
20
21     private final static Icon JavaDoc defaultIcon;
22
23     static {
24     // Uses JLF graphics.
25
URL JavaDoc url = FindAction.class.getResource("/toolbarButtonGraphics/general/Find24.gif");
26         defaultIcon = url == null ? null : new ImageIcon JavaDoc(url);
27     }
28
29     public FindAction() {
30         this("Find", "find", defaultIcon);
31     }
32
33     public FindAction(String JavaDoc name, String JavaDoc id, Icon JavaDoc icon) {
34         super(name, id, icon);
35         putValue(Action.SHORT_DESCRIPTION, name);
36     putValue(Action.MNEMONIC_KEY, new Integer JavaDoc('F'));
37         putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke("control F"));
38     }
39 }
40
Popular Tags