• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java ComponentManager类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: collect

import com.intellij.openapi.components.ComponentManager; //导入依赖的package包/类
private static void collect(@NotNull ComponentManager componentManager,
                            @NotNull  Set<String> unknownMacros,
                            @NotNull Map<TrackingPathMacroSubstitutor, IComponentStore> substitutorToStore) {
  IComponentStore store = ServiceKt.getStateStore(componentManager);
  TrackingPathMacroSubstitutor substitutor = store.getStateStorageManager().getMacroSubstitutor();
  if (substitutor == null) {
    return;
  }

  Set<String> macros = substitutor.getUnknownMacros(null);
  if (macros.isEmpty()) {
    return;
  }

  unknownMacros.addAll(macros);
  substitutorToStore.put(substitutor, store);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:StorageUtil.java


示例2: getSdkHomePath

import com.intellij.openapi.components.ComponentManager; //导入依赖的package包/类
@Override
public String getSdkHomePath(@Nullable final Module module) {
    if (isSquirrelModule(module)) {
        ComponentManager holder = ObjectUtils.notNull(module, myProject);
        return CachedValuesManager.getManager(myProject).getCachedValue(holder, new CachedValueProvider<String>() {
            @Nullable
            @Override
            public Result<String> compute() {
                Sdk sdk = getSquirrelSdk(module);
                return Result.create(sdk != null ? sdk.getHomePath() : null, SquirrelIdeaSdkService.this);
            }
        });
    }
    else {
        return super.getSdkHomePath(module);
    }
}
 
开发者ID:shvetsgroup,项目名称:squirrel-lang-idea-plugin,代码行数:18,代码来源:SquirrelIdeaSdkService.java


示例3: getSdkVersion

import com.intellij.openapi.components.ComponentManager; //导入依赖的package包/类
@Nullable
@Override
public String getSdkVersion(@Nullable final Module module) {
    if (isSquirrelModule(module)) {
        ComponentManager holder = ObjectUtils.notNull(module, myProject);
        return CachedValuesManager.getManager(myProject).getCachedValue(holder, new CachedValueProvider<String>() {
            @Nullable
            @Override
            public Result<String> compute() {
                Sdk sdk = getSquirrelSdk(module);
                return Result.create(sdk != null ? sdk.getVersionString() : null, SquirrelIdeaSdkService.this);
            }
        });
    }
    else {
        return super.getSdkVersion(module);
    }
}
 
开发者ID:shvetsgroup,项目名称:squirrel-lang-idea-plugin,代码行数:19,代码来源:SquirrelIdeaSdkService.java


示例4: getSdkVersion

import com.intellij.openapi.components.ComponentManager; //导入依赖的package包/类
@Nullable
public String getSdkVersion(@Nullable final Module module) {
    ComponentManager holder = ObjectUtils.notNull(module, myProject);
    return CachedValuesManager.getManager(myProject).getCachedValue(holder, new CachedValueProvider<String>() {
        @Nullable
        @Override
        public Result<String> compute() {
            String result = null;
            String sdkHomePath = getSdkHomePath(module);
            if (sdkHomePath != null) {
                result = SquirrelSdkUtil.retrieveSquirrelVersion(sdkHomePath);
            }
            return Result.create(result, SquirrelSdkService.this);
        }
    });
}
 
开发者ID:shvetsgroup,项目名称:squirrel-lang-idea-plugin,代码行数:17,代码来源:SquirrelSdkService.java


示例5: installEP

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

  final MutablePicoContainer picoContainer = (MutablePicoContainer)componentManager.getPicoContainer();

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

      picoContainer.registerComponent(new MyComponentAdapter(descriptor, pluginDescriptor, (ComponentManagerEx)componentManager));
    }

    public void extensionRemoved(@NotNull final ServiceDescriptor extension, final PluginDescriptor pluginDescriptor) {
      picoContainer.unregisterComponent(extension.getInterface());
    }
  };
  extensionPoint.addExtensionPointListener(myExtensionPointListener);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:27,代码来源:ServiceManagerImpl.java


示例6: run

import com.intellij.openapi.components.ComponentManager; //导入依赖的package包/类
@Override
public void run() {
  Object res = get();
  if (res == null) return;

  if (res instanceof PsiElement) {
    if (!((PsiElement)res).isValid()) return;
  }
  else if (res instanceof ComponentManager) {
    if (((ComponentManager)res).isDisposed()) return;
  }

  myDelegate.run();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:DisposeAwareRunnable.java


示例7: installEP

import com.intellij.openapi.components.ComponentManager; //导入依赖的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


示例8: getSdkHomeLibPath

import com.intellij.openapi.components.ComponentManager; //导入依赖的package包/类
private String getSdkHomeLibPath(@Nullable Module module) {
    ComponentManager holder = ObjectUtils.notNull(module, myProject);
    return CachedValuesManager.getManager(myProject).getCachedValue(holder, new CachedValueProvider<String>() {
        @Nullable
        @Override
        public Result<String> compute() {
            return Result.create(ApplicationManager.getApplication().runReadAction(new Computable<String>() {
                @Nullable
                @Override
                public String compute() {
                    LibraryTable table = LibraryTablesRegistrar.getInstance().getLibraryTable(myProject);
                    for (Library library : table.getLibraries()) {
                        String libraryName = library.getName();
                        if (libraryName != null && libraryName.startsWith(LIBRARY_NAME)) {
                            for (VirtualFile root : library.getFiles(OrderRootType.CLASSES)) {
                                if (isSquirrelSdkLibRoot(root)) {
                                    return root.getCanonicalPath();
                                }
                            }
                        }
                    }
                    return null;
                }
            }), SquirrelSdkService.this);
        }
    });
}
 
开发者ID:shvetsgroup,项目名称:squirrel-lang-idea-plugin,代码行数:28,代码来源:SquirrelSdkService.java


示例9: loadStorageFile

import com.intellij.openapi.components.ComponentManager; //导入依赖的package包/类
public static StorageData loadStorageFile(ComponentManager componentManager, VirtualFile modulesXml) throws JDOMException, IOException {
  final Document document = JDOMUtil.loadDocument(new ByteArrayInputStream(modulesXml.contentsToByteArray()));
  StorageData storageData = new StorageData("project");
  final Element element = document.getRootElement();
  PathMacroManager.getInstance(componentManager).expandPaths(element);
  storageData.load(element);
  return storageData;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:9,代码来源:CoreProjectLoader.java


示例10: loadStorageFile

import com.intellij.openapi.components.ComponentManager; //导入依赖的package包/类
@NotNull
public static TreeMap<String, Element> loadStorageFile(@NotNull ComponentManager componentManager, @NotNull VirtualFile modulesXml) throws JDOMException, IOException {
  return FileStorageCoreUtil.load(JDOMUtil.loadDocument(modulesXml.contentsToByteArray()).getRootElement(), PathMacroManager.getInstance(componentManager), false);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:CoreProjectLoader.java


示例11: DisposeAwareProjectChange

import com.intellij.openapi.components.ComponentManager; //导入依赖的package包/类
protected DisposeAwareProjectChange(@NotNull ComponentManager componentManager) {
  myComponentManager = componentManager;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:DisposeAwareProjectChange.java


示例12: registerComponentInstance

import com.intellij.openapi.components.ComponentManager; //导入依赖的package包/类
public static <T> T registerComponentInstance(final ComponentManager container, final Class<T> key, final T implementation) {
  return registerComponentInstance((MutablePicoContainer)container.getPicoContainer(), key, implementation);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:PlatformLiteFixture.java


示例13: ConfigurablesGroupBase

import com.intellij.openapi.components.ComponentManager; //导入依赖的package包/类
protected ConfigurablesGroupBase(ComponentManager componentManager, final ExtensionPointName<ConfigurableEP<Configurable>> configurablesExtensionPoint,
                                 boolean loadComponents) {
  myComponentManager = componentManager;
  myConfigurablesExtensionPoint = configurablesExtensionPoint;
  myLoadComponents = loadComponents;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:7,代码来源:ConfigurablesGroupBase.java


示例14: PlatformComponentManagerImpl

import com.intellij.openapi.components.ComponentManager; //导入依赖的package包/类
protected PlatformComponentManagerImpl(@Nullable ComponentManager parent) {
  super(parent);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:PlatformComponentManagerImpl.java


示例15: ComponentManagerImpl

import com.intellij.openapi.components.ComponentManager; //导入依赖的package包/类
protected ComponentManagerImpl(@Nullable ComponentManager parentComponentManager) {
  myParentComponentManager = parentComponentManager;
  bootstrapPicoContainer(toString());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:ComponentManagerImpl.java


示例16: getParentComponentManager

import com.intellij.openapi.components.ComponentManager; //导入依赖的package包/类
protected final ComponentManager getParentComponentManager() {
  return myParentComponentManager;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:ComponentManagerImpl.java


示例17: DisposeAwareProjectChange

import com.intellij.openapi.components.ComponentManager; //导入依赖的package包/类
protected DisposeAwareProjectChange(@Nonnull ComponentManager componentManager) {
  myComponentManager = componentManager;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:4,代码来源:DisposeAwareProjectChange.java


示例18: getInstance

import com.intellij.openapi.components.ComponentManager; //导入依赖的package包/类
@Nonnull
public MultiHostInjector getInstance(@Nonnull ComponentManager componentManager) {
  return instantiate(myImplementationClassHandler.getValue(), componentManager.getPicoContainer());
}
 
开发者ID:consulo,项目名称:consulo,代码行数:5,代码来源:MultiHostInjectorExtensionPoint.java


示例19: PlatformComponentManagerImpl

import com.intellij.openapi.components.ComponentManager; //导入依赖的package包/类
protected PlatformComponentManagerImpl(ComponentManager parent) {
  super(parent);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:4,代码来源:PlatformComponentManagerImpl.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java PaxosState类代码示例发布时间:2022-05-22
下一篇:
Java Location类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap