1 11 package org.eclipse.ui.internal.texteditor; 12 13 import org.eclipse.jface.text.TextUtilities; 14 import org.eclipse.ui.texteditor.AnnotationPreference; 15 16 21 public final class AnnotationType { 22 private String fType; 23 private String [] fSuperTypes; 24 private AnnotationPreference fPreference; 25 26 public AnnotationType(String type, String [] superTypes) { 27 fType= type; 28 fSuperTypes= TextUtilities.copy(superTypes); 29 } 30 31 public String getType() { 32 return fType; 33 } 34 35 41 public String [] getSuperTypes() { 42 return fSuperTypes; 43 } 44 45 50 public AnnotationPreference getPreference() { 51 return fPreference; 52 } 53 54 59 public void setAnnotationPreference(AnnotationPreference preference) { 60 fPreference= preference; 61 } 62 63 public boolean isSubtype(String superType) { 64 if (fSuperTypes == null || superType == null) 65 return false; 66 67 if (superType.equals(fType)) 68 return true; 69 70 for (int i= fSuperTypes.length -1; i > -1; i--) { 71 if (superType.equals(fSuperTypes[i])) 72 return true; 73 } 74 75 return false; 76 } 77 } 78 | Popular Tags |