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