ComponentEditConfig editConfig = component.getEditConfig();
Map<String, DropTarget> dropTargets = (editConfig != null) ? editConfig.getDropTargets() : null;
if (dropTargets != null && !dropTargets.isEmpty()) {
DropTarget dropTarget = null;
// Find the named Drop Target
for (String key : dropTargets.keySet()) {
dropTarget = dropTargets.get(key);
if (StringUtils.equals(name, dropTarget.getName())) {
break;
} else {
dropTarget = null;
}
}
if (dropTarget != null) {
// If editType has not been specified then intelligently determine the best match
editType = (editType == null) ? getWCMEditType(dropTarget) : editType;
// Create the HTML img tag used for the edit icon
html += "<img src=\"/libs/cq/ui/resources/0.gif\"" + " "
+ "class=\"" + dropTarget.getId() + " " + editType.getCssClass() + "\""
+ " " + "alt=\"Drop Target: " + dropTarget.getName() + "\"" + " "
+ "title=\"Drop Target: " + dropTarget.getName() + "\"" + "/>";
}
}
return html;
}