@Override public String toString() { if (isEntryPoint) { return NLS.bind(Messages.Explanation_missingRootRequired, req); } if (req.getFilter() == null) { return NLS.bind(Messages.Explanation_missingRequired, iu, req); } return NLS.bind(Messages.Explanation_missingRequiredFilter, new Object[] {req.getFilter(), iu, req}); }
@Override public IStatus toStatus() { if (isEntryPoint) { return new Status(IStatus.ERROR, DirectorActivator.PI_DIRECTOR, NLS.bind(Messages.Explanation_missingRootRequired, req)); } if (req.getFilter() == null) { return new Status(IStatus.ERROR, DirectorActivator.PI_DIRECTOR, NLS.bind(Messages.Explanation_missingRequired, getUserReadableName(iu), req)); } return new Status(IStatus.ERROR, DirectorActivator.PI_DIRECTOR, NLS.bind(Messages.Explanation_missingRequiredFilter, new Object[] {req.getFilter(), getUserReadableName(iu), req})); } }
private boolean isApplicable(IRequirement req) { IMatchExpression<IInstallableUnit> filter = req.getFilter(); return filter == null || filter.isMatch(selectionContext); }
protected boolean isApplicable(IRequirement req) { IMatchExpression<IInstallableUnit> filter = req.getFilter(); return filter == null || filter.isMatch(selectionContext); }
protected boolean isApplicable(IRequirement req) { IMatchExpression<IInstallableUnit> filter = req.getFilter(); return filter == null || filter.isMatch(selectionContext); }
public boolean equals(Object obj) { if (this == obj) return true; if (!(obj instanceof IRequirement)) return false; IRequirement other = (IRequirement) obj; if (filter == null) { if (other.getFilter() != null) return false; } else if (!filter.equals(other.getFilter())) return false; return min == other.getMin() && max == other.getMax() && greedy == other.isGreedy() && matchExpression.equals(other.getMatches()); }
protected boolean isApplicable(IRequirement req) { //Every filter in this method needs to continue except when the filter does not pass if (!includeOptionalDependencies) if (req.getMin() == 0) return false; if (considerOnlyStrictDependency) { if (!RequiredCapability.isVersionStrict(req.getMatches())) return false; } //deal with filters if (considerFilter) { if (onlyFilteredRequirements && req.getFilter() == null) { return false; } return super.isApplicable(req); } if (req.getFilter() == null) { if (onlyFilteredRequirements) return false; return true; } return evalFilterTo; }
@Override protected boolean isApplicable(IRequirement req) { //Every filter in this method needs to continue except when the filter does not pass if (!includeOptionalDependencies) if (req.getMin() == 0) return false; if (considerOnlyStrictDependency) { if (!RequiredCapability.isStrictVersionRequirement(req.getMatches())) return false; } //deal with filters if (considerFilter) { if (onlyFilteredRequirements && req.getFilter() == null) { return false; } return super.isApplicable(req); } if (req.getFilter() == null) { if (onlyFilteredRequirements) return false; return true; } return evalFilterTo; }
public Collection<IUTreeViewer.IUTreeItem> getChildren() { if (children==null) { children = new ArrayList<IUTreeViewer.IUTreeItem>(); if (parent==null) { for (IRequirement r : iu.getRequirements()) { for (IInstallableUnit riu : provider.getInstallableUnits()) { if (r.isMatch(riu)) { IMatchExpression<IInstallableUnit> me = r.getFilter(); if (me!=null) { if (me.isMatch(riu)) children.add(new IUTreeItem(provider, this, riu)); } else children.add(new IUTreeItem(provider, this, riu)); } } } } } return children; }
protected void writeRequirement(IRequirement requirement) { start(REQUIREMENT_ELEMENT); IMatchExpression<IInstallableUnit> match = requirement.getMatches(); if (requirement.getMax() > 0 && RequiredCapability.isSimpleRequirement(match)) { attribute(NAMESPACE_ATTRIBUTE, RequiredCapability.extractNamespace(match)); attribute(NAME_ATTRIBUTE, RequiredCapability.extractName(match)); attribute(VERSION_RANGE_ATTRIBUTE, RequiredCapability.extractRange(match)); attribute(CAPABILITY_OPTIONAL_ATTRIBUTE, requirement.getMin() == 0, false); attribute(CAPABILITY_MULTIPLE_ATTRIBUTE, requirement.getMax() > 1, false); } else { writeMatchExpression(match); if (requirement.getMin() != 1) attribute(MIN_ATTRIBUTE, requirement.getMin()); if (requirement.getMax() != 1) attribute(MAX_ATTRIBUTE, requirement.getMax()); } attribute(CAPABILITY_GREED_ATTRIBUTE, requirement.isGreedy(), true); if (requirement.getFilter() != null) writeTrimmedCdata(CAPABILITY_FILTER_ELEMENT, requirement.getFilter().getParameters()[0].toString()); if (requirement.getDescription() != null) writeTrimmedCdata(REQUIREMENT_DESCRIPTION_ELEMENT, requirement.getDescription()); end(REQUIREMENT_ELEMENT); }
protected void writeRequirement(IRequirement requirement) { start(REQUIREMENT_ELEMENT); IMatchExpression<IInstallableUnit> match = requirement.getMatches(); if (requirement.getMax() > 0 && RequiredCapability.isSimpleRequirement(match)) { attribute(NAMESPACE_ATTRIBUTE, RequiredCapability.extractNamespace(match)); attribute(NAME_ATTRIBUTE, RequiredCapability.extractName(match)); attribute(VERSION_RANGE_ATTRIBUTE, RequiredCapability.extractRange(match)); attribute(CAPABILITY_OPTIONAL_ATTRIBUTE, requirement.getMin() == 0, false); attribute(CAPABILITY_MULTIPLE_ATTRIBUTE, requirement.getMax() > 1, false); } else { writeMatchExpression(match); if (requirement.getMin() != 1) attribute(MIN_ATTRIBUTE, requirement.getMin()); if (requirement.getMax() != 1) attribute(MAX_ATTRIBUTE, requirement.getMax()); } attribute(CAPABILITY_GREED_ATTRIBUTE, requirement.isGreedy(), true); if (requirement.getFilter() != null) writeTrimmedCdata(CAPABILITY_FILTER_ELEMENT, requirement.getFilter().getParameters()[0].toString()); if (requirement.getDescription() != null) writeTrimmedCdata(REQUIREMENT_DESCRIPTION_ELEMENT, requirement.getDescription()); end(REQUIREMENT_ELEMENT); }
protected void writeRequirement(IRequirement requirement) { start(REQUIREMENT_ELEMENT); IMatchExpression<IInstallableUnit> match = requirement.getMatches(); if (requirement.getMax() > 0 && RequiredCapability.isSimpleRequirement(match)) { attribute(NAMESPACE_ATTRIBUTE, RequiredCapability.extractNamespace(match)); attribute(NAME_ATTRIBUTE, RequiredCapability.extractName(match)); attribute(VERSION_RANGE_ATTRIBUTE, RequiredCapability.extractRange(match)); attribute(CAPABILITY_OPTIONAL_ATTRIBUTE, requirement.getMin() == 0, false); attribute(CAPABILITY_MULTIPLE_ATTRIBUTE, requirement.getMax() > 1, false); } else { writeMatchExpression(match); if (requirement.getMin() != 1) attribute(MIN_ATTRIBUTE, requirement.getMin()); if (requirement.getMax() != 1) attribute(MAX_ATTRIBUTE, requirement.getMax()); } attribute(CAPABILITY_GREED_ATTRIBUTE, requirement.isGreedy(), true); if (requirement.getFilter() != null) writeTrimmedCdata(CAPABILITY_FILTER_ELEMENT, requirement.getFilter().getParameters()[0].toString()); if (requirement.getDescription() != null) writeTrimmedCdata(REQUIREMENT_DESCRIPTION_ELEMENT, requirement.getDescription()); end(REQUIREMENT_ELEMENT); }