當前位置: 首頁>>代碼示例>>Java>>正文


Java Extensions.instantiateArea方法代碼示例

本文整理匯總了Java中com.intellij.openapi.extensions.Extensions.instantiateArea方法的典型用法代碼示例。如果您正苦於以下問題:Java Extensions.instantiateArea方法的具體用法?Java Extensions.instantiateArea怎麽用?Java Extensions.instantiateArea使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.intellij.openapi.extensions.Extensions的用法示例。


在下文中一共展示了Extensions.instantiateArea方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: CoreModule

import com.intellij.openapi.extensions.Extensions; //導入方法依賴的package包/類
public CoreModule(@NotNull Disposable parentDisposable, @NotNull Project project, String moduleFilePath) {
  super(project.getPicoContainer(), parentDisposable);
  myLifetime = parentDisposable;
  myProject = project;
  myPath = moduleFilePath;

  Extensions.instantiateArea(ExtensionAreas.IDEA_MODULE, this, null);
  Disposer.register(parentDisposable, new Disposable() {
    @Override
    public void dispose() {
      Extensions.disposeArea(CoreModule.this);
    }
  });
  initModuleExtensions();

  final ModuleRootManagerImpl moduleRootManager =
    new ModuleRootManagerImpl(this,
                              ProjectRootManagerImpl.getInstanceImpl(project),
                              VirtualFilePointerManager.getInstance()) {
      @Override
      public void loadState(ModuleRootManagerState object) {
        loadState(object, false);
      }
    };
  Disposer.register(parentDisposable, new Disposable() {
    @Override
    public void dispose() {
      moduleRootManager.disposeComponent();
    }
  });
  getPicoContainer().registerComponentInstance(ModuleRootManager.class, moduleRootManager);
  getPicoContainer().registerComponentInstance(PathMacroManager.class, createModulePathMacroManager(project));
  getPicoContainer().registerComponentInstance(ModuleFileIndex.class, createModuleFileIndex(project));
  myModuleScopeProvider = createModuleScopeProvider();
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:36,代碼來源:CoreModule.java

示例2: MockProject

import com.intellij.openapi.extensions.Extensions; //導入方法依賴的package包/類
public MockProject(PicoContainer parent, @NotNull Disposable parentDisposable) {
  super(parent, parentDisposable);
  Extensions.instantiateArea(ExtensionAreas.IDEA_PROJECT, this, null);
  Disposer.register(parentDisposable, new Disposable() {
    @Override
    public void dispose() {
      Extensions.disposeArea(MockProject.this);
    }
  });
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:11,代碼來源:MockProject.java

示例3: testPluginInit

import com.intellij.openapi.extensions.Extensions; //導入方法依賴的package包/類
@Test
public void testPluginInit() throws Exception {
  initExtensionPoints(
    PLUGIN_NAME, "<extensionPoints>\n" +
                 "  <extensionPoint name=\"extensionPoint\" beanClass=\"com.intellij.openapi.extensions.impl.XMLTestBean\" />\n" +
                 "  <extensionPoint name=\"dependentOne\" beanClass=\"com.intellij.openapi.extensions.impl.DependentObjectOne\" />\n" +
                 "</extensionPoints>", null);
  initExtensions(
    "  <extensions xmlns=\"the.test.plugin\">\n" +
    "    <extensionPoint>\n" +
    "      <prop1>321</prop1>\n" +
    "    </extensionPoint>\n" +
    "    <dependentOne/>\n" +
    "  </extensions>", null);

  assertTrue(Extensions.getRootArea().hasExtensionPoint("the.test.plugin.extensionPoint"));
  assertEquals(1, Extensions.getExtensions("the.test.plugin.extensionPoint").length);
  ExtensionPoint<XMLTestBean> ep = Extensions.getRootArea().getExtensionPoint("the.test.plugin.extensionPoint");
  XMLTestBean bean = ep.getExtension();
  assertNotNull(bean);
  assertEquals(321, bean.getProp1());
  assertEquals("the.test.plugin", bean.getPluginId().getIdString());

  DependentObjectOne dependentObjectOne = (DependentObjectOne)Extensions.getRootArea().getExtensionPoint("the.test.plugin.dependentOne").getExtension();
  assertNotNull(dependentObjectOne);
  assertEquals(1, dependentObjectOne.getTestBeans().length);

  AreaInstance areaInstance = new MyAreaInstance();
  Extensions.instantiateArea("area", areaInstance, null);

  initExtensionPoints(
    PLUGIN_NAME,
    "<extensionPoints>\n" +
    "  <extensionPoint name=\"dependentTwo\" beanClass=\"com.intellij.openapi.extensions.impl.DependentObjectTwo\" area=\"area\"/>\n" +
    "  <extensionPoint name=\"extensionPoint4area\" beanClass=\"com.intellij.openapi.extensions.impl.XMLTestBean\" area=\"area\" />\n" +
    "</extensionPoints>", areaInstance);

  initExtensions(
    "  <extensions xmlns=\"the.test.plugin\">\n" +
    "    <extensionPoint4area area=\"area\"/>\n" +
    "    <dependentTwo area=\"area\"/>\n" +
    "  </extensions>", areaInstance);

  ExtensionPoint extensionPoint = Extensions.getArea(areaInstance).getExtensionPoint("the.test.plugin.extensionPoint4area");
  assertNotNull(extensionPoint);
  assertSame(areaInstance, extensionPoint.getArea());
  assertNotNull(extensionPoint.getExtension());

  DependentObjectTwo dependentObjectTwo = (DependentObjectTwo)Extensions.getArea(areaInstance).getExtensionPoint("the.test.plugin.dependentTwo").getExtension();
  assertNotNull(dependentObjectTwo);
  assertSame(dependentObjectOne, dependentObjectTwo.getOne());
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:53,代碼來源:ExtensionsComplexTest.java

示例4: bootstrapPicoContainer

import com.intellij.openapi.extensions.Extensions; //導入方法依賴的package包/類
@Override
protected void bootstrapPicoContainer(@NotNull String name) {
  Extensions.instantiateArea(ExtensionAreas.IDEA_MODULE, this, (AreaInstance)getParentComponentManager());
  super.bootstrapPicoContainer(name);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:6,代碼來源:ModuleImpl.java


注:本文中的com.intellij.openapi.extensions.Extensions.instantiateArea方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。