public static IType[] getMainTypes(IJavaElement[] javaElements) throws JavaModelException { List<IJavaElement> result= new ArrayList<>(); for (int i= 0; i < javaElements.length; i++) { IJavaElement element= javaElements[i]; if (element instanceof IType && JavaElementUtil.isMainType((IType)element)) result.add(element); } return result.toArray(new IType[result.size()]); }
public static IType[] getMainTypes(IJavaElement[] javaElements) throws JavaModelException { List<IJavaElement> result= new ArrayList<>(); for (int i= 0; i < javaElements.length; i++) { IJavaElement element= javaElements[i]; if (element instanceof IType && JavaElementUtil.isMainType((IType)element)) result.add(element); } return result.toArray(new IType[result.size()]); }
public static IType[] getMainTypes(IJavaElement[] javaElements) throws JavaModelException { List result= new ArrayList(); for (int i= 0; i < javaElements.length; i++) { IJavaElement element= javaElements[i]; if (element instanceof IType && JavaElementUtil.isMainType((IType)element)) result.add(element); } return (IType[]) result.toArray(new IType[result.size()]); }
public static IType getMainType(ICompilationUnit cu) throws JavaModelException{ IType[] types= cu.getTypes(); for (int i = 0; i < types.length; i++) { if (isMainType(types[i])) return types[i]; } return null; }
public static IType getMainType(ICompilationUnit cu) throws JavaModelException{ IType[] types= cu.getTypes(); for (int i = 0; i < types.length; i++) { if (isMainType(types[i])) return types[i]; } return null; }
public static IType getMainType(ICompilationUnit cu) throws JavaModelException{ IType[] types= cu.getTypes(); for (int i = 0; i < types.length; i++) { if (isMainType(types[i])) return types[i]; } return null; }
public static boolean isMoveInnerAvailable(final IType type) throws JavaModelException { return Checks.isAvailable(type) && !Checks.isAnonymous(type) && !JavaElementUtil.isMainType(type) && !Checks.isInsideLocalType(type); }
public static boolean isMoveInnerAvailable(final IType type) throws JavaModelException { return Checks.isAvailable(type) && !Checks.isAnonymous(type) && !JavaElementUtil.isMainType(type) && !Checks.isInsideLocalType(type); }
private void initialize() throws JavaModelException { fQualifiedTypeName= JavaModelUtil.concatenateName(fType.getPackageFragment().getElementName(), fType.getElementName()); fEnclosingInstanceFieldName= getInitialNameForEnclosingInstanceField(); fSourceRewrite= new CompilationUnitRewrite(fType.getCompilationUnit()); fIsInstanceFieldCreationPossible= !(JdtFlags.isStatic(fType) || fType.isAnnotation() || fType.isEnum() || (fType.getDeclaringType() == null && !JavaElementUtil.isMainType(fType))); fIsInstanceFieldCreationMandatory= fIsInstanceFieldCreationPossible && isInstanceFieldCreationMandatory(); fCreateInstanceField= fIsInstanceFieldCreationMandatory; }
private void initialize() throws JavaModelException { fQualifiedTypeName= JavaModelUtil.concatenateName(fType.getPackageFragment().getElementName(), fType.getElementName()); fEnclosingInstanceFieldName= getInitialNameForEnclosingInstanceField(); fSourceRewrite= new CompilationUnitRewrite(fType.getCompilationUnit()); fIsInstanceFieldCreationPossible= !(JdtFlags.isStatic(fType) || fType.isAnnotation() || fType.isEnum() || (fType.getDeclaringType() == null && !JavaElementUtil.isMainType(fType))); fIsInstanceFieldCreationMandatory= fIsInstanceFieldCreationPossible && isInstanceFieldCreationMandatory(); fCreateInstanceField= fIsInstanceFieldCreationMandatory; }