1 package lookformyself; 2 3 import java.util.Iterator ; 4 import org.openide.filesystems.FileObject; 5 import org.openide.modules.ModuleInfo; 6 import org.openide.util.Lookup; 7 8 public class Loder extends org.openide.util.actions.CallableSystemAction { 9 10 public static boolean foundEarly; 11 12 public Loder() { 13 initialize(); 14 } 15 16 protected void initialize() { 17 foundEarly = foundNow(); 19 } 20 21 public static boolean foundNow() { 22 Iterator it = Lookup.getDefault().lookup(new Lookup.Template(ModuleInfo.class)).allInstances().iterator(); 23 while (it.hasNext()) { 24 ModuleInfo m = (ModuleInfo)it.next(); 25 if (m.getCodeNameBase().equals("lookformyself")) { 26 return true; 27 } 28 } 29 return false; 30 } 31 32 public void performAction () { 33 throw new IllegalStateException ("Never called"); 34 } 35 36 public org.openide.util.HelpCtx getHelpCtx() { 37 return org.openide.util.HelpCtx.DEFAULT_HELP; 38 } 39 40 public String getName() { 41 return "LoderAction"; 42 } 43 44 } 45 | Popular Tags |