1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/samples/componentinjection/src/org/apidesign/component/InjectionSlot.java Sat Jun 14 09:53:43 2008 +0200
1.3 @@ -0,0 +1,18 @@
1.4 +package org.apidesign.component;
1.5 +
1.6 +import java.util.Collection;
1.7 +import org.openide.util.Lookup;
1.8 +
1.9 +// BEGIN: lookup.define.slot
1.10 +public class InjectionSlot {
1.11 + public static InjectionSlot singleSlot() {
1.12 + // get one implementation
1.13 + return Lookup.getDefault().lookup(InjectionSlot.class);
1.14 + }
1.15 +
1.16 + public static Collection<? extends InjectionSlot> multiSlot() {
1.17 + // get all registered implementations
1.18 + return Lookup.getDefault().lookupAll(InjectionSlot.class);
1.19 + }
1.20 +}
1.21 +// END: lookup.define.slot