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

Java PluginManagerCore类代码示例

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

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



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

示例1: createHelpSet

import com.intellij.ide.plugins.PluginManagerCore; //导入依赖的package包/类
@Nullable
private static HelpSet createHelpSet() {
  String urlToHelp = ApplicationInfo.getInstance().getHelpURL() + "/" + HELP_HS;
  HelpSet mainHelpSet = loadHelpSet(urlToHelp);
  if (mainHelpSet == null) return null;

  // merge plugins help sets
  IdeaPluginDescriptor[] pluginDescriptors = PluginManagerCore.getPlugins();
  for (IdeaPluginDescriptor pluginDescriptor : pluginDescriptors) {
    HelpSetPath[] sets = pluginDescriptor.getHelpSets();
    for (HelpSetPath hsPath : sets) {
      String url = "jar:file:///" + pluginDescriptor.getPath().getAbsolutePath() + "/help/" + hsPath.getFile() + "!";
      if (!hsPath.getPath().startsWith("/")) {
        url += "/";
      }
      url += hsPath.getPath();
      HelpSet pluginHelpSet = loadHelpSet(url);
      if (pluginHelpSet != null) {
        mainHelpSet.add(pluginHelpSet);
      }
    }
  }

  return mainHelpSet;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:HelpManagerImpl.java


示例2: loadOldPlugins

import com.intellij.ide.plugins.PluginManagerCore; //导入依赖的package包/类
private static boolean loadOldPlugins(File plugins, File dest) throws IOException {
  if (plugins.exists()) {
    List<IdeaPluginDescriptorImpl> descriptors = new SmartList<IdeaPluginDescriptorImpl>();
    PluginManagerCore.loadDescriptors(plugins, descriptors, null, 0);
    List<String> oldPlugins = new SmartList<String>();
    for (IdeaPluginDescriptorImpl descriptor : descriptors) {
      // check isBundled also - probably plugin is bundled in new IDE version
      if (descriptor.isEnabled() && !descriptor.isBundled()) {
        oldPlugins.add(descriptor.getPluginId().getIdString());
      }
    }
    if (!oldPlugins.isEmpty()) {
      PluginManagerCore.savePluginsList(oldPlugins, false, new File(dest, PluginManager.INSTALLED_TXT));
    }
    return true;
  }
  return false;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:ConfigImportHelper.java


示例3: runStartupWizard

import com.intellij.ide.plugins.PluginManagerCore; //导入依赖的package包/类
static void runStartupWizard() {
  ApplicationInfoEx appInfo = ApplicationInfoImpl.getShadowInstance();

  String stepsProvider = appInfo.getCustomizeIDEWizardStepsProvider();
  if (stepsProvider != null) {
    CustomizeIDEWizardDialog.showCustomSteps(stepsProvider);
    PluginManagerCore.invalidatePlugins();
    return;
  }

  if (PlatformUtils.isIntelliJ()) {
    new CustomizeIDEWizardDialog().show();
    PluginManagerCore.invalidatePlugins();
    return;
  }

  List<ApplicationInfoEx.PluginChooserPage> pages = appInfo.getPluginChooserPages();
  if (!pages.isEmpty()) {
    StartupWizard startupWizard = new StartupWizard(pages);
    startupWizard.setCancelText("Skip");
    startupWizard.show();
    PluginManagerCore.invalidatePlugins();
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:25,代码来源:StartupUtil.java


示例4: getComponentConfigs

import com.intellij.ide.plugins.PluginManagerCore; //导入依赖的package包/类
@NotNull
private List<ComponentConfig> getComponentConfigs() {
  ArrayList<ComponentConfig> componentConfigs = new ArrayList<ComponentConfig>();
  boolean isDefaultProject = this instanceof Project && ((Project)this).isDefault();
  boolean headless = ApplicationManager.getApplication().isHeadlessEnvironment();
  for (IdeaPluginDescriptor plugin : PluginManagerCore.getPlugins()) {
    if (PluginManagerCore.shouldSkipPlugin(plugin)) {
      continue;
    }

    ComponentConfig[] configs = getMyComponentConfigsFromDescriptor(plugin);
    componentConfigs.ensureCapacity(componentConfigs.size() + configs.length);
    for (ComponentConfig config : configs) {
      if ((!isDefaultProject || config.isLoadForDefaultProject()) && isComponentSuitable(config.options) && config.prepareClasses(headless)) {
        config.pluginDescriptor = plugin;
        componentConfigs.add(config);
      }
    }
  }
  return componentConfigs;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:ComponentManagerImpl.java


示例5: tryLoadingClass

import com.intellij.ide.plugins.PluginManagerCore; //导入依赖的package包/类
@Nullable
private Class tryLoadingClass(@NotNull String name, final boolean resolve) {
  Class c = loadClassInsideSelf(name);

  if (c == null) {
    c = loadClassFromParents(name);
  }

  if (c != null) {
    if (resolve) {
      resolveClass(c);
    }
    return c;
  }

  PluginManagerCore.addPluginClass(name, myPluginId, false);
  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:PluginClassLoader.java


示例6: getPluginResourcesRootName

import com.intellij.ide.plugins.PluginManagerCore; //导入依赖的package包/类
@Nullable
private String getPluginResourcesRootName(VirtualFile resourcesDir) throws IOException {
  PluginId ownerPluginId = getOwner(resourcesDir);
  if (ownerPluginId == null) return null;

  if (PluginManagerCore.CORE_PLUGIN_ID.equals(ownerPluginId.getIdString())) {
    return PlatformUtils.getPlatformPrefix();
  }

  IdeaPluginDescriptor plugin = PluginManager.getPlugin(ownerPluginId);
  if (plugin != null) {
    return plugin.getName();
  }

  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:ExtensionsRootType.java


示例7: checkJetBrainsPlugin

import com.intellij.ide.plugins.PluginManagerCore; //导入依赖的package包/类
private static void checkJetBrainsPlugin(IdeaPlugin ideaPlugin, DomElementAnnotationHolder holder) {
  final Module module = ideaPlugin.getModule();
  if (module == null) return;
  if (!PsiUtil.isIdeaProject(module.getProject())) return;

  String pluginId = ideaPlugin.getPluginId();
  if (pluginId == null || pluginId.equals(PluginManagerCore.CORE_PLUGIN_ID)) return;

  final Vendor vendor = ContainerUtil.getFirstItem(ideaPlugin.getVendors());
  if (vendor == null) {
    holder.createProblem(DomUtil.getFileElement(ideaPlugin), "Plugin developed as a part of IntelliJ IDEA project should specify 'JetBrains' as its vendor",
                         new SpecifyJetBrainsAsVendorQuickFix());
  }
  else if (!PluginManagerMain.isDevelopedByJetBrains(vendor.getValue())) {
    holder.createProblem(vendor, "Plugin developed as a part of IntelliJ IDEA project should include 'JetBrains' as one of its vendors");
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:PluginXmlDomInspection.java


示例8: readPluginIdFromJar

import com.intellij.ide.plugins.PluginManagerCore; //导入依赖的package包/类
@Nullable
private static String readPluginIdFromJar(String buildNumber, File jar)
    throws ExecutionException {
  IdeaPluginDescriptor pluginDescriptor = PluginManagerCore.loadDescriptor(jar, "plugin.xml");
  if (pluginDescriptor == null) {
    return null;
  }
  if (PluginManagerCore.isIncompatible(pluginDescriptor, BuildNumber.fromString(buildNumber))) {
    throw new ExecutionException(
        String.format(
            "Plugin SDK version '%s' is incompatible with this plugin "
                + "(since: '%s', until: '%s')",
            buildNumber, pluginDescriptor.getSinceBuild(), pluginDescriptor.getUntilBuild()));
  }
  return pluginDescriptor.getPluginId().getIdString();
}
 
开发者ID:bazelbuild,项目名称:intellij,代码行数:17,代码来源:BlazeIntellijPluginDeployer.java


示例9: loadClass

import com.intellij.ide.plugins.PluginManagerCore; //导入依赖的package包/类
public Class loadClass(@NotNull String name, final boolean resolve) throws ClassNotFoundException {
  Class c = loadClassInsideSelf(name);

  if (c == null) {
    c = loadClassFromParents(name);
  }

  if (c != null) {
    if (resolve) {
      resolveClass(c);
    }
    return c;
  }

  PluginManagerCore.addPluginClass(name, myPluginId, false);
  throw new ClassNotFoundException(name + " " + this);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:18,代码来源:PluginClassLoader.java


示例10: getComponentPresentableName

import com.intellij.ide.plugins.PluginManagerCore; //导入依赖的package包/类
@Nonnull
private static String getComponentPresentableName(@Nonnull State state, @Nonnull Class<?> aClass, @Nullable PluginDescriptor pluginDescriptor) {
  String defaultName = state.name();
  String resourceBundleName;
  if (pluginDescriptor != null && pluginDescriptor instanceof IdeaPluginDescriptor && !PluginManagerCore.CORE_PLUGIN.equals(pluginDescriptor.getPluginId())) {
    resourceBundleName = ((IdeaPluginDescriptor)pluginDescriptor).getResourceBundleBaseName();
  }
  else {
    resourceBundleName = OptionsBundle.PATH_TO_BUNDLE;
  }

  if (resourceBundleName == null) {
    return defaultName;
  }

  ClassLoader classLoader = pluginDescriptor == null ? null : pluginDescriptor.getPluginClassLoader();
  classLoader = classLoader == null ? aClass.getClassLoader() : classLoader;
  if (classLoader != null) {
    ResourceBundle bundle = AbstractBundle.getResourceBundle(resourceBundleName, classLoader);
    if (bundle != null) {
      return CommonBundle.messageOrDefault(bundle, "exportable." + defaultName + ".presentable.name", defaultName);
    }
  }
  return defaultName;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:26,代码来源:ExportSettingsAction.java


示例11: loadClassInsideSelf

import com.intellij.ide.plugins.PluginManagerCore; //导入依赖的package包/类
@Nullable
private synchronized Class loadClassInsideSelf(@Nonnull String name) {
  Class c = findLoadedClass(name);
  if (c != null) {
    return c;
  }

  try {
    c = _findClass(name);
  }
  catch (IncompatibleClassChangeError | UnsupportedClassVersionError e) {
    throw new PluginException("While loading class " + name + ": " + e.getMessage(), e, myPluginId);
  }
  if (c != null) {
    PluginManagerCore.addPluginClass(myPluginId);
  }

  return c;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:20,代码来源:PluginClassLoader.java


示例12: createHelpSet

import com.intellij.ide.plugins.PluginManagerCore; //导入依赖的package包/类
@javax.annotation.Nullable
private static HelpSet createHelpSet() {
  String urlToHelp = ApplicationInfo.getInstance().getHelpURL() + "/" + HELP_HS;
  HelpSet mainHelpSet = loadHelpSet(urlToHelp);
  if (mainHelpSet == null) return null;

  // merge plugins help sets
  IdeaPluginDescriptor[] pluginDescriptors = PluginManagerCore.getPlugins();
  for (IdeaPluginDescriptor pluginDescriptor : pluginDescriptors) {
    HelpSetPath[] sets = pluginDescriptor.getHelpSets();
    for (HelpSetPath hsPath : sets) {
      String url = "jar:file:///" + pluginDescriptor.getPath().getAbsolutePath() + "/help/" + hsPath.getFile() + "!";
      if (!hsPath.getPath().startsWith("/")) {
        url += "/";
      }
      url += hsPath.getPath();
      HelpSet pluginHelpSet = loadHelpSet(url);
      if (pluginHelpSet != null) {
        mainHelpSet.add(pluginHelpSet);
      }
    }
  }

  return mainHelpSet;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:26,代码来源:DesktopHelpManagerImpl.java


示例13: wrapException

import com.intellij.ide.plugins.PluginManagerCore; //导入依赖的package包/类
private static Exception wrapException(InvalidMirrorException e, VirtualFile file) {
  ClassFileDecompilers.Decompiler decompiler = ClassFileDecompilers.find(file);
  if (decompiler instanceof ClassFileDecompilers.Light) {
    PluginId pluginId = PluginManagerCore.getPluginByClassName(decompiler.getClass().getName());
    if (pluginId != null) {
      return new PluginException(e, pluginId);
    }
  }

  return e;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:ClsFileImpl.java


示例14: getInstance

import com.intellij.ide.plugins.PluginManagerCore; //导入依赖的package包/类
public static synchronized IdeaTestApplication getInstance(@Nullable final String configPath) {
  if (ourInstance == null) {
    PlatformTestCase.doAutodetectPlatformPrefix();
    new IdeaTestApplication();
    PluginManagerCore.getPlugins();
    ApplicationManagerEx.getApplicationEx().load(configPath);
  }
  return (IdeaTestApplication)ourInstance;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:IdeaTestApplication.java


示例15: getPluginNameByIdMap

import com.intellij.ide.plugins.PluginManagerCore; //导入依赖的package包/类
private Map<String, String> getPluginNameByIdMap() {
  if (myPluginNameById == null) {
    myPluginNameById = new HashMap<String, String>();
    for (IdeaPluginDescriptor descriptor : PluginManagerCore.getPlugins()) {
      myPluginNameById.put(descriptor.getPluginId().getIdString(), descriptor.getName());
    }
  }
  return myPluginNameById;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:ExternalDependenciesConfigurable.java


示例16: registerPluginActions

import com.intellij.ide.plugins.PluginManagerCore; //导入依赖的package包/类
private void registerPluginActions() {
  final IdeaPluginDescriptor[] plugins = PluginManagerCore.getPlugins();
  for (IdeaPluginDescriptor plugin : plugins) {
    if (PluginManagerCore.shouldSkipPlugin(plugin)) continue;
    final List<Element> elementList = plugin.getActionsDescriptionElements();
    if (elementList != null) {
      for (Element e : elementList) {
        processActionsChildElement(plugin.getPluginClassLoader(), plugin.getPluginId(), e);
      }
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:ActionManagerImpl.java


示例17: getStateSpecOrError

import com.intellij.ide.plugins.PluginManagerCore; //导入依赖的package包/类
@NotNull
public static State getStateSpecOrError(@NotNull Class<? extends PersistentStateComponent> componentClass) {
  State spec = getStateSpec(componentClass);
  if (spec != null) {
    return spec;
  }

  PluginId pluginId = PluginManagerCore.getPluginByClassName(componentClass.getName());
  if (pluginId == null) {
    throw new RuntimeException("No @State annotation found in " + componentClass);
  }
  else {
    throw new PluginException("No @State annotation found in " + componentClass, pluginId);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:StoreUtil.java


示例18: getStarter

import com.intellij.ide.plugins.PluginManagerCore; //导入依赖的package包/类
@NotNull
public ApplicationStarter getStarter() {
  if (myArgs.length > 0) {
    PluginManagerCore.getPlugins();

    ExtensionPoint<ApplicationStarter> point = Extensions.getRootArea().getExtensionPoint(ExtensionPoints.APPLICATION_STARTER);
    ApplicationStarter[] starters = point.getExtensions();
    String key = myArgs[0];
    for (ApplicationStarter o : starters) {
      if (Comparing.equal(o.getCommandName(), key)) return o;
    }
  }

  return new IdeStarter();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:IdeaApplication.java


示例19: getOptions

import com.intellij.ide.plugins.PluginManagerCore; //导入依赖的package包/类
@NotNull
@Override
public Collection<BooleanOptionDescription> getOptions(@Nullable Project project) {
  ArrayList<BooleanOptionDescription> options = new ArrayList<BooleanOptionDescription>();
  for (IdeaPluginDescriptor pluginDescriptor : PluginManagerCore.getPlugins()) {
    if (pluginDescriptor.getPluginId().toString().equals(PluginManagerCore.CORE_PLUGIN_ID)) {
      continue;
    }

    options.add(new PluginBooleanOptionDescriptor(pluginDescriptor.getPluginId()));

  }
  return options;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:PluginOptionsTopHitProvider.java


示例20: setOptionState

import com.intellij.ide.plugins.PluginManagerCore; //导入依赖的package包/类
@Override
public void setOptionState(boolean enabled) {
  List<String> disabledPlugins = new ArrayList<String>(PluginManagerCore.getDisabledPlugins());
  if (enabled) {
    disabledPlugins.remove(myId.getIdString());
  } else {
    disabledPlugins.add(myId.getIdString());
  }
  try {
    PluginManagerCore.saveDisabledPlugins(disabledPlugins, false);
    PluginManagerConfigurable.shutdownOrRestartApp();
  }
  catch (IOException e) {//
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:PluginBooleanOptionDescriptor.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java ObjectBean类代码示例发布时间:2022-05-22
下一篇:
Java DElementPattern类代码示例发布时间: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