01: package testRename;
02:
03: import org.openide.loaders.DataObject;
04: import org.openide.nodes.Node;
05: import org.openide.util.HelpCtx;
06: import org.openide.util.NbBundle;
07: import org.openide.util.actions.CookieAction;
08:
09: public final class WhereUsedAction extends CookieAction {
10:
11: protected void performAction(Node[] activatedNodes) {
12: DataObject c = (DataObject) activatedNodes[0]
13: .getCookie(DataObject.class);
14: // TODO use c
15: }
16:
17: protected int mode() {
18: return CookieAction.MODE_EXACTLY_ONE;
19: }
20:
21: public String getName() {
22: return NbBundle.getMessage(WhereUsedAction.class,
23: "CTL_WhereUsedAction");
24: }
25:
26: protected Class[] cookieClasses() {
27: return new Class[] { DataObject.class };
28: }
29:
30: protected void initialize() {
31: super .initialize();
32: // see org.openide.util.actions.SystemAction.iconResource() javadoc for more details
33: putValue("noIconInMenu", Boolean.TRUE);
34: }
35:
36: public HelpCtx getHelpCtx() {
37: return HelpCtx.DEFAULT_HELP;
38: }
39:
40: protected boolean asynchronous() {
41: return false;
42: }
43:
44: }
|