protected String getIUDescription(IInstallableUnit iu) { if (iu != null) { IUpdateDescriptor updateDescriptor = iu.getUpdateDescriptor(); if (updateDescriptor != null && updateDescriptor.getDescription() != null && updateDescriptor.getDescription().length() > 0) return updateDescriptor.getDescription(); } return super.getIUDescription(iu); }
private String getUpdateText(IInstallableUnit iu) { StringBuffer buffer = new StringBuffer(); buffer.append(new IUDetailsLabelProvider().getClipboardText(getUpdate().replacement, CopyUtils.DELIMITER)); buffer.append(CopyUtils.NEWLINE); buffer.append(CopyUtils.NEWLINE); String text = iu.getUpdateDescriptor().getDescription(); if (text != null) buffer.append(text); else { text = iu.getProperty(IInstallableUnit.PROP_DESCRIPTION); if (text != null) buffer.append(text); } return buffer.toString(); }
/** * Return an update descriptor localized for the receiver's locale. * * @param iu the IInstallableUnit in question * @return the localized update descriptor defined by the IInstallableUnit */ public IUpdateDescriptor getUpdateDescriptor(IInstallableUnit iu, String locale) { if (locale == null) locale = getCurrentLocale(); IUpdateDescriptor descriptor = iu.getUpdateDescriptor(); String body = (descriptor != null ? descriptor.getDescription() : null); if (body == null || body.length() <= 1 || body.charAt(0) != '%') return descriptor; final String actualKey = body.substring(1); // Strip off the % body = getLocalizedIUProperty(iu, actualKey, locale); return MetadataFactory.createUpdateDescriptor(descriptor.getIUsBeingUpdated(), descriptor.getSeverity(), body, descriptor.getLocation()); }
protected void writeUpdateDescriptor(IInstallableUnit iu, IUpdateDescriptor descriptor) { if (descriptor == null) return; if (descriptor.getIUsBeingUpdated().size() > 1) throw new IllegalStateException(); IMatchExpression<IInstallableUnit> singleUD = descriptor.getIUsBeingUpdated().iterator().next(); start(UPDATE_DESCRIPTOR_ELEMENT); if (RequiredCapability.isSimpleRequirement(singleUD)) { attribute(ID_ATTRIBUTE, RequiredCapability.extractName(singleUD)); attribute(VERSION_RANGE_ATTRIBUTE, RequiredCapability.extractRange(singleUD)); } else { writeMatchExpression(singleUD); } attribute(UPDATE_DESCRIPTOR_SEVERITY, descriptor.getSeverity()); attribute(DESCRIPTION_ATTRIBUTE, descriptor.getDescription()); end(UPDATE_DESCRIPTOR_ELEMENT); }
protected void writeUpdateDescriptor(IInstallableUnit iu, IUpdateDescriptor descriptor) { if (descriptor == null) return; if (descriptor.getIUsBeingUpdated().size() > 1) throw new IllegalStateException(); IMatchExpression<IInstallableUnit> singleUD = descriptor.getIUsBeingUpdated().iterator().next(); start(UPDATE_DESCRIPTOR_ELEMENT); if (RequiredCapability.isSimpleRequirement(singleUD)) { attribute(ID_ATTRIBUTE, RequiredCapability.extractName(singleUD)); attribute(VERSION_RANGE_ATTRIBUTE, RequiredCapability.extractRange(singleUD)); } else { writeMatchExpression(singleUD); } attribute(UPDATE_DESCRIPTOR_SEVERITY, descriptor.getSeverity()); attribute(DESCRIPTION_ATTRIBUTE, descriptor.getDescription()); end(UPDATE_DESCRIPTOR_ELEMENT); }
protected void writeUpdateDescriptor(IInstallableUnit iu, IUpdateDescriptor descriptor) { if (descriptor == null) return; if (descriptor.getIUsBeingUpdated().size() > 1) throw new IllegalStateException(); IMatchExpression<IInstallableUnit> singleUD = descriptor.getIUsBeingUpdated().iterator().next(); start(UPDATE_DESCRIPTOR_ELEMENT); if (RequiredCapability.isSimpleRequirement(singleUD)) { attribute(ID_ATTRIBUTE, RequiredCapability.extractName(singleUD)); attribute(VERSION_RANGE_ATTRIBUTE, RequiredCapability.extractRange(singleUD)); } else { writeMatchExpression(singleUD); } attribute(UPDATE_DESCRIPTOR_SEVERITY, descriptor.getSeverity()); attribute(DESCRIPTION_ATTRIBUTE, descriptor.getDescription()); end(UPDATE_DESCRIPTOR_ELEMENT); }