当前位置: 首页>>代码示例>>Java>>正文


Java Lookup.getDefault方法代码示例

本文整理汇总了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;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:27,代码来源:ExecutionCompatibilityTest.java

示例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();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:15,代码来源:ContextProvider.java

示例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));
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:8,代码来源:Provider.java

示例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);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:12,代码来源:RepositoryIndexer.java

示例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);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:8,代码来源:MainLookup.java

示例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);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:8,代码来源:Provider.java

示例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();
  }
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:13,代码来源:RefusesInvalidationTest.java

示例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();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:13,代码来源:Deadlock60917Test.java

示例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);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:10,代码来源:LoggingTestCaseHid.java

示例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);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:9,代码来源:StreamingTest.java

示例11: getContextLookup

import org.openide.util.Lookup; //导入方法依赖的package包/类
@Override
public Lookup getContextLookup() {
    return Lookup.getDefault();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:5,代码来源:TestEnvironmentFactory.java

示例12: ResultsManager

import org.openide.util.Lookup; //导入方法依赖的package包/类
private ResultsManager() {
    Lookup l = Lookup.getDefault();
    snapshotListeners = l.lookupResult(SnapshotsListener.class);
    resultsListeners = l.lookupResult(ResultsListener.class);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:6,代码来源:ResultsManager.java

示例13: setUp

import org.openide.util.Lookup; //导入方法依赖的package包/类
protected @Override void setUp() throws Exception {
    lookup = (MIMESupportLoggingTest.TestLookup)Lookup.getDefault();
    lookup.init();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:5,代码来源:MIMESupportLoggingTest.java

示例14: getLookup

import org.openide.util.Lookup; //导入方法依赖的package包/类
/** Lookup that serves providers. */
public Lookup getLookup() {
    return Lookup.getDefault();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:5,代码来源:Turbo.java

示例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;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:8,代码来源:ObjectEditor.java


注:本文中的org.openide.util.Lookup.getDefault方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。