private void addBundleNameCacheEntry(BundleDescription description) { Set<BundleDescription> descriptions = bundleNameCache.get(description.getSymbolicName()); if (descriptions == null) { descriptions = new LinkedHashSet<>(); bundleNameCache.put(description.getSymbolicName(), descriptions); } descriptions.add(description); }
private void removeBundleNameCacheEntry(BundleDescription description) { Set<BundleDescription> descriptions = bundleNameCache.get(description.getSymbolicName()); if (descriptions != null) { descriptions.remove(description); if (descriptions.isEmpty()) { bundleNameCache.remove(description.getSymbolicName()); } } } }
/** * Returns a key for a bundle description containing the bundle name and version, * for use in the name/version state index map. */ private String getKey(BundleDescription bundle) { return bundle.getSymbolicName() + ';' + bundle.getVersion(); }
@Override public String decorateText(String text, Object element) { if (element instanceof ExportPackageDescription) { ExportPackageDescription epd = (ExportPackageDescription) element; return text.concat(" - " + epd.getSupplier().getSymbolicName()); //$NON-NLS-1$ } return text; } }
private String formatBundleName(BundleDescription b) { String label = b.getSymbolicName(); if (label == null || label.length() == 0) label = b.toString(); else label = label + "_" + b.getVersion(); //$NON-NLS-1$ return label; } }
private BundleDescription getSystemBundleDescription() { BundleDescription bundle = state.getBundle(0); if (bundle == null || bundle.getHost() != null) { // null or a // fragment bundle. return null; } return (EquinoxConstants.FW_SYMBOLIC_NAME.equals(bundle.getSymbolicName()) ? bundle : null); }
private BundleDescription getSystemBundleDescription() { BundleDescription bundle = state.getBundle(0); if (bundle == null || bundle.getHost() != null) { // null or a // fragment bundle. return null; } return (EquinoxConstants.FW_SYMBOLIC_NAME.equals(bundle.getSymbolicName()) ? bundle : null); }
private String formatBundleName(BundleDescription b) { String label = b.getSymbolicName(); if (label == null || label.length() == 0) label = b.toString(); else label = label + "_" + b.getVersion(); //$NON-NLS-1$ return label; }
private String formatBundleName(BundleDescription b) { String label = b.getSymbolicName(); if (label == null || label.length() == 0) label = b.toString(); else label = label + "_" + b.getVersion(); //$NON-NLS-1$ return label; } }
public int getAccessCode(BundleDescription bundle, ExportPackageDescription export) { if (((Boolean) export.getDirective(Constants.INTERNAL_DIRECTIVE)).booleanValue()) return ACCESS_DISCOURAGED; if (!isFriend(bundle.getSymbolicName(), export, true)) // pass strict here so that x-friends is processed return ACCESS_DISCOURAGED; return ACCESS_ENCOURAGED; }
/** * Returns a plug-in model associated with the given bundle description * * @param desc the bundle description * * @return a plug-in model associated with the given bundle description or <code>null</code> * if none exists */ public IPluginModelBase findModel(BundleDescription desc) { ModelEntry entry = findEntry(desc.getSymbolicName()); return entry == null ? null : entry.getModel(desc); }
public static IInstallableUnit[] createEclipseIU(BundleDescription bd, boolean isFolderPlugin, IArtifactKey key, Map<String, String> extraProperties) { ArrayList<IInstallableUnit> iusCreated = new ArrayList<IInstallableUnit>(1); IPublisherInfo info = new PublisherInfo(); String shape = isFolderPlugin ? IBundleShapeAdvice.DIR : IBundleShapeAdvice.JAR; info.addAdvice(new BundleShapeAdvice(bd.getSymbolicName(), PublisherHelper.fromOSGiVersion(bd.getVersion()), shape)); IInstallableUnit iu = BundlesAction.createBundleIU(bd, key, info); addExtraProperties(iu, extraProperties); iusCreated.add(iu); return (iusCreated.toArray(new IInstallableUnit[iusCreated.size()])); }
/** * Adds advice for any p2.inf file found in this bundle. */ private void createAdviceFileAdvice(BundleDescription bundleDescription, IPublisherInfo publisherInfo) { String location = bundleDescription.getLocation(); if (location == null) return; AdviceFileAdvice advice = new AdviceFileAdvice(bundleDescription.getSymbolicName(), PublisherHelper.fromOSGiVersion(bundleDescription.getVersion()), new Path(location), AdviceFileAdvice.BUNDLE_ADVICE_FILE); if (advice.containsAdvice()) publisherInfo.addAdvice(advice); }
/** * Adds advice for any p2.inf file found in this bundle. */ protected void createAdviceFileAdvice(BundleDescription bundleDescription, IPublisherInfo publisherInfo) { String location = bundleDescription.getLocation(); if (location == null) return; AdviceFileAdvice advice = new AdviceFileAdvice(bundleDescription.getSymbolicName(), PublisherHelper.fromOSGiVersion(bundleDescription.getVersion()), new Path(location), AdviceFileAdvice.BUNDLE_ADVICE_FILE); if (advice.containsAdvice()) publisherInfo.addAdvice(advice); }
/** * Adds advice for any p2.inf file found in this bundle. */ protected void createAdviceFileAdvice(BundleDescription bundleDescription, IPublisherInfo publisherInfo) { String location = bundleDescription.getLocation(); if (location == null) return; AdviceFileAdvice advice = new AdviceFileAdvice(bundleDescription.getSymbolicName(), PublisherHelper.fromOSGiVersion(bundleDescription.getVersion()), new Path(location), AdviceFileAdvice.BUNDLE_ADVICE_FILE); if (advice.containsAdvice()) publisherInfo.addAdvice(advice); }
@Override public String getCurrentValue() { IPluginModelBase base = getBase(); if (base == null) return null; BundleDescription desc = base.getBundleDescription(); if (desc != null) return desc.getSymbolicName(); IPluginBase pb = base.getPluginBase(); return pb.getId(); }
private void addFragmentPackages(BundleDescription[] fragments) { for (int i = 0; i < fragments.length; i++) { String id = fragments[i].getSymbolicName(); IPluginModelBase model = PluginRegistry.findModel(id); IResource resource = model instanceof IFragmentModel ? model.getUnderlyingResource() : null; if (resource != null) { addProjectPackages(resource.getProject()); } } }
private void addFragmentPackages(BundleDescription[] fragments) { for (int i = 0; i < fragments.length; i++) { String id = fragments[i].getSymbolicName(); IPluginModelBase model = PluginRegistry.findModel(id); IResource resource = model instanceof IFragmentModel ? model.getUnderlyingResource() : null; if (resource != null) { addProjectPackages(resource.getProject()); } } }
public String getObjectText(BundleDescription bundle) { String id = bundle.getSymbolicName(); if (isFullNameModeEnabled()) { IPluginModelBase model = PluginRegistry.findModel(bundle); if (model != null) { return model.getPluginBase().getTranslatedName(); } return id != null ? id : "?"; //$NON-NLS-1$ } return preventNull(id); }
private BundleInfo createBundleInfo(BundleDescription toConvert, boolean markedAsStarted, int sl, URI location, String fragmentHost) { BundleInfo result = new BundleInfo(); result.setSymbolicName(toConvert.getSymbolicName()); result.setVersion(toConvert.getVersion().toString()); result.setLocation(location); result.setResolved(toConvert.isResolved()); result.setMarkedAsStarted(markedAsStarted); result.setStartLevel(sl); result.setBundleId(toConvert.getBundleId()); result.setFragmentHost(fragmentHost); return result; }