本文整理汇总了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());
}
}
示例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;
}
示例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);
}
示例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;
}
示例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());
}
}
示例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();
}
示例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();
}
示例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;
}
示例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);
}
示例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());
}
}
}
}
}
示例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();
}
示例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();
}
示例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();
}
示例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;
}