boolean isOptional() { if (constraint instanceof HostSpecification) return false; return ((BundleSpecification) constraint).isOptional(); } }
boolean isOptional() { if (constraint instanceof HostSpecification) return false; return ((BundleSpecification) constraint).isOptional(); } }
boolean isOptional() { if (constraint instanceof HostSpecification) return false; return ((BundleSpecification) constraint).isOptional(); } }
boolean isOptional() { if (constraint instanceof HostSpecification) return false; return ((BundleSpecification) constraint).isOptional(); } }
@Override public boolean select(Viewer v, Object parent, Object element) { if (element instanceof BundleSpecification) { return !((BundleSpecification) element).isOptional(); } else if (element instanceof ImportPackageSpecification) return !Constants.RESOLUTION_OPTIONAL.equals(((ImportPackageSpecification) element).getDirective(Constants.RESOLUTION_DIRECTIVE)); return true; } }
protected void addRequiredBundles(BundleSpecification[] requiredBundles) { for (BundleSpecification bundle : requiredBundles) { if (bundle.isOptional() && !fIncludeOptional) continue; BaseDescription bd = bundle.getSupplier(); // only recursively search statisfied require-bundles if (bd != null && bd instanceof BundleDescription) findDependencies((BundleDescription) bd); } }
public static String getResolutionFailureMessage(VersionConstraint unsatisfied) { if (unsatisfied.isResolved()) throw new IllegalArgumentException(); if (unsatisfied instanceof ImportPackageSpecification) return NLS.bind(PDERuntimeMessages.MessageHelper_missing_imported_package, toString(unsatisfied)); else if (unsatisfied instanceof BundleSpecification) { if (((BundleSpecification) unsatisfied).isOptional()) return NLS.bind(PDERuntimeMessages.MessageHelper_missing_optional_required_bundle, toString(unsatisfied)); return NLS.bind(PDERuntimeMessages.MessageHelper_missing_required_bundle, toString(unsatisfied)); } else return NLS.bind(PDERuntimeMessages.MessageHelper_missing_host, toString(unsatisfied)); }
public static String getResolutionFailureMessage(VersionConstraint unsatisfied) { if (unsatisfied.isResolved()) throw new IllegalArgumentException(); if (unsatisfied instanceof ImportPackageSpecification) { if (ImportPackageSpecification.RESOLUTION_OPTIONAL.equals(((ImportPackageSpecification) unsatisfied).getDirective(Constants.RESOLUTION_DIRECTIVE))) return NLS.bind(EclipseAdaptorMsg.ECLIPSE_MISSING_OPTIONAL_IMPORTED_PACKAGE, toString(unsatisfied)); if (ImportPackageSpecification.RESOLUTION_DYNAMIC.equals(((ImportPackageSpecification) unsatisfied).getDirective(Constants.RESOLUTION_DIRECTIVE))) return NLS.bind(EclipseAdaptorMsg.ECLIPSE_MISSING_DYNAMIC_IMPORTED_PACKAGE, toString(unsatisfied)); return NLS.bind(EclipseAdaptorMsg.ECLIPSE_MISSING_IMPORTED_PACKAGE, toString(unsatisfied)); } else if (unsatisfied instanceof BundleSpecification) { if (((BundleSpecification) unsatisfied).isOptional()) return NLS.bind(EclipseAdaptorMsg.ECLIPSE_MISSING_OPTIONAL_REQUIRED_BUNDLE, toString(unsatisfied)); return NLS.bind(EclipseAdaptorMsg.ECLIPSE_MISSING_REQUIRED_BUNDLE, toString(unsatisfied)); } else if (unsatisfied instanceof HostSpecification) { return NLS.bind(EclipseAdaptorMsg.ECLIPSE_MISSING_HOST, toString(unsatisfied)); } else if (unsatisfied instanceof NativeCodeSpecification) { return NLS.bind(EclipseAdaptorMsg.ECLIPSE_MISSING_NATIVECODE, unsatisfied.toString()); } else if (unsatisfied instanceof GenericSpecification) { return NLS.bind(EclipseAdaptorMsg.ECLIPSE_MISSING_REQUIRED_CAPABILITY, unsatisfied.toString()); } return NLS.bind(EclipseAdaptorMsg.ECLIPSE_MISSING_REQUIREMENT, unsatisfied.toString()); }
private String getResolutionFailureMessage(VersionConstraint unsatisfied) { if (unsatisfied.isResolved()) throw new IllegalArgumentException(); if (unsatisfied instanceof ImportPackageSpecification) return "Missing imported package: " + toString(unsatisfied); //$NON-NLS-1$ if (unsatisfied instanceof BundleSpecification && !((BundleSpecification)unsatisfied).isOptional()) return "Missing required plug-in: " + toString(unsatisfied); //$NON-NLS-1$ if (unsatisfied instanceof HostSpecification) return "Missing Fragment Host: " + toString(unsatisfied); //$NON-NLS-1$ return null; }
public static String getResolutionFailureMessage(VersionConstraint unsatisfied) { if (unsatisfied.isResolved()) throw new IllegalArgumentException(); if (unsatisfied instanceof ImportPackageSpecification) { if (ImportPackageSpecification.RESOLUTION_OPTIONAL.equals(((ImportPackageSpecification) unsatisfied).getDirective(Constants.RESOLUTION_DIRECTIVE))) return NLS.bind(EclipseAdaptorMsg.ECLIPSE_MISSING_OPTIONAL_IMPORTED_PACKAGE, toString(unsatisfied)); if (ImportPackageSpecification.RESOLUTION_DYNAMIC.equals(((ImportPackageSpecification) unsatisfied).getDirective(Constants.RESOLUTION_DIRECTIVE))) return NLS.bind(EclipseAdaptorMsg.ECLIPSE_MISSING_DYNAMIC_IMPORTED_PACKAGE, toString(unsatisfied)); return NLS.bind(EclipseAdaptorMsg.ECLIPSE_MISSING_IMPORTED_PACKAGE, toString(unsatisfied)); } if (unsatisfied instanceof BundleSpecification) { if (((BundleSpecification) unsatisfied).isOptional()) return NLS.bind(EclipseAdaptorMsg.ECLIPSE_MISSING_OPTIONAL_REQUIRED_BUNDLE, toString(unsatisfied)); return NLS.bind(EclipseAdaptorMsg.ECLIPSE_MISSING_REQUIRED_BUNDLE, toString(unsatisfied)); } return NLS.bind(EclipseAdaptorMsg.ECLIPSE_MISSING_HOST, toString(unsatisfied)); }
protected void addRequireBundleRequirement(ArrayList<IRequirement> reqsDeps, BundleSpecification requiredBundle, ManifestElement[] rawRequireBundleHeader) { final boolean optional = requiredBundle.isOptional(); final boolean greedy; if (optional) greedy = INSTALLATION_GREEDY.equals(getInstallationDirective(requiredBundle.getName(), rawRequireBundleHeader)); else greedy = true; reqsDeps.add(MetadataFactory.createRequirement(CAPABILITY_NS_OSGI_BUNDLE, requiredBundle.getName(), PublisherHelper.fromOSGiVersionRange(requiredBundle.getVersionRange()), null, optional ? 0 : 1, 1, greedy)); }
protected void addRequireBundleRequirement(List<IRequirement> reqsDeps, BundleSpecification requiredBundle, ManifestElement[] rawRequireBundleHeader) { final boolean optional = requiredBundle.isOptional(); final boolean greedy; if (optional) { greedy = INSTALLATION_GREEDY.equals(getInstallationDirective(requiredBundle.getName(), rawRequireBundleHeader)); } else { greedy = true; } reqsDeps.add(MetadataFactory.createRequirement(CAPABILITY_NS_OSGI_BUNDLE, requiredBundle.getName(), PublisherHelper.fromOSGiVersionRange(requiredBundle.getVersionRange()), null, optional ? 0 : 1, 1, greedy)); }
@Override protected void addRequireBundleRequirement(List<IRequirement> reqsDeps, BundleSpecification requiredBundle, ManifestElement[] rawRequireBundleHeader) { if (optionalAction == OptionalResolutionAction.OPTIONAL) { super.addRequireBundleRequirement(reqsDeps, requiredBundle, rawRequireBundleHeader); return; } VersionRange versionRange = PublisherHelper.fromOSGiVersionRange(requiredBundle.getVersionRange()); final boolean required = !requiredBundle.isOptional() || optionalAction == OptionalResolutionAction.REQUIRE; if (required) { reqsDeps.add(MetadataFactory.createRequirement(CAPABILITY_NS_OSGI_BUNDLE, requiredBundle.getName(), versionRange, null, 1, 1, true /* greedy */)); } }
public void load(BundleSpecification importModel) { this.fID = importModel.getName(); this.reexported = importModel.isExported(); this.optional = importModel.isOptional(); VersionRange versionRange = importModel.getVersionRange(); if (versionRange == null || VersionRange.emptyRange.equals(versionRange)) { this.version = null; match = IMatchRules.NONE; } else { this.version = versionRange.getMinimum() != null ? versionRange.getMinimum().toString() : null; match = PluginBase.getMatchRule(versionRange); } }
public void load(BundleSpecification importModel) { this.fID = importModel.getName(); this.reexported = importModel.isExported(); this.optional = importModel.isOptional(); VersionRange versionRange = importModel.getVersionRange(); if (versionRange == null || VersionRange.emptyRange.equals(versionRange)) { this.version = null; match = IMatchRules.NONE; } else { this.version = versionRange.getMinimum() != null ? versionRange.getMinimum().toString() : null; match = PluginBase.getMatchRule(versionRange); } }
@Override public synchronized IRequiredComponentDescription[] getRequiredComponents() throws CoreException { if (fBundleDescription == null) { baselineDisposed(getBaseline()); } BundleSpecification[] requiredBundles = fBundleDescription.getRequiredBundles(); IRequiredComponentDescription[] req = new IRequiredComponentDescription[requiredBundles.length]; for (int i = 0; i < requiredBundles.length; i++) { BundleSpecification bundle = requiredBundles[i]; req[i] = new RequiredComponentDescription(bundle.getName(), new BundleVersionRange(bundle.getVersionRange()), bundle.isOptional(), bundle.isExported()); } return req; }
public BundleSpecification createBundleSpecification(BundleSpecification original) { BundleSpecificationImpl bundleSpec = new BundleSpecificationImpl(); bundleSpec.setName(original.getName()); bundleSpec.setVersionRange(original.getVersionRange()); bundleSpec.setExported(original.isExported()); bundleSpec.setOptional(original.isOptional()); if (original instanceof BundleSpecificationImpl) bundleSpec.setAttributes(((BundleSpecificationImpl) original).getAttributes()); return bundleSpec; }
public BundleSpecification createBundleSpecification(BundleSpecification original) { BundleSpecificationImpl bundleSpec = new BundleSpecificationImpl(); bundleSpec.setName(original.getName()); bundleSpec.setVersionRange(original.getVersionRange()); bundleSpec.setExported(original.isExported()); bundleSpec.setOptional(original.isOptional()); if (original instanceof BundleSpecificationImpl) { bundleSpec.setAttributes(((BundleSpecificationImpl) original).getAttributes()); bundleSpec.setArbitraryDirectives(((BundleSpecificationImpl) original).getArbitraryDirectives()); } return bundleSpec; }
public BundleSpecification createBundleSpecification(BundleSpecification original) { BundleSpecificationImpl bundleSpec = new BundleSpecificationImpl(); bundleSpec.setName(original.getName()); bundleSpec.setVersionRange(original.getVersionRange()); bundleSpec.setExported(original.isExported()); bundleSpec.setOptional(original.isOptional()); if (original instanceof BundleSpecificationImpl) { bundleSpec.setAttributes(((BundleSpecificationImpl) original).getAttributes()); bundleSpec.setArbitraryDirectives(((BundleSpecificationImpl) original).getArbitraryDirectives()); } return bundleSpec; }
public BundleSpecification createBundleSpecification(BundleSpecification original) { BundleSpecificationImpl bundleSpec = new BundleSpecificationImpl(); bundleSpec.setName(original.getName()); bundleSpec.setVersionRange(original.getVersionRange()); bundleSpec.setExported(original.isExported()); bundleSpec.setOptional(original.isOptional()); if (original instanceof BundleSpecificationImpl) { bundleSpec.setAttributes(((BundleSpecificationImpl) original).getAttributes()); bundleSpec.setArbitraryDirectives(((BundleSpecificationImpl) original).getArbitraryDirectives()); } return bundleSpec; }