本文整理匯總了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;
}
示例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");
}
示例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;
}
示例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());
}
}
示例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);
}
}
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
}
}