protected void decorateJavaElement(IJavaElement element, IDecoration decoration) {
int type = element.getElementType();
if (type == IJavaElement.PACKAGE_FRAGMENT_ROOT || type == IJavaElement.CLASS_FILE
|| type == IJavaElement.COMPILATION_UNIT) {
IBeansModel model = BeansCorePlugin.getModel();
IBeansProject project = model.getProject(element.getJavaProject().getProject());
if (project instanceof ILazyInitializedModelElement && ((ILazyInitializedModelElement) project).isInitialized()) {
try {
if (type == IJavaElement.PACKAGE_FRAGMENT_ROOT) {
// Decorate JAR file
IResource resource = ((IPackageFragmentRoot) element).getResource();
if (resource instanceof IFile) {
for (IBeansConfig config : project.getConfigs()) {
if (config.getElementResource().equals(resource)) {
decoration.addOverlay(BeansUIImages.DESC_OVR_SPRING);
break;
}
}