本文整理汇总了Java中org.openide.util.Lookup.getDefault方法的典型用法代码示例。如果您正苦于以下问题:Java Lookup.getDefault方法的具体用法?Java Lookup.getDefault怎么用?Java Lookup.getDefault使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.openide.util.Lookup
的用法示例。
在下文中一共展示了Lookup.getDefault方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: suite
import org.openide.util.Lookup; //导入方法依赖的package包/类
/** Executes the execution compatibility kit tests on the provided instance
* of execution engine.
*/
public static Test suite(ExecutionEngine engine) {
System.setProperty("org.openide.util.Lookup", ExecutionCompatibilityTest.class.getName() + "$Lkp");
Object o = Lookup.getDefault();
if (!(o instanceof Lkp)) {
Assert.fail("Wrong lookup object: " + o);
}
Lkp l = (Lkp)o;
l.assignExecutionEngine(engine);
if (engine != null) {
Assert.assertEquals("Same engine found", engine, ExecutionEngine.getDefault());
} else {
o = ExecutionEngine.getDefault();
Assert.assertNotNull("Engine found", o);
Assert.assertEquals(ExecutionEngine.Trivial.class, o.getClass());
}
TestSuite ts = new TestSuite();
ts.addTestSuite(ExecutionEngineHid.class);
return ts;
}
示例2: getImpls
import org.openide.util.Lookup; //导入方法依赖的package包/类
@NonNull
private static Iterable<? extends ContextProvider> getImpls() {
Lookup.Result<ContextProvider> res = impls.get();
if (res == null) {
final Lookup lkp = new ProxyLookup(
Lookup.getDefault(),
Lookups.singleton(new DefaultContextProvider()));
res = lkp.lookupResult(ContextProvider.class);
if (!impls.compareAndSet(null, res)) {
res = impls.get();
}
}
return res.allInstances();
}
示例3: add
import org.openide.util.Lookup; //导入方法依赖的package包/类
public static void add(Processor proc, Option... options) {
Lookup l = Lookup.getDefault();
Assert.assertEquals("Our class", org.netbeans.api.sendopts.Provider.class, l.getClass());
org.netbeans.api.sendopts.Provider p = (org.netbeans.api.sendopts.Provider)l;
p.ic.add(new DefProvider(options, proc));
}
示例4: findImplementation
import org.openide.util.Lookup; //导入方法依赖的package包/类
static RepositoryIndexerImplementation findImplementation(RepositoryInfo repo) {
Lookup l = Lookup.getDefault();
Collection<? extends RepositoryIndexQueryProvider> queryProviders = l.lookupAll(RepositoryIndexQueryProvider.class);
for (RepositoryIndexQueryProvider queryProvider : queryProviders) {
if(!(queryProvider instanceof NexusRepositoryIndexerImpl) && queryProvider.handlesRepository(repo)) {
// skip if
return null;
}
}
return l.lookup(RepositoryIndexerImplementation.class);
}
示例5: modulesClassPathInitialized
import org.openide.util.Lookup; //导入方法依赖的package包/类
static final void modulesClassPathInitialized(Lookup services) {
// replace the lookup by new one
Lookup lookup = Lookup.getDefault ();
StartLog.logProgress ("Got Lookup"); // NOI18N
((MainLookup)lookup).doInitializeLookup(services);
}
示例6: clearAll
import org.openide.util.Lookup; //导入方法依赖的package包/类
public static void clearAll() {
Lookup l = Lookup.getDefault();
Assert.assertEquals("Our class", org.netbeans.api.sendopts.Provider.class, l.getClass());
org.netbeans.api.sendopts.Provider p = (org.netbeans.api.sendopts.Provider)l;
p.ic.set(Collections.emptyList(), null);
}
示例7: setUp
import org.openide.util.Lookup; //导入方法依赖的package包/类
protected void setUp() throws Exception {
System.setProperty("org.openide.util.Lookup", RefusesInvalidationTest.class.getName() + "$Lkp");
super.setUp();
Lookup l = Lookup.getDefault();
if (!(l instanceof Lkp)) {
fail("Wrong lookup: " + l);
}
clearWorkDir();
}
示例8: setUp
import org.openide.util.Lookup; //导入方法依赖的package包/类
protected void setUp() throws Exception {
System.setProperty("org.openide.util.Lookup", Deadlock60917Test.class.getName() + "$Lkp");
super.setUp();
Lookup l = Lookup.getDefault();
if (!(l instanceof Lkp)) {
fail("Wrong lookup: " + l);
}
clearWorkDir();
}
示例9: run
import org.openide.util.Lookup; //导入方法依赖的package包/类
@Override
public void run(TestResult result) {
Lookup l = Lookup.getDefault();
assertEquals("We can run only with our Lookup", Lkp.class, l.getClass());
Lkp lkp = (Lkp)l;
lkp.reset();
super.run(result);
}
示例10: tearDown
import org.openide.util.Lookup; //导入方法依赖的package包/类
@Override
protected void tearDown() throws Exception {
Lookup l = Lookup.getDefault();
assertEquals(Lkp.class, l.getClass());
Lkp lkp = (Lkp)l;
// clear the lookup
lkp.ic.set(Collections.emptyList(), null);
}
示例11: getContextLookup
import org.openide.util.Lookup; //导入方法依赖的package包/类
@Override
public Lookup getContextLookup() {
return Lookup.getDefault();
}
示例12: ResultsManager
import org.openide.util.Lookup; //导入方法依赖的package包/类
private ResultsManager() {
Lookup l = Lookup.getDefault();
snapshotListeners = l.lookupResult(SnapshotsListener.class);
resultsListeners = l.lookupResult(ResultsListener.class);
}
示例13: setUp
import org.openide.util.Lookup; //导入方法依赖的package包/类
protected @Override void setUp() throws Exception {
lookup = (MIMESupportLoggingTest.TestLookup)Lookup.getDefault();
lookup.init();
}
示例14: getLookup
import org.openide.util.Lookup; //导入方法依赖的package包/类
/** Lookup that serves providers. */
public Lookup getLookup() {
return Lookup.getDefault();
}
示例15: lookup
import org.openide.util.Lookup; //导入方法依赖的package包/类
/** A lookup to work on.
* @return a lookup.
*/
protected Lookup lookup () {
Lookup l = lookup;
return l == null ? Lookup.getDefault () : l;
}