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


Java ComponentManagerEx类代码示例

本文整理汇总了Java中com.intellij.openapi.components.ex.ComponentManagerEx的典型用法代码示例。如果您正苦于以下问题:Java ComponentManagerEx类的具体用法?Java ComponentManagerEx怎么用?Java ComponentManagerEx使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ComponentManagerEx类属于com.intellij.openapi.components.ex包,在下文中一共展示了ComponentManagerEx类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: installEP

import com.intellij.openapi.components.ex.ComponentManagerEx; //导入依赖的package包/类
protected void installEP(final ExtensionPointName<ServiceDescriptor> pointName, final ComponentManager componentManager) {
  myExtensionPointName = pointName;
  final ExtensionPoint<ServiceDescriptor> extensionPoint = Extensions.getArea(null).getExtensionPoint(pointName);
  final MutablePicoContainer picoContainer = (MutablePicoContainer)componentManager.getPicoContainer();

  myExtensionPointListener = new ExtensionPointListener<ServiceDescriptor>() {
    @Override
    public void extensionAdded(@Nonnull final ServiceDescriptor descriptor, final PluginDescriptor pluginDescriptor) {
      picoContainer.registerComponent(new MyComponentAdapter(descriptor, pluginDescriptor, (ComponentManagerEx)componentManager));
    }

    @Override
    public void extensionRemoved(@Nonnull final ServiceDescriptor extension, final PluginDescriptor pluginDescriptor) {
      picoContainer.unregisterComponent(extension.getInterface());
    }
  };
  extensionPoint.addExtensionPointListener(myExtensionPointListener);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:19,代码来源:ServiceManagerImpl.java

示例2: installEP

import com.intellij.openapi.components.ex.ComponentManagerEx; //导入依赖的package包/类
protected void installEP(@NotNull ExtensionPointName<ServiceDescriptor> pointName, @NotNull final ComponentManager componentManager) {
  LOG.assertTrue(myExtensionPointName == null, "Already called installEP with " + myExtensionPointName);
  myExtensionPointName = pointName;
  final ExtensionPoint<ServiceDescriptor> extensionPoint = Extensions.getArea(null).getExtensionPoint(pointName);
  final MutablePicoContainer picoContainer = (MutablePicoContainer)componentManager.getPicoContainer();

  myExtensionPointListener = new ExtensionPointListener<ServiceDescriptor>() {
    @Override
    public void extensionAdded(@NotNull final ServiceDescriptor descriptor, final PluginDescriptor pluginDescriptor) {
      if (descriptor.overrides) {
        // Allow to re-define service implementations in plugins.
        ComponentAdapter oldAdapter = picoContainer.unregisterComponent(descriptor.getInterface());
        if (oldAdapter == null) {
          throw new RuntimeException("Service: " + descriptor.getInterface() + " doesn't override anything");
        }
      }

      if (!ComponentManagerImpl.isComponentSuitableForOs(descriptor.os)) {
        return;
      }

      // empty serviceImplementation means we want to unregister service
      if (!StringUtil.isEmpty(descriptor.getImplementation())) {
        picoContainer.registerComponent(new MyComponentAdapter(descriptor, pluginDescriptor, (ComponentManagerEx)componentManager));
      }
    }

    @Override
    public void extensionRemoved(@NotNull final ServiceDescriptor extension, final PluginDescriptor pluginDescriptor) {
      picoContainer.unregisterComponent(extension.getInterface());
    }
  };
  extensionPoint.addExtensionPointListener(myExtensionPointListener);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:35,代码来源:ServiceManagerImpl.java

示例3: MyComponentAdapter

import com.intellij.openapi.components.ex.ComponentManagerEx; //导入依赖的package包/类
public MyComponentAdapter(final ServiceDescriptor descriptor, final PluginDescriptor pluginDescriptor, ComponentManagerEx componentManager) {
  myDescriptor = descriptor;
  myPluginDescriptor = pluginDescriptor;
  myComponentManager = componentManager;
  myDelegate = null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:7,代码来源:ServiceManagerImpl.java


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