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


Java PluginManager.getPlugin方法代码示例

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


在下文中一共展示了PluginManager.getPlugin方法的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: 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

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

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

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

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

示例9: getForgeVersion

import com.intellij.ide.plugins.PluginManager; //导入方法依赖的package包/类
/**
 * Ugly hack. Versions.getImplementationVersionFor does not work here
 */
public static String getForgeVersion()
{
   IdeaPluginDescriptor plugin = PluginManager.getPlugin(PLUGIN_ID);
   String description = plugin.getDescription();
   String version = "(unknown)";
   String str = "Bundled with Forge";
   int bundledIdx = description.indexOf(str);
   if (bundledIdx > -1)
   {
      version = description.substring(bundledIdx + str.length(),
               description.indexOf(OperatingSystemUtils.isWindows() ? "\n" : System.lineSeparator(), bundledIdx))
               .trim();
   }
   return version;
}
 
开发者ID:forge,项目名称:intellij-idea-plugin,代码行数:19,代码来源:ForgeService.java

示例10: OpenCmsPluginConfigurationForm

import com.intellij.ide.plugins.PluginManager; //导入方法依赖的package包/类
/**
 * Creates a new project level configuration form and initializes listeners for form actions
 */
public OpenCmsPluginConfigurationForm() {
	formPanel.setVisible(false);
	enabledCheckBox.addActionListener(this);
	webappRoot.addFocusListener(this);
	defaultLocalVfsRoot.addFocusListener(this);
	moduleZipTargetFolderPath.addFocusListener(this);
	usePluginConnectorCheckBox.addActionListener(this);
	pullMetaDataCheckbox.addActionListener(this);

	if (pluginVersion == null) {
		PluginId pluginId = PluginManager.getPluginByClassName(OpenCmsPlugin.class.getName());
		IdeaPluginDescriptor pluginDescriptor = PluginManager.getPlugin(pluginId);
		if (pluginDescriptor != null) {
			pluginVersion = pluginDescriptor.getVersion();
		}
		if (pluginVersion == null) {
			pluginVersion = "unknown";
		}
	}
	pluginVersionLabel.setText("V " + pluginVersion);
}
 
开发者ID:mediaworx,项目名称:opencms-intellijplugin,代码行数:25,代码来源:OpenCmsPluginConfigurationForm.java

示例11: update

import com.intellij.ide.plugins.PluginManager; //导入方法依赖的package包/类
public static void update(@Nullable List<IdeaPluginDescriptor> list) {
  ourLoadedPluginDescriptors = ContainerUtil.isEmpty(list) ? null : list;

  if (list != null) {
    InstalledPluginsState pluginsState = InstalledPluginsState.getInstance();

    for (IdeaPluginDescriptor newPluginDescriptor : list) {
      final IdeaPluginDescriptor installed = PluginManager.getPlugin(newPluginDescriptor.getPluginId());
      if (installed != null) {
        int state = StringUtil.compareVersionNumbers(newPluginDescriptor.getVersion(), installed.getVersion());

        if (state > 0 &&
            !PluginManager.isIncompatible(newPluginDescriptor) &&
            !pluginsState.getUpdatedPlugins().contains(newPluginDescriptor.getPluginId())) {
          pluginsState.getOutdatedPlugins().add(newPluginDescriptor.getPluginId());
        }
      }
    }
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:21,代码来源:PluginsAdvertiserHolder.java

示例12: getPluginVersion

import com.intellij.ide.plugins.PluginManager; //导入方法依赖的package包/类
private static String getPluginVersion() {
  IdeaPluginDescriptor plugin = PluginManager.getPlugin(PluginId.getId(PLUGIN_ID));
  if (plugin == null) {
    return "unknown";
  }
  return plugin.getVersion();
}
 
开发者ID:google,项目名称:bamboo-soy,代码行数:8,代码来源:RollbarErrorReportSubmitter.java

示例13: PanelDialog

import com.intellij.ide.plugins.PluginManager; //导入方法依赖的package包/类
PanelDialog(@Nullable Project project) {
    super(project);
    panel = new Panel(project);
    IdeaPluginDescriptor pluginDescriptor = PluginManager.getPlugin(PluginId.getId("git-commit-message-plugin"));
    String version = "";
    if (pluginDescriptor != null) {
        version = pluginDescriptor.getVersion();
    }
    setTitle("Git / Hg Mercurial Commit Message Plugin. Version: " + version);
    setOKButtonText("OK");
    setSize(300, 200);
    init();
}
 
开发者ID:JanGatting,项目名称:GitCommitMessage,代码行数:14,代码来源:PanelDialog.java

示例14: isPluginActive

import com.intellij.ide.plugins.PluginManager; //导入方法依赖的package包/类
public static boolean isPluginActive(final String id) {
    final PluginId pluginId = PluginId.getId(id);
    if (pluginId == null) {
        return false;
    }
    final IdeaPluginDescriptor plugin = PluginManager.getPlugin(pluginId);
    if (plugin == null) {
        return false;
    }
    return plugin.isEnabled();
}
 
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:12,代码来源:PluginCommon.java

示例15: tryOldAPI

import com.intellij.ide.plugins.PluginManager; //导入方法依赖的package包/类
private static boolean tryOldAPI(Project project) {

        String settingName = "Configure Kotlin: info notification";
        NotificationsConfiguration.getNotificationsConfiguration().changeSettings(settingName,
                NotificationDisplayType.NONE, true, false);
        KotlinProjectConfigurator configuratorByName = ConfigureKotlinInProjectUtilsKt.getConfiguratorByName("java");
        if (configuratorByName == null) {
            LOG.info("Failed to find configurator");
            return false;
        }
        Class<?> confClass = configuratorByName.getClass();
        while (confClass != KotlinWithLibraryConfigurator.class) {
            confClass = confClass.getSuperclass();
        }
        String lib = FileUIUtils.createRelativePath(project, project.getBaseDir(), "lib");
        //collector arg was added in Kotlin plugin 1.0.1

        IdeaPluginDescriptor plugin = PluginManager.getPlugin(PluginId.getId("org.jetbrains.kotlin"));
        if (plugin == null) {
            return false;
        }

        if (VersionComparatorUtil.compare(plugin.getVersion(), "1.0.1") > 0) {
            if (configureWithCollector(project, confClass, configuratorByName, lib)) {
              return true;
            }
        } else {
            if (!configureWithoutCollector(project, confClass, configuratorByName, lib)) {
                configuratorByName.configure(project, Collections.emptyList());
            }
        }
        NotificationsConfiguration.getNotificationsConfiguration().changeSettings(settingName,
                NotificationDisplayType.STICKY_BALLOON, true, false);
        return true;
    }
 
开发者ID:medvector,项目名称:educational-plugin,代码行数:36,代码来源:EduKotlinLibConfigurator.java


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