public static boolean isRenameFieldAvailable(final IField field) throws JavaModelException { return Checks.isAvailable(field) && !JdtFlags.isEnum(field); }
private static boolean isEnumTypeFinal(IMember member) throws JavaModelException { if (!(isEnum(member) && member.getElementType() == IJavaElement.TYPE)) return false; // An enum type is implicitly final unless it contains at least one enum constant that has a class body. IJavaElement[] children= member.getChildren(); for (IJavaElement child : children) { if (isEnumConstant((IMember) child) && ((IField) child).getChildren().length != 0) { return false; } } return true; }
private boolean canRunOn(IField[] fields) throws JavaModelException { if (fields == null || fields.length == 0) return false; int count= 0; for (int index= 0; index < fields.length; index++) { if (!JdtFlags.isEnum(fields[index])) count++; } if (count == 0) MessageDialog.openInformation(getShell(), DIALOG_TITLE, ActionMessages.AddGetterSetterAction_not_applicable); return (count > 0); }
private boolean canRunOn(IField[] fields) throws JavaModelException { if (fields == null || fields.length == 0) return false; int count= 0; for (int index= 0; index < fields.length; index++) { if (!JdtFlags.isEnum(fields[index])) count++; } if (count == 0) MessageDialog.openInformation(getShell(), DIALOG_TITLE, ActionMessages.AddGetterSetterAction_not_applicable); return (count > 0); }
private boolean canRunOn(IField[] fields) throws JavaModelException { if (fields != null && fields.length > 0) { for (int index= 0; index < fields.length; index++) { if (JdtFlags.isEnum(fields[index])) { MessageDialog.openInformation(getShell(), ActionMessages.GenerateConstructorUsingFieldsAction_error_title, ActionMessages.GenerateConstructorUsingFieldsAction_enum_not_applicable); return false; } } return true; } return false; }
private boolean canRunOn(IField[] fields) throws JavaModelException { if (fields != null && fields.length > 0) { for (int index= 0; index < fields.length; index++) { if (JdtFlags.isEnum(fields[index])) { MessageDialog.openInformation(getShell(), ActionMessages.GenerateConstructorUsingFieldsAction_error_title, ActionMessages.GenerateConstructorUsingFieldsAction_enum_not_applicable); return false; } } return true; } return false; }
private boolean canRunOn(IField[] fields) throws JavaModelException { if (fields != null && fields.length > 0) { for (int index= 0; index < fields.length; index++) { if (JdtFlags.isEnum(fields[index])) { MessageDialog.openInformation(getShell(), ActionMessages.GenerateConstructorUsingFieldsAction_error_title, ActionMessages.GenerateConstructorUsingFieldsAction_enum_not_applicable); return false; } } return true; } return false; }
public static BodyDeclaration getFieldOrEnumConstantDeclaration(IField iField, CompilationUnit cuNode) throws JavaModelException { if (JdtFlags.isEnum(iField)) return getEnumConstantDeclaration(iField, cuNode); else return getFieldDeclarationNode(iField, cuNode); }
public static BodyDeclaration getFieldOrEnumConstantDeclaration(IField iField, CompilationUnit cuNode) throws JavaModelException { if (JdtFlags.isEnum(iField)) return getEnumConstantDeclaration(iField, cuNode); else return getFieldDeclarationNode(iField, cuNode); }
public static BodyDeclaration getFieldOrEnumConstantDeclaration(IField iField, CompilationUnit cuNode) throws JavaModelException { if (JdtFlags.isEnum(iField)) return getEnumConstantDeclaration(iField, cuNode); else return getFieldDeclarationNode(iField, cuNode); }
public static boolean isConvertAnonymousAvailable(final IType type) throws JavaModelException { if (Checks.isAvailable(type)) { final IJavaElement element= type.getParent(); if (element instanceof IField && JdtFlags.isEnum((IMember) element)) return false; return type.isAnonymous(); } return false; }
public static boolean isConvertAnonymousAvailable(final IType type) throws JavaModelException { if (Checks.isAvailable(type)) { final IJavaElement element = type.getParent(); if (element instanceof IField && JdtFlags.isEnum((IMember) element)) { return false; } return type.isAnonymous(); } return false; }
public static boolean isSelfEncapsulateAvailable(IField field) throws JavaModelException { return Checks.isAvailable(field) && !JdtFlags.isEnum(field) && !field.getDeclaringType().isInterface(); }
public static boolean isConvertAnonymousAvailable(final IType type) throws JavaModelException { if (Checks.isAvailable(type)) { final IJavaElement element= type.getParent(); if (element instanceof IField && JdtFlags.isEnum((IMember) element)) return false; return type.isAnonymous(); } return false; }
public static boolean isConvertAnonymousAvailable(final IType type) throws JavaModelException { if (Checks.isAvailable(type)) { final IJavaElement element= type.getParent(); if (element instanceof IField && JdtFlags.isEnum((IMember) element)) return false; return type.isAnonymous(); } return false; }
private boolean canRunOn(IField[] fields) throws JavaModelException { if (fields == null || fields.length == 0) return false; int count= 0; for (int index= 0; index < fields.length; index++) { if (!JdtFlags.isEnum(fields[index]) && !hasPrimitiveType(fields[index]) || isArray(fields[index])) count++; } if (count == 0) MessageDialog.openInformation(getShell(), DIALOG_TITLE, ActionMessages.AddDelegateMethodsAction_not_applicable); return (count > 0); }
public static boolean isSelfEncapsulateAvailable(final IStructuredSelection selection) throws JavaModelException { if (selection.size() == 1) { if (selection.getFirstElement() instanceof IField) { final IField field= (IField) selection.getFirstElement(); return Checks.isAvailable(field) && !JdtFlags.isEnum(field); } } return false; }
private boolean canRunOn(IField[] fields) throws JavaModelException { if (fields == null || fields.length == 0) return false; int count= 0; for (int index= 0; index < fields.length; index++) { if (!JdtFlags.isEnum(fields[index]) && !hasPrimitiveType(fields[index]) || isArray(fields[index])) count++; } if (count == 0) MessageDialog.openInformation(getShell(), DIALOG_TITLE, ActionMessages.AddDelegateMethodsAction_not_applicable); return (count > 0); }
public static boolean isStatic(IMember member) throws JavaModelException { if (isNestedInterfaceOrAnnotation(member)) return true; if (member.getElementType() != IJavaElement.METHOD && isInterfaceOrAnnotationMember(member)) return true; if (isEnum(member) && (member.getElementType() == IJavaElement.FIELD || member.getDeclaringType() != null)) return true; return Flags.isStatic(member.getFlags()); }
public static boolean isStatic(IMember member) throws JavaModelException { if (isNestedInterfaceOrAnnotation(member)) return true; if (member.getElementType() != IJavaElement.METHOD && isInterfaceOrAnnotationMember(member)) return true; if (isEnum(member) && (member.getElementType() == IJavaElement.FIELD || member.getDeclaringType() != null)) return true; return Flags.isStatic(member.getFlags()); }