* @param decoration
*/
public void decorate(Object element, IDecoration decoration) {
try {
// Internal decorator might be null so be prepared
ILightweightLabelDecorator currentDecorator = internalGetDecorator();
if(currentDecorator == null) {
return;
}
if (isAdaptable()) {
String[] classes = getObjectClasses();
for (int i = 0; i < classes.length; i++) {
String className = classes[i];
Object adapted = LegacyResourceSupport.getAdapter(element,
className);
if (adapted != null) {
currentDecorator.decorate(adapted, decoration);
}
}
}
else{
if (currentDecorator != null && element != null) {
currentDecorator.decorate(element, decoration);
}
}
} catch (CoreException exception) {
handleCoreException(exception);
}