本文整理汇总了Java中com.intellij.ide.plugins.PluginManager.isPluginInstalled方法的典型用法代码示例。如果您正苦于以下问题:Java PluginManager.isPluginInstalled方法的具体用法?Java PluginManager.isPluginInstalled怎么用?Java PluginManager.isPluginInstalled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.ide.plugins.PluginManager
的用法示例。
在下文中一共展示了PluginManager.isPluginInstalled方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: checkRequiredPlugins
import com.intellij.ide.plugins.PluginManager; //导入方法依赖的package包/类
private static boolean checkRequiredPlugins(Element element) {
for (Element plugin : element.getChildren("requiredPlugin")) {
if (!PluginManager.isPluginInstalled(PluginId.getId(plugin.getTextTrim()))) {
return false;
}
}
return true;
}
示例2: checkRequiredPlugins
import com.intellij.ide.plugins.PluginManager; //导入方法依赖的package包/类
private static boolean checkRequiredPlugins(Element element, Namespace ns) {
@SuppressWarnings("unchecked") List<Element> plugins = element.getChildren("requiredPlugin", ns);
for (Element plugin : plugins) {
String id = plugin.getTextTrim();
if (!PluginManager.isPluginInstalled(PluginId.getId(id))) {
return false;
}
}
return true;
}
示例3: prepareToInstall
import com.intellij.ide.plugins.PluginManager; //导入方法依赖的package包/类
public boolean prepareToInstall(ProgressIndicator pi) throws IOException {
IdeaPluginDescriptor descriptor = null;
if (!Boolean.getBoolean(StartupActionScriptManager.STARTUP_WIZARD_MODE) && PluginManager.isPluginInstalled(myPluginId)) {
//store old plugins file
descriptor = PluginManager.getPlugin(myPluginId);
myOldFile = descriptor.getPath();
}
// download plugin
String errorMessage = IdeBundle.message("unknown.error");
try {
myFile = downloadPlugin(pi);
}
catch (IOException ex) {
myFile = null;
errorMessage = ex.getMessage();
}
if (myFile == null) {
final String text = IdeBundle.message("error.plugin.was.not.installed", getPluginName(), errorMessage);
final String title = IdeBundle.message("title.failed.to.download");
ApplicationManager.getApplication().invokeLater(() -> Messages.showErrorDialog(text, title));
return false;
}
return !InstalledPluginsTableModel.wasUpdated(myDescriptor.getPluginId());
}