/** * Returns a bundle manifest location manager that knows about source bundles in the current * platform. * @return bundle manifest source location manager */ @Override protected BundleManifestSourceLocationManager initializeBundleManifestLocations() { BundleManifestSourceLocationManager manager = new BundleManifestSourceLocationManager(); manager.setPlugins(models); return manager; }
/** * Returns all of the source roots specified in the source bundle providing * source for the given plugin name and version. * The manager will look for a source location for the given plugin name and * version. If one is found, it's manifest entry will be parsed and all of * the source roots found in it will be returned (duplicates removed). If there * are no roots specified for a plugin/version, ".", representing the root of the * archive will be used as a default. * * @param pluginName name of the plugin to search for * @param pluginVersion version of the plugin to search for * @return set of String paths representing the source roots in the associated source bundle, possibly empty */ public Set<String> getAllSourceRoots(String pluginName, Version pluginVersion) { Set<String> pluginSourceRoots = new HashSet<>(); ManifestElement[] manifestElements = getSourceEntries(pluginName, pluginVersion); if (manifestElements != null) { for (int j = 0; j < manifestElements.length; j++) { ManifestElement currentElement = manifestElements[j]; addSourceRoots(currentElement.getDirective("roots"), pluginSourceRoots); //$NON-NLS-1$ } } return pluginSourceRoots; }
/** * @return source location that was specified by a bundle manifest entry to provide source for the given plugin. */ private SourceLocation getBundleManifestLocation(String pluginID, Version version) { return getBundleManifestLocator().getSourceLocation(pluginID, version); }
/** * @return array of source locations defined by a bundle manifest entry */ public Collection<SourceLocation> getBundleManifestLocations() { return getBundleManifestLocator().getSourceLocations(); }
/** * Searches bundle manifest source locations for the one that provides source * for the given plugin. Gets the source roots (String paths) for the plugin * by parsing the source bundle's manifest. If the given plugin does not have * a known source location with a bundle manifest entry an empty Set will be returned. * * @param plugin plugin to lookup source for * @return set of String paths that are source roots for the plugin, possibly empty */ public Set<String> findSourceRoots(IPluginBase plugin) { if (plugin.getId() == null || plugin.getVersion() == null) { return Collections.emptySet(); } return getBundleManifestLocator().getSourceRoots(plugin.getId(), new Version(plugin.getVersion())); }
/** * Searches bundle manifest source locations for the one that provides source * for the given plugin. Gets all source roots for the source bundle by parsing * the manifest file. If the source bundle provides source for multiple plugins, * the roots specified for all of them (duplicates removed). If the source bundle * only provides source for a single plugin/version, this method will return the * same result as #findSourceRoots(IPluginModelBase). If the given plugin does not have * a known source location with a bundle manifest entry an empty Set will be returned. * * @param plugin plugin to lookup source for * @return set of String paths that are source roots for the bundle, possibly empty */ public Set<String> findAllSourceRootsInSourceLocation(IPluginBase plugin) { if (plugin.getId() == null || plugin.getVersion() == null) { return Collections.emptySet(); } return getBundleManifestLocator().getAllSourceRoots(plugin.getId(), new Version(plugin.getVersion())); }
/** * Returns whether the given path describes a source location with a source bundle manifest entry. * @param plugin the plug-in to test * @return whether the given path is a bundle manifest location */ public boolean hasBundleManifestLocation(IPluginBase plugin) { if (plugin.getId() == null || plugin.getVersion() == null) { return false; } return getBundleManifestLocator().hasValidSourceLocation(plugin.getId(), new Version(plugin.getVersion())); }
/** * Returns a bundle manifest location manager that knows about source bundles in the current * platform. * @return bundle manifest source location manager */ protected BundleManifestSourceLocationManager initializeBundleManifestLocations() { BundleManifestSourceLocationManager manager = new BundleManifestSourceLocationManager(); manager.setPlugins(PDECore.getDefault().getModelManager().getExternalModels()); return manager; }
ManifestElement[] manifestElements = getSourceEntries(pluginName, pluginVersion); if (manifestElements != null) { for (int j = 0; j < manifestElements.length; j++) { addSourceRoots(currentElement.getDirective("roots"), pluginSourceRoots); //$NON-NLS-1$ return pluginSourceRoots;