R5LabelFormatter.appendCapability(label, item.getCapability());
// Get the icon from the capability namespace
icon = getImage(R5LabelFormatter.getNamespaceImagePath(item.getCapability().getNamespace()), true);
} else if (element instanceof Requirement) {
Requirement requirement = (Requirement) element;
if (Namespace.RESOLUTION_OPTIONAL.equals(requirement.getDirectives().get(Namespace.REQUIREMENT_RESOLUTION_DIRECTIVE)))
label.append(" OPTIONALLY", StyledString.QUALIFIER_STYLER);
label.append(" REQUIRED BY ", StyledString.QUALIFIER_STYLER);
Resource resource = requirement.getResource();
if (resource != null)
R5LabelFormatter.appendResourceLabel(label, resource);
else
label.append(" INITIAL");
label.append(" [", StyledString.QUALIFIER_STYLER);
boolean first = true;
for (Entry<String,String> entry : requirement.getDirectives().entrySet()) {
String key = entry.getKey();
if (!key.equals(Namespace.REQUIREMENT_RESOLUTION_DIRECTIVE)) {
if (!first)
label.append(",", StyledString.QUALIFIER_STYLER);
first = false;