1 19 20 package org.netbeans.api.enode; 21 22 import org.openide.ErrorManager; 23 import org.openide.util.Lookup; 24 25 import org.netbeans.modules.enode.ExtensibleLookupImpl; 26 27 32 public class ExtensibleLookup extends Lookup { 33 34 38 private ExtensibleLookupImpl impl; 39 40 43 private ExtensibleNode myNode; 44 45 51 public ExtensibleLookup(ExtensibleNode en) { 52 myNode = en; 53 } 54 55 59 public ExtensibleLookup() { 60 } 61 62 65 public void setNode(ExtensibleNode en) { 66 myNode = en; 67 if (impl != null) { 68 impl.setExtensibleNode(myNode); 69 } 70 } 71 72 75 public Object lookup(Class clazz) { 76 initializeImpl(); 77 return impl.lookup(clazz); 78 } 79 80 83 public Result lookup(Template template) { 84 initializeImpl(); 85 return impl.lookup(template); 86 } 87 88 91 private void initializeImpl() { 92 if (impl == null) { 93 impl = new ExtensibleLookupImpl(); 94 impl.setExtensibleNode(myNode); 95 } 96 } 97 98 } 99 | Popular Tags |