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


Java PluginManager类代码示例

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


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

示例1: projectOpened

import com.intellij.ide.plugins.PluginManager; //导入依赖的package包/类
@Override
public void projectOpened() {
    TYPO3CMSSettings instance = TYPO3CMSSettings.getInstance(project);
    IdeaPluginDescriptor plugin = PluginManager.getPlugin(PluginId.getId("com.cedricziel.idea.typo3"));
    if (plugin == null) {
        return;
    }

    String version = instance.getVersion();
    if (version == null || !plugin.getVersion().equals(version)) {
        instance.setVersion(plugin.getVersion());

        FileBasedIndex index = FileBasedIndex.getInstance();
        index.scheduleRebuild(CoreServiceMapStubIndex.KEY, new Throwable());
        index.scheduleRebuild(ExtensionNameStubIndex.KEY, new Throwable());
        index.scheduleRebuild(IconIndex.KEY, new Throwable());
        index.scheduleRebuild(ResourcePathIndex.KEY, new Throwable());
        index.scheduleRebuild(RouteIndex.KEY, new Throwable());
        index.scheduleRebuild(TablenameFileIndex.KEY, new Throwable());
        index.scheduleRebuild(LegacyClassesForIDEIndex.KEY, new Throwable());
        index.scheduleRebuild(MethodArgumentDroppedIndex.KEY, new Throwable());
        index.scheduleRebuild(ControllerActionIndex.KEY, new Throwable());
    }
}
 
开发者ID:cedricziel,项目名称:idea-php-typo3-plugin,代码行数:25,代码来源:TYPO3CMSProjectComponent.java

示例2: findAssociationForFile

import com.intellij.ide.plugins.PluginManager; //导入依赖的package包/类
/**
 * Find the Association for the given FileInfo
 *
 * @param file
 * @return
 */
@VisibleForTesting
@Nullable
protected Association findAssociationForFile(final FileInfo file) {
  Association result = null;
  for (final Association association : associations) {
    if (association.matches(file)) {
      result = association;
      break;
    }
  }

  if (result != null && result.getName().equals("Images")) {
    try {
      // Icon viewer plugin
      final IdeaPluginDescriptor plugin = PluginManager.getPlugin(PluginId.getId("ch.dasoft.iconviewer"));
      if (plugin != null) {
        return null;
      }
    } catch (Exception e) {
      e.printStackTrace();
    }
  }

  return result;
}
 
开发者ID:mallowigi,项目名称:a-file-icon-idea,代码行数:32,代码来源:Associations.java

示例3: checkDependentPlugins

import com.intellij.ide.plugins.PluginManager; //导入依赖的package包/类
private void checkDependentPlugins() {
    final IdeaPluginDescriptor hybrisPlugin = PluginManager.getPlugin(PluginId.getId(HybrisConstants.PLUGIN_ID));
    final PluginId[] dependentPluginIds = hybrisPlugin.getOptionalDependentPluginIds();
    Arrays.stream(dependentPluginIds).forEach(id -> {
        if (id.getIdString().startsWith(EXCLUDED_ID_PREFIX)) {
            return;
        }
        final boolean installed = PluginManager.isPluginInstalled(id);
        if (!installed) {
            notInstalledPlugins.add(id);
            return;
        }
        final IdeaPluginDescriptor plugin = PluginManager.getPlugin(id);
        if (!plugin.isEnabled()) {
            notEnabledPlugins.add(id);
        }
    });
}
 
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:19,代码来源:CheckRequiredPluginsStep.java

示例4: populateComboBox

import com.intellij.ide.plugins.PluginManager; //导入依赖的package包/类
public void populateComboBox() {
    modifyFormComponentVisibility();

    // If the selector has already been populated, do not populate it again.
    if (versionComboBoxContains(VersionComboHeaders.INSTALLED.toString()) ||
            versionComboBoxContains(VersionComboHeaders.AVAILABLE.toString())) {
        return;
    }

    String relativeDependencyRootPath = DependencyResolutionBundle.key("dependency_root");
    File dependencyRoot = new File(PluginManager
            .getPlugin(PluginId.getId("org.idea.processing.plugin")).getPath(),
            relativeDependencyRootPath);

    // Populate the versions already installed.
    populateVersionSelectorWithInstalledVersions(dependencyRoot);

    logger.info("Querying Processing versions available for download.");

    // INVOKE
    populateVersionSelectorWithAvailableVersions(dependencyRoot);
}
 
开发者ID:mistodev,项目名称:processing-idea,代码行数:23,代码来源:CustomVersionSelectorListener.java

示例5: addAgent

import com.intellij.ide.plugins.PluginManager; //导入依赖的package包/类
private void addAgent(com.samebug.clients.common.tracking.RawEvent e) {
    final Map<String, String> agent = new HashMap<String, String>();
    final LookAndFeel laf = UIManager.getLookAndFeel();
    final ApplicationInfo appInfo = ApplicationInfo.getInstance();
    final IdeaPluginDescriptor plugin = PluginManager.getPlugin(PluginId.getId(IdeaSamebugPlugin.ID));
    final String pluginVersion = plugin == null ? null : plugin.getVersion();
    final String instanceId = config.instanceId;

    agent.put("type", "ide-plugin");
    agent.put("ideCodeName", appInfo.getBuild().getProductCode());
    if (laf != null) agent.put("lookAndFeel", laf.getName());
    if (pluginVersion != null) agent.put("pluginVersion", pluginVersion);
    if (instanceId != null) agent.put("instanceId", instanceId);
    agent.put("isRetina", Boolean.toString(UIUtil.isRetina()));
    agent.put("ideBuild", appInfo.getApiVersion());
    e.withField("agent", agent);
}
 
开发者ID:samebug,项目名称:samebug-idea-plugin,代码行数:18,代码来源:IdeaTrackingService.java

示例6: getDefaultProject

import com.intellij.ide.plugins.PluginManager; //导入依赖的package包/类
@Override
@NotNull
public synchronized Project getDefaultProject() {
  LOG.assertTrue(!myDefaultProjectWasDisposed, "Default project has been already disposed!");
  if (myDefaultProject == null) {
    ProgressManager.getInstance().executeNonCancelableSection(new Runnable() {
      @Override
      public void run() {
        try {
          myDefaultProject = createProject(null, "", true);
          initProject(myDefaultProject, null);
        }
        catch (Throwable t) {
          PluginManager.processException(t);
        }
      }
    });
  }
  return myDefaultProject;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:ProjectManagerImpl.java

示例7: loadOldPlugins

import com.intellij.ide.plugins.PluginManager; //导入依赖的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

示例8: getPluginResourcesRootName

import com.intellij.ide.plugins.PluginManager; //导入依赖的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

示例9: notify

import com.intellij.ide.plugins.PluginManager; //导入依赖的package包/类
@Override
public void notify(@NotNull Notification notification) {
    try {
        final ProjectManager projectManager = ProjectManager.getInstance();
        if(projectManager != null) {
            final Project[] openProjects = projectManager.getOpenProjects();
            if(openProjects.length == 0) {
                if(myModel != null) {
                    myModel.addNotification(notification);
                }
            }
            for(Project p : openProjects) {
                ConsoleLogProjectTracker consoleLogProjectTracker = getProjectComponent(p);
                if(consoleLogProjectTracker != null) {
                    consoleLogProjectTracker.printNotification(notification);
                }
            }
        } else {
            PluginManager.getLogger().error("Project Manager could not be retrieved");
        }
    } catch(Exception e) {
        PluginManager.getLogger().error("Could not Notify to Console Log Project Tracker", e);
    }
}
 
开发者ID:headwirecom,项目名称:aem-ide-tooling-4-intellij,代码行数:25,代码来源:ConsoleLog.java

示例10: configureErrorFromEvent

import com.intellij.ide.plugins.PluginManager; //导入依赖的package包/类
private static void configureErrorFromEvent(IdeaLoggingEvent event, ErrorBean error) {
  Throwable throwable = event.getThrowable();
  if (throwable != null) {
    PluginId pluginId = IdeErrorsDialog.findPluginId(throwable);
    if (pluginId != null) {
      IdeaPluginDescriptor ideaPluginDescriptor = PluginManager.getPlugin(pluginId);
      if (ideaPluginDescriptor != null && !ideaPluginDescriptor.isBundled()) {
        error.setPluginName(ideaPluginDescriptor.getName());
        error.setPluginVersion(ideaPluginDescriptor.getVersion());
      }
    }
  }

  Object data = event.getData();

  if (data instanceof AbstractMessage) {
    error.setAttachments(((AbstractMessage) data).getIncludedAttachments());
  }
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-intellij,代码行数:20,代码来源:GoogleFeedbackErrorReporter.java

示例11: DisablePluginWarningDialog

import com.intellij.ide.plugins.PluginManager; //导入依赖的package包/类
public DisablePluginWarningDialog(
    @NotNull PluginId pluginId, @NotNull Component parentComponent) {
  super(parentComponent, false);

  this.pluginId = pluginId;
  IdeaPluginDescriptor plugin = PluginManager.getPlugin(pluginId);
  isRestartCapable = ApplicationManager.getApplication().isRestartCapable();
  promptLabel.setText(GctBundle.message("error.dialog.disable.plugin.prompt", plugin.getName()));
  restartLabel.setText(
      GctBundle.message(
          isRestartCapable
              ? "error.dialog.disable.plugin.restart"
              : "error.dialog.disable.plugin.norestart",
          ApplicationNamesInfo.getInstance().getFullProductName()));

  setTitle(GctBundle.message("error.dialog.disable.plugin.title"));
  init();
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-intellij,代码行数:19,代码来源:DisablePluginWarningDialog.java

示例12: initComponent

import com.intellij.ide.plugins.PluginManager; //导入依赖的package包/类
@Override
public void initComponent() {
  // The Pants plugin doesn't do so many computations for building a project
  // to start an external JVM each time.
  // The plugin only calls `export` goal and parses JSON response.
  // So it will be in process all the time.
  final String key = PantsConstants.SYSTEM_ID.getId() + ExternalSystemConstants.USE_IN_PROCESS_COMMUNICATION_REGISTRY_KEY_SUFFIX;
  Registry.get(key).setValue(true);

  // hack to trick BuildProcessClasspathManager
  final String basePath = System.getProperty("pants.plugin.base.path");
  final IdeaPluginDescriptor plugin = PluginManager.getPlugin(PluginId.getId(PantsConstants.PLUGIN_ID));
  if (StringUtil.isNotEmpty(basePath) && plugin instanceof IdeaPluginDescriptorImpl) {
    ((IdeaPluginDescriptorImpl) plugin).setPath(new File(basePath));
  }

  registerPantsActions();
}
 
开发者ID:pantsbuild,项目名称:intellij-pants-plugin,代码行数:19,代码来源:PantsInitComponentImpl.java

示例13: setupSdkPaths

import com.intellij.ide.plugins.PluginManager; //导入依赖的package包/类
@Override
public void setupSdkPaths(Sdk sdk)
{
	SdkModificator modificator = sdk.getSdkModificator();

	VirtualFile stubsDirectory = LocalFileSystem.getInstance().findFileByIoFile(new File(PluginManager.getPluginPath(NodeJSBundleType.class), "stubs"));
	if(stubsDirectory != null)
	{
		for(VirtualFile file : stubsDirectory.getChildren())
		{
			if(file.getFileType() == JavaScriptFileType.INSTANCE)
			{
				modificator.addRoot(file, BinariesOrderRootType.getInstance());
				modificator.addRoot(file, SourcesOrderRootType.getInstance());
			}
		}
	}

	modificator.commitChanges();
}
 
开发者ID:consulo,项目名称:consulo-nodejs,代码行数:21,代码来源:NodeJSBundleType.java

示例14: start

import com.intellij.ide.plugins.PluginManager; //导入依赖的package包/类
/**
 * Called from PluginManager via reflection.
 */
protected static void start(final String[] args) {
  System.setProperty(PlatformUtilsCore.PLATFORM_PREFIX_KEY, PlatformUtils.getPlatformPrefix(PlatformUtils.COMMUNITY_PREFIX));

  StartupUtil.prepareAndStart(args, new StartupUtil.AppStarter() {
    @Override
    public void start(boolean newConfigFolder) {
      final IdeaApplication app = new IdeaApplication(args);
      //noinspection SSBasedInspection
      SwingUtilities.invokeLater(new Runnable() {
        @Override
        public void run() {
          PluginManager.installExceptionHandler();
          app.run();
        }
      });
    }
  });
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:22,代码来源:MainImpl.java

示例15: 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


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