/** * Searches the superclass hierarchy to see if any of the specified classes parents have a detail formatter * @param type the current type. Ideally this should be the first parent class. * @return the first detail formatter located walking up the superclass hierarchy or <code>null</code> if none are found * @since 3.2 */ public DetailFormatter getDetailFormatterFromSuperclass(IJavaClassType type) { try { if(type == null) { return null; } DetailFormatter formatter = (DetailFormatter) fDetailFormattersMap.get(type.getName()); if(formatter != null && formatter.isEnabled()) { return formatter; } return getDetailFormatterFromSuperclass(type.getSuperclass()); } catch(DebugException e) {return null;} }
/** * Searches the listing of implemented interfaces to see if one of them has a detail formatter * @param type the type whose interfaces you want to inspect * @return an associated details formatter of <code>null</code> if none is found * @since 3.2 */ public DetailFormatter getDetailFormatterFromInterface(IJavaClassType type) { try { IJavaInterfaceType[] inter = type.getAllInterfaces(); Object formatter = null; for (int i = 0; i < inter.length; i++) { formatter = fDetailFormattersMap.get(inter[i].getName()); if(formatter != null) { return (DetailFormatter) formatter; } } return null; } catch(DebugException e) {return null;} }
if (OSGI_CLASSLOADER.equals(type.getName())) { if (fDirector.getOSGiRuntimeVersion() < 3.5) { fResult = findSourceElement34(classLoaderObject, sourcePath); fResult = findSourceElement(classLoaderObject, sourcePath); } else if (OSGI_CLASSLOADER2.equals(type.getName())) { fResult = findSourceElement(classLoaderObject, sourcePath); } else if (LEGACY_ECLIPSE_CLASSLOADER.equals(type.getName())) { fResult = findSourceElement_legacy(classLoaderObject, sourcePath); } else if (MAIN_CLASS.equals(declaringTypeName)) {
while (type instanceof IJavaClassType) { superTypeNames.add(type.getName()); type = ((IJavaClassType)type).getSuperclass();
/** * Return the detail formatter (code snippet) associate with * the given type or one of its super types. */ private String getDetailFormatterSuperClass(IJavaClassType type) throws DebugException { if (type == null) { return null; } DetailFormatter detailFormatter= (DetailFormatter)fDetailFormattersMap.get(type.getName()); if (detailFormatter != null && detailFormatter.isEnabled()) { return detailFormatter.getSnippet(); } return getDetailFormatterSuperClass(type.getSuperclass()); }
/** * Return the detail formatter (code snippet) associate with * the given type or one of its super types, super interfaces. */ private String getDetailFormatter(IJavaClassType type) throws DebugException { String snippet= getDetailFormatterSuperClass(type); if (snippet != null) { return snippet; } IJavaInterfaceType[] allInterfaces= type.getAllInterfaces(); for (int i= 0; i < allInterfaces.length; i++) { DetailFormatter detailFormatter= (DetailFormatter)fDetailFormattersMap.get(allInterfaces[i].getName()); if (detailFormatter != null && detailFormatter.isEnabled()) { return detailFormatter.getSnippet(); } } return null; }