@Override protected int getTypeFlags(IType type) { ITypeHierarchy hierarchy= getHierarchy(type); if (hierarchy != null) { return fHierarchy.getHierarchy().getCachedFlags(type); } return 0; }
protected int getTypeFlags(IType type) { ITypeHierarchy hierarchy= getHierarchy(type); if (hierarchy != null) { return fHierarchy.getHierarchy().getCachedFlags(type); } return 0; }
@Override protected int getTypeFlags(IType type) { ITypeHierarchy hierarchy= getHierarchy(type); if (hierarchy != null) { return fHierarchy.getHierarchy().getCachedFlags(type); } return 0; }
public static boolean isSuperType(ITypeHierarchy hierarchy, IType possibleSuperType, IType type) { // filed bug 112635 to add this method to ITypeHierarchy IType superClass= hierarchy.getSuperclass(type); if (superClass != null && (possibleSuperType.equals(superClass) || isSuperType(hierarchy, possibleSuperType, superClass))) { return true; } if (Flags.isInterface(hierarchy.getCachedFlags(possibleSuperType))) { IType[] superInterfaces= hierarchy.getSuperInterfaces(type); for (int i= 0; i < superInterfaces.length; i++) { IType curr= superInterfaces[i]; if (possibleSuperType.equals(curr) || isSuperType(hierarchy, possibleSuperType, curr)) { return true; } } } return false; }
public static boolean isSuperType(ITypeHierarchy hierarchy, IType possibleSuperType, IType type) { // filed bug 112635 to add this method to ITypeHierarchy IType superClass= hierarchy.getSuperclass(type); if (superClass != null && (possibleSuperType.equals(superClass) || isSuperType(hierarchy, possibleSuperType, superClass))) { return true; } if (Flags.isInterface(hierarchy.getCachedFlags(possibleSuperType))) { IType[] superInterfaces= hierarchy.getSuperInterfaces(type); for (int i= 0; i < superInterfaces.length; i++) { IType curr= superInterfaces[i]; if (possibleSuperType.equals(curr) || isSuperType(hierarchy, possibleSuperType, curr)) { return true; } } } return false; }
public static boolean isSuperType(ITypeHierarchy hierarchy, IType possibleSuperType, IType type) { // filed bug 112635 to add this method to ITypeHierarchy IType superClass= hierarchy.getSuperclass(type); if (superClass != null && (possibleSuperType.equals(superClass) || isSuperType(hierarchy, possibleSuperType, superClass))) { return true; } if (Flags.isInterface(hierarchy.getCachedFlags(possibleSuperType))) { IType[] superInterfaces= hierarchy.getSuperInterfaces(type); for (int i= 0; i < superInterfaces.length; i++) { IType curr= superInterfaces[i]; if (possibleSuperType.equals(curr) || isSuperType(hierarchy, possibleSuperType, curr)) { return true; } } } return false; }
public static void findTestImplementorClasses(ITypeHierarchy typeHierarchy, IType testInterface, IRegion region, Set<IType> result) throws JavaModelException { IType[] subtypes= typeHierarchy.getAllSubtypes(testInterface); for (int i= 0; i < subtypes.length; i++) { IType type= subtypes[i]; int cachedFlags= typeHierarchy.getCachedFlags(type); if (!Flags.isInterface(cachedFlags) && !Flags.isAbstract(cachedFlags) // do the cheaper tests first && region.contains(type) && CoreTestSearchEngine.isAccessibleClass(type)) { result.add(type); } } }
public static void findTestImplementorClasses(ITypeHierarchy typeHierarchy, IType testInterface, IRegion region, Set result) throws JavaModelException { IType[] subtypes= typeHierarchy.getAllSubtypes(testInterface); for (int i= 0; i < subtypes.length; i++) { IType type= subtypes[i]; int cachedFlags= typeHierarchy.getCachedFlags(type); if (!Flags.isInterface(cachedFlags) && !Flags.isAbstract(cachedFlags) // do the cheaper tests first && region.contains(type) && CoreTestSearchEngine.isAccessibleClass(type)) { result.add(type); } } }
public static boolean isSuperType(ITypeHierarchy hierarchy, IType possibleSuperType, IType type) { // filed bug 112635 to add this method to ITypeHierarchy IType superClass= hierarchy.getSuperclass(type); if (superClass != null && (possibleSuperType.equals(superClass) || isSuperType(hierarchy, possibleSuperType, superClass))) { return true; } if (Flags.isInterface(hierarchy.getCachedFlags(possibleSuperType))) { IType[] superInterfaces= hierarchy.getSuperInterfaces(type); for (int i= 0; i < superInterfaces.length; i++) { IType curr= superInterfaces[i]; if (possibleSuperType.equals(curr) || isSuperType(hierarchy, possibleSuperType, curr)) { return true; } } } return false; }
protected final void getTypesInHierarchy(IType type, List res) { ITypeHierarchy hierarchy= getHierarchy(); if (hierarchy != null) { IType[] types= hierarchy.getSubtypes(type); if (isObject(type)) { for (int i= 0; i < types.length; i++) { IType curr= types[i]; if (!isAnonymousFromInterface(curr)) { // no anonymous classes on 'Object' -> will be children of interface res.add(curr); } } } else { boolean isHierarchyOnType= (hierarchy.getType() != null); boolean isClass= !Flags.isInterface(hierarchy.getCachedFlags(type)); if (isClass || isHierarchyOnType) { for (int i= 0; i < types.length; i++) { res.add(types[i]); } } else { for (int i= 0; i < types.length; i++) { IType curr= types[i]; // no classes implementing interfaces, only if anonymous if (Flags.isInterface(hierarchy.getCachedFlags(curr)) || isAnonymous(curr)) { res.add(curr); } } } } } }
if (Flags.isInterface(hierarchy.getCachedFlags(input))) { res.add(input); } else if (isAnonymousFromInterface(input)) {
boolean isClass= !Flags.isInterface(hierarchy.getCachedFlags(type)); if (isClass || isHierarchyOnType) { for (int i= 0; i < types.length; i++) { IType curr= types[i]; if (Flags.isInterface(hierarchy.getCachedFlags(curr)) || isAnonymous(curr)) { res.add(curr);
boolean isClass= !Flags.isInterface(hierarchy.getCachedFlags(type)); if (isClass || isHierarchyOnType) { for (int i= 0; i < types.length; i++) { IType curr= types[i]; if (Flags.isInterface(hierarchy.getCachedFlags(curr)) || isAnonymous(curr)) { res.add(curr);
if (Flags.isInterface(hierarchy.getCachedFlags(input))) { res.add(input); } else if (isAnonymousFromInterface(input)) {
if (Flags.isInterface(hierarchy.getCachedFlags(input))) { res.add(input); } else if (isAnonymousFromInterface(input)) {
int flags= hierarchy.getCachedFlags(type); if (flags == -1) { return new JavaElementImageDescriptor(JavaPluginImages.DESC_OBJS_CLASS, 0, JavaElementImageProvider.BIG_SIZE); boolean isInInterfaceOrAnnotation= false; if (isInner) { int declaringTypeFlags= hierarchy.getCachedFlags(declaringType); if (declaringTypeFlags != -1) { isInInterfaceOrAnnotation= Flags.isInterface(declaringTypeFlags);
int flags= hierarchy.getCachedFlags(type); if (flags == -1) { return new JavaElementImageDescriptor(JavaPluginImages.DESC_OBJS_CLASS, 0, JavaElementImageProvider.BIG_SIZE); boolean isInInterfaceOrAnnotation= false; if (isInner) { int declaringTypeFlags= hierarchy.getCachedFlags(declaringType); if (declaringTypeFlags != -1) { isInInterfaceOrAnnotation= Flags.isInterface(declaringTypeFlags);
private ImageDescriptor getTypeImageDescriptor(IType type) { ITypeHierarchy hierarchy= fHierarchy.getHierarchy(); if (hierarchy == null) { return new JavaElementImageDescriptor(JavaPluginImages.DESC_OBJS_CLASS, 0, JavaElementImageProvider.BIG_SIZE); } int flags= hierarchy.getCachedFlags(type); if (flags == -1) { return new JavaElementImageDescriptor(JavaPluginImages.DESC_OBJS_CLASS, 0, JavaElementImageProvider.BIG_SIZE); } boolean isInterface= Flags.isInterface(flags); boolean isInner= (type.getDeclaringType() != null); ImageDescriptor desc= JavaElementImageProvider.getTypeImageDescriptor(isInner, false, flags, isDifferentScope(type)); int adornmentFlags= 0; if (Flags.isFinal(flags)) { adornmentFlags |= JavaElementImageDescriptor.FINAL; } if (Flags.isAbstract(flags) && !isInterface) { adornmentFlags |= JavaElementImageDescriptor.ABSTRACT; } if (Flags.isStatic(flags)) { adornmentFlags |= JavaElementImageDescriptor.STATIC; } return new JavaElementImageDescriptor(desc, adornmentFlags, JavaElementImageProvider.BIG_SIZE); }