01: package lookformyself;
02:
03: import java.util.Iterator;
04: import org.openide.filesystems.FileObject;
05: import org.openide.modules.ModuleInfo;
06: import org.openide.util.Lookup;
07:
08: public class Loder extends
09: org.openide.util.actions.CallableSystemAction {
10:
11: public static boolean foundEarly;
12:
13: public Loder() {
14: initialize();
15: }
16:
17: protected void initialize() {
18: // Now the real stuff:
19: foundEarly = foundNow();
20: }
21:
22: public static boolean foundNow() {
23: Iterator it = Lookup.getDefault().lookup(
24: new Lookup.Template(ModuleInfo.class)).allInstances()
25: .iterator();
26: while (it.hasNext()) {
27: ModuleInfo m = (ModuleInfo) it.next();
28: if (m.getCodeNameBase().equals("lookformyself")) {
29: return true;
30: }
31: }
32: return false;
33: }
34:
35: public void performAction() {
36: throw new IllegalStateException("Never called");
37: }
38:
39: public org.openide.util.HelpCtx getHelpCtx() {
40: return org.openide.util.HelpCtx.DEFAULT_HELP;
41: }
42:
43: public String getName() {
44: return "LoderAction";
45: }
46:
47: }
|