1 11 package org.eclipse.jdt.internal.ui.packageview; 12 13 import org.eclipse.core.runtime.IAdaptable; 14 15 import org.eclipse.ui.IWorkingSet; 16 17 import org.eclipse.jdt.internal.ui.viewsupport.TreeHierarchyLayoutProblemsDecorator; 18 19 import org.eclipse.jdt.ui.JavaElementImageDescriptor; 20 21 22 public class PackageExplorerProblemsDecorator extends TreeHierarchyLayoutProblemsDecorator { 23 24 public PackageExplorerProblemsDecorator() { 25 super(); 26 } 27 28 public PackageExplorerProblemsDecorator(boolean isFlatLayout) { 29 super(isFlatLayout); 30 } 31 32 protected int computeAdornmentFlags(Object obj) { 33 if (!(obj instanceof IWorkingSet)) 34 return super.computeAdornmentFlags(obj); 35 36 IWorkingSet workingSet= (IWorkingSet)obj; 37 IAdaptable[] elements= workingSet.getElements(); 38 int result= 0; 39 for (int i= 0; i < elements.length; i++) { 40 IAdaptable element= elements[i]; 41 int flags= super.computeAdornmentFlags(element); 42 if ((flags & JavaElementImageDescriptor.ERROR) != 0) 43 return JavaElementImageDescriptor.ERROR; 44 if ((flags & JavaElementImageDescriptor.WARNING) != 0) 45 result= JavaElementImageDescriptor.WARNING; 46 } 47 return result; 48 } 49 } 50 | Popular Tags |