@Override public int category(Object element) { try { if (element instanceof IType) { if (((IType) element).isClass()) return 1; return 0; } } catch (JavaModelException e) { } return 2; } }
/** * @see IClassFile */ public boolean isClass() throws JavaModelException { return getType().isClass(); } /**
/** * @see IClassFile */ public boolean isClass() throws JavaModelException { return getType().isClass(); } /**
/** * @see IClassFile */ @Override public boolean isClass() throws JavaModelException { return getType().isClass(); } /**
/** * @see IClassFile */ public boolean isClass() throws JavaModelException { return getType().isClass(); } /**
/** * @see IClassFile */ public boolean isClass() throws JavaModelException { return getType().isClass(); } /**
/** * @see IClassFile */ public boolean isClass() throws JavaModelException { return getType().isClass(); } /**
private void addTypes(IType[] allSubtypes, HashSet<ICompilationUnit> cus, List<IType> types) throws JavaModelException { for (int i = 0; i < allSubtypes.length; i++) { IType type = allSubtypes[i]; IField field = type.getField(NAME_FIELD); if (!field.exists()) { if (type.isClass() && cus.contains(type.getCompilationUnit())) { types.add(type); } } } }
private void addTypes(IType[] allSubtypes, HashSet<ICompilationUnit> cus, List<IType> types) throws JavaModelException { for (int i= 0; i < allSubtypes.length; i++) { IType type= allSubtypes[i]; IField field= type.getField(NAME_FIELD); if (!field.exists()) { if (type.isClass() && cus.contains(type.getCompilationUnit())){ types.add(type); } } } }
private void addTypes(IType[] allSubtypes, HashSet cus, List types) throws JavaModelException { for (int i= 0; i < allSubtypes.length; i++) { IType type= allSubtypes[i]; IField field= type.getField(NAME_FIELD); if (!field.exists()) { if (type.isClass() && cus.contains(type.getCompilationUnit())){ types.add(type); } } } }
private void addTypes(IType[] allSubtypes, HashSet<ICompilationUnit> cus, List<IType> types) throws JavaModelException { for (int i= 0; i < allSubtypes.length; i++) { IType type= allSubtypes[i]; IField field= type.getField(NAME_FIELD); if (!field.exists()) { if (type.isClass() && cus.contains(type.getCompilationUnit())){ types.add(type); } } } }
private boolean isAbstractClass(IType res) { try { if (res.isClass() && Flags.isAbstract(res.getFlags())) return true; } catch (JavaModelException e) { //ignore } return false; }
private boolean isInnerOrAnonymousClass(IType res) { try { if (res.isClass() && (res.isAnonymous() || (Flags.isPrivate(res.getFlags())) || res.getFullyQualifiedName().indexOf("$") > 0)) //must be better way to discover if it is an inner class //$NON-NLS-1$ return true; } catch (JavaModelException e) { //ignore } return false; }
public static boolean isExtractSupertypeAvailable(final IMember[] members) throws JavaModelException { if (members != null && members.length != 0) { final IType type= getTopLevelType(members); if (type != null && !type.isClass()) return false; for (int index= 0; index < members.length; index++) { if (!isExtractSupertypeAvailable(members[index])) return false; } return members.length == 1 || isCommonDeclaringType(members); } return false; }
public static boolean isExtractClassAvailable(IType type) throws JavaModelException { if (type == null) { return false; } if (!type.exists()) { return false; } return ReorgUtils.isInsideCompilationUnit(type) && type.isClass() && !type.isAnonymous() && !type.isLambda(); } }
public static boolean isExtractClassAvailable(IType type) throws JavaModelException { if (type == null) return false; if (!type.exists()) return false; return ReorgUtils.isInsideCompilationUnit(type) && type.isClass() && !type.isAnonymous() && !type.isLambda(); } }
public static boolean isExtractClassAvailable(IType type) throws JavaModelException { if (type == null) return false; if (!type.exists()) return false; return ReorgUtils.isInsideCompilationUnit(type) && type.isClass() && !type.isAnonymous() && !type.isLambda(); } }
static ImageDescriptor getImageDescriptor(IMember element) { int t= element.getElementType(); if (t == IJavaElement.TYPE) { IType type= (IType) element; try { return getTypeImageDescriptor(type.isClass()); } catch (CoreException e) { JavaPlugin.log(e); return JavaPluginImages.DESC_OBJS_GHOST; } } return getImageDescriptor(t); }
@Override public boolean test(IType candidate) { if (!super.test(candidate)) { return false; } try { return candidate.isClass() && !Flags.isAbstract(candidate.getFlags()); } catch (JavaModelException e) { throw new SdkException("Unable to check for flags in type '" + candidate.getFullyQualifiedName() + "'.", e); } } };