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


Java PluginManager.getPlugins方法代碼示例

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


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

示例1: createHelpSet

import com.intellij.ide.plugins.PluginManager; //導入方法依賴的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 = PluginManager.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:lshain-android-source,項目名稱:tools-idea,代碼行數:26,代碼來源:HelpManagerImpl.java

示例2: getPluginDescriptor

import com.intellij.ide.plugins.PluginManager; //導入方法依賴的package包/類
public static IdeaPluginDescriptor getPluginDescriptor() {
    IdeaPluginDescriptor[] plugins = PluginManager.getPlugins();
    for (IdeaPluginDescriptor plugin : plugins) {
        if (PLUGIN_ID.equals(plugin.getPluginId().getIdString())) {
            return plugin;
        }
    }

    throw new IllegalStateException("Unexpected, plugin cannot find its own plugin descriptor");
}
 
開發者ID:vsch,項目名稱:MissingInActions,代碼行數:11,代碼來源:Plugin.java

示例3: getInstance

import com.intellij.ide.plugins.PluginManager; //導入方法依賴的package包/類
public static synchronized IdeaTestApplication getInstance(@Nullable final String configPath) {
  if (ourInstance == null) {
    new IdeaTestApplication();
    PluginManager.getPlugins();
    final ApplicationEx app = ApplicationManagerEx.getApplicationEx();
    new WriteAction() {
      protected void run(Result result) throws Throwable {
        app.load(configPath);
      }
    }.execute();
  }
  return (IdeaTestApplication)ourInstance;
}
 
開發者ID:lshain-android-source,項目名稱:tools-idea,代碼行數:14,代碼來源:IdeaTestApplication.java

示例4: loadProjectComponents

import com.intellij.ide.plugins.PluginManager; //導入方法依賴的package包/類
public void loadProjectComponents() {
  final IdeaPluginDescriptor[] plugins = PluginManager.getPlugins();
  for (IdeaPluginDescriptor plugin : plugins) {
    if (PluginManager.shouldSkipPlugin(plugin)) continue;
    loadComponentsConfiguration(plugin.getProjectComponents(), plugin, isDefault());
  }
}
 
開發者ID:lshain-android-source,項目名稱:tools-idea,代碼行數:8,代碼來源:ProjectImpl.java

示例5: registerPluginActions

import com.intellij.ide.plugins.PluginManager; //導入方法依賴的package包/類
private void registerPluginActions() {
  final IdeaPluginDescriptor[] plugins = PluginManager.getPlugins();
  for (IdeaPluginDescriptor plugin : plugins) {
    if (PluginManager.shouldSkipPlugin(plugin)) continue;
    final List<Element> elementList = plugin.getActionsDescriptionElements();
    if (elementList != null) {
      for (Element e : elementList) {
        processActionsChildElement(plugin.getPluginClassLoader(), plugin.getPluginId(), e);
      }
    }
  }
}
 
開發者ID:lshain-android-source,項目名稱:tools-idea,代碼行數:13,代碼來源:ActionManagerImpl.java

示例6: exportInstalledPlugins

import com.intellij.ide.plugins.PluginManager; //導入方法依賴的package包/類
private static void exportInstalledPlugins(File saveFile, JarOutputStream output, HashSet<String> writtenItemRelativePaths) throws IOException {
  final List<String> oldPlugins = new ArrayList<String>();
  for (IdeaPluginDescriptor descriptor : PluginManager.getPlugins()) {
    if (!descriptor.isBundled() && descriptor.isEnabled()) {
      oldPlugins.add(descriptor.getPluginId().getIdString());
    }
  }
  if (!oldPlugins.isEmpty()) {
    final File tempFile = File.createTempFile("installed", "plugins");
    tempFile.deleteOnExit();
    PluginManager.savePluginsList(oldPlugins, false, tempFile);
    ZipUtil.addDirToZipRecursively(output, saveFile, tempFile, "/" + PluginManager.INSTALLED_TXT, null, writtenItemRelativePaths);
  }
}
 
開發者ID:lshain-android-source,項目名稱:tools-idea,代碼行數:15,代碼來源:ExportSettingsAction.java

示例7: loadModuleComponents

import com.intellij.ide.plugins.PluginManager; //導入方法依賴的package包/類
@Override
public void loadModuleComponents() {
  final IdeaPluginDescriptor[] plugins = PluginManager.getPlugins();
  for (IdeaPluginDescriptor plugin : plugins) {
    if (PluginManager.shouldSkipPlugin(plugin)) continue;
    loadComponentsConfiguration(plugin.getModuleComponents(), plugin, false);
  }
}
 
開發者ID:lshain-android-source,項目名稱:tools-idea,代碼行數:9,代碼來源:ModuleImpl.java

示例8: loadDefaultTemplates

import com.intellij.ide.plugins.PluginManager; //導入方法依賴的package包/類
private void loadDefaultTemplates() {
  final Set<URL> processedUrls = new HashSet<URL>();
  for (PluginDescriptor plugin : PluginManager.getPlugins()) {
    if (plugin instanceof IdeaPluginDescriptorImpl && ((IdeaPluginDescriptorImpl)plugin).isEnabled()) {
      final ClassLoader loader = plugin.getPluginClassLoader();
      if (loader instanceof PluginClassLoader && ((PluginClassLoader)loader).getUrls().isEmpty()) {
        continue; // development mode, when IDEA_CORE's loader contains all the classpath
      }
      try {
        final Enumeration<URL> systemResources = loader.getResources(DEFAULT_TEMPLATES_ROOT);
        if (systemResources != null && systemResources.hasMoreElements()) {
          while (systemResources.hasMoreElements()) {
            final URL url = systemResources.nextElement();
            if (processedUrls.contains(url)) {
              continue;
            }
            processedUrls.add(url);
            loadDefaultsFromRoot(url);
          }
        }
      }
      catch (IOException e) {
        LOG.error(e);
      }
    }
  }
}
 
開發者ID:lshain-android-source,項目名稱:tools-idea,代碼行數:28,代碼來源:FileTemplatesLoader.java


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