本文整理匯總了Java中com.intellij.ide.plugins.IdeaPluginDescriptor類的典型用法代碼示例。如果您正苦於以下問題:Java IdeaPluginDescriptor類的具體用法?Java IdeaPluginDescriptor怎麽用?Java IdeaPluginDescriptor使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
IdeaPluginDescriptor類屬於com.intellij.ide.plugins包,在下文中一共展示了IdeaPluginDescriptor類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: projectOpened
import com.intellij.ide.plugins.IdeaPluginDescriptor; //導入依賴的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.IdeaPluginDescriptor; //導入依賴的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.IdeaPluginDescriptor; //導入依賴的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: productVersion
import com.intellij.ide.plugins.IdeaPluginDescriptor; //導入依賴的package包/類
public static String productVersion() {
IdeaPluginDescriptor pluginDescriptor = getPluginDescriptor();
String version = pluginDescriptor.getVersion();
// truncate version to 3 digits and if had more than 3 append .x, that way
// no separate product versions need to be created
String[] parts = version.split("\\.", 4);
if (parts.length <= 3) {
return version;
}
String sep = "";
StringBuilder newVersion = new StringBuilder();
for (int i = 0; i < 3; i++) {
newVersion.append(sep);
sep = ".";
newVersion.append(parts[i]);
}
newVersion.append(".x");
return newVersion.toString();
}
示例5: addAgent
import com.intellij.ide.plugins.IdeaPluginDescriptor; //導入依賴的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);
}
示例6: getPluginDir
import com.intellij.ide.plugins.IdeaPluginDescriptor; //導入依賴的package包/類
@Nullable
private static File getPluginDir(IdeaPluginDescriptor plugin) {
String pluginDirName = StringUtil.getShortName(plugin.getPluginId().getIdString());
String extraDir = System.getProperty("idea.external.build.development.plugins.dir");
if (extraDir != null) {
File extraDirFile = new File(extraDir, pluginDirName);
if (extraDirFile.isDirectory()) {
return extraDirFile;
}
}
File pluginHome = PluginPathManager.getPluginHome(pluginDirName);
if (!pluginHome.isDirectory() && StringUtil.isCapitalized(pluginDirName)) {
pluginHome = PluginPathManager.getPluginHome(StringUtil.decapitalize(pluginDirName));
}
return pluginHome.isDirectory() ? pluginHome : null;
}
示例7: getCategories
import com.intellij.ide.plugins.IdeaPluginDescriptor; //導入依賴的package包/類
@Nullable
public String[] getCategories() {
if (categoryKey != null) {
final String baseName = bundleName != null ? bundleName : ((IdeaPluginDescriptor)myPluginDescriptor).getResourceBundleBaseName();
if (baseName == null) {
LOG.error("No resource bundle specified for "+myPluginDescriptor);
}
final ResourceBundle bundle = AbstractBundle.getResourceBundle(baseName, myPluginDescriptor.getPluginClassLoader());
final String[] keys = categoryKey.split("/");
if (keys.length > 1) {
return ContainerUtil.map2Array(keys, String.class, new Function<String, String>() {
@Override
public String fun(final String s) {
return CommonBundle.message(bundle, s);
}
});
}
category = CommonBundle.message(bundle, categoryKey);
}
if (category == null) return null;
return category.split("/");
}
示例8: compute
import com.intellij.ide.plugins.IdeaPluginDescriptor; //導入依賴的package包/類
@Override
protected String compute() {
if (name != null) {
return name;
}
if (resourceKey != null) {
String bundleName = resourceBundle;
if (bundleName == null && myPluginDescriptor != null) {
bundleName = ((IdeaPluginDescriptor) myPluginDescriptor).getResourceBundleBaseName();
}
if (bundleName != null) {
ResourceBundle bundle = AbstractBundle.getResourceBundle(bundleName, getLoaderForClass());
return bundle.getString(resourceKey);
}
}
return null;
}
示例9: createHelpSet
import com.intellij.ide.plugins.IdeaPluginDescriptor; //導入依賴的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 = PluginManagerCore.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;
}
示例10: toggleSelection
import com.intellij.ide.plugins.IdeaPluginDescriptor; //導入依賴的package包/類
private void toggleSelection() {
final IdeaPluginDescriptor descriptor = getSelectedPlugin();
if (descriptor == null || myModel.isForceEnable(descriptor)) return;
boolean willDisable = !myModel.isDisabledPlugin(descriptor);
final Object[] selection = myPluginsList.getSelectedValues();
for (Object o : selection) {
IdeaPluginDescriptor desc = (IdeaPluginDescriptor) o;
if (!willDisable) {
myModel.setPluginEnabledWithDependencies(desc);
}
else {
myModel.setPluginDisabledWithDependents(desc);
}
}
myPluginsList.repaint();
}
示例11: getComponentConfigs
import com.intellij.ide.plugins.IdeaPluginDescriptor; //導入依賴的package包/類
@NotNull
private List<ComponentConfig> getComponentConfigs() {
ArrayList<ComponentConfig> componentConfigs = new ArrayList<ComponentConfig>();
boolean isDefaultProject = this instanceof Project && ((Project)this).isDefault();
boolean headless = ApplicationManager.getApplication().isHeadlessEnvironment();
for (IdeaPluginDescriptor plugin : PluginManagerCore.getPlugins()) {
if (PluginManagerCore.shouldSkipPlugin(plugin)) {
continue;
}
ComponentConfig[] configs = getMyComponentConfigsFromDescriptor(plugin);
componentConfigs.ensureCapacity(componentConfigs.size() + configs.length);
for (ComponentConfig config : configs) {
if ((!isDefaultProject || config.isLoadForDefaultProject()) && isComponentSuitable(config.options) && config.prepareClasses(headless)) {
config.pluginDescriptor = plugin;
componentConfigs.add(config);
}
}
}
return componentConfigs;
}
示例12: getPluginResourcesRootName
import com.intellij.ide.plugins.IdeaPluginDescriptor; //導入依賴的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;
}
示例13: readPluginIdFromJar
import com.intellij.ide.plugins.IdeaPluginDescriptor; //導入依賴的package包/類
@Nullable
private static String readPluginIdFromJar(String buildNumber, File jar)
throws ExecutionException {
IdeaPluginDescriptor pluginDescriptor = PluginManagerCore.loadDescriptor(jar, "plugin.xml");
if (pluginDescriptor == null) {
return null;
}
if (PluginManagerCore.isIncompatible(pluginDescriptor, BuildNumber.fromString(buildNumber))) {
throw new ExecutionException(
String.format(
"Plugin SDK version '%s' is incompatible with this plugin "
+ "(since: '%s', until: '%s')",
buildNumber, pluginDescriptor.getSinceBuild(), pluginDescriptor.getUntilBuild()));
}
return pluginDescriptor.getPluginId().getIdString();
}
示例14: configureErrorFromEvent
import com.intellij.ide.plugins.IdeaPluginDescriptor; //導入依賴的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());
}
}
示例15: DisablePluginWarningDialog
import com.intellij.ide.plugins.IdeaPluginDescriptor; //導入依賴的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();
}