Bug 129799 type decorations issues
20060228 - also for class files - look at refresh problems: - decorators turned on - change in editor: class to interface
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/InterfaceIndicatorLabelDecorator.java
*/
	public void decorate(Object element, IDecoration decoration) {
		if (element instanceof ICompilationUnit) {
			ICompilationUnit unit= (ICompilationUnit)element;
			try {
				IType type= JavaElementUtil.getMainType(unit);
				if (type != null) {
					ImageDescriptor overlay= getOverlay(type);
					if (overlay != null) {
						decoration.addOverlay(overlay, IDecoration.TOP_LEFT);
					}
				}
			} catch (JavaModelException e) {
				return;
			}
		}
	}
	
	private ImageDescriptor getOverlay(IType type) throws JavaModelException {
		if (type.isAnnotation()) {
			return JavaPluginImages.DESC_OVR_ANNOTATION;
		} else if (type.isInterface()) {
			return JavaPluginImages.DESC_OVR_INTERFACE;
		} else if (type.isEnum()) {
			return JavaPluginImages.DESC_OVR_ENUM;
		}
		return null;
	}
}