public static TestLevel getTestLevelForIType(IType type) { if (type.getParent() instanceof ICompilationUnit) { return TestLevel.CLASS; } else { return TestLevel.NESTED_CLASS; } }
private boolean isLocalType(IType type) { IJavaElement parent= type.getParent(); return parent instanceof IMember && !(parent instanceof IType); }
private boolean isLocalType(IType type) { IJavaElement parent= type.getParent(); return parent instanceof IMember && !(parent instanceof IType); }
private boolean isLocalType(IType type) { IJavaElement parent= type.getParent(); return parent instanceof IMember && !(parent instanceof IType); }
public static ResourceMapping create(IType type) { // top level types behave like the CU IJavaElement parent= type.getParent(); if (parent instanceof ICompilationUnit) { return create((ICompilationUnit)parent); } return null; }
public static ResourceMapping create(IType type) { // top level types behave like the CU IJavaElement parent= type.getParent(); if (parent instanceof ICompilationUnit) { return create((ICompilationUnit)parent); } return null; }
public static ResourceMapping create(IType type) { // top level types behave like the CU IJavaElement parent= type.getParent(); if (parent instanceof ICompilationUnit) { return create((ICompilationUnit)parent); } return null; }
public static ResourceMapping create(IType type) { // top level types behave like the CU IJavaElement parent= type.getParent(); if (parent instanceof ICompilationUnit) { return create((ICompilationUnit)parent); } return null; }
/** * Get the full type name for the given type, including any enclosing classes. * @param element * @return */ private static String getFullTypeName(IType element) { if (element != null && element.getParent() instanceof IType) { return getFullTypeName((IType)element.getParent()) + "." + element.getElementName(); //$NON-NLS-1$ } else { return element.getElementName(); } }
public static String getFullyQualifiedClassName(IType type) { if (type == null) { throw new IllegalArgumentException("type is null"); } ICompilationUnit cu = (ICompilationUnit) type.getParent(); String packageName = getPackageName(cu); String className = type.getElementName(); String fullyQName = packageName + '.' + className; return fullyQName; }
@Override public boolean canEnableQualifiedNameUpdating() { return !fType.getPackageFragment().isDefaultPackage() && !(fType.getParent() instanceof IType); }
@Override public boolean canEnableQualifiedNameUpdating() { return !fType.getPackageFragment().isDefaultPackage() && !(fType.getParent() instanceof IType); }
@Override public boolean canEnableQualifiedNameUpdating() { return !fType.getPackageFragment().isDefaultPackage() && !(fType.getParent() instanceof IType); }
public boolean canEnableQualifiedNameUpdating() { return !fType.getPackageFragment().isDefaultPackage() && !(fType.getParent() instanceof IType); }
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 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 ICompilationUnit getSelectedCompilationUnit(IStructuredSelection selection) { if (selection.size() == 1) { Object element= selection.getFirstElement(); if (element instanceof ICompilationUnit) { return (ICompilationUnit) element; } else if (element instanceof IType) { IType type= (IType) element; if (type.getParent() instanceof ICompilationUnit) { // only top level types return type.getCompilationUnit(); } } } return null; }
private ICompilationUnit getSelectedCompilationUnit(IStructuredSelection selection) { if (selection.size() == 1) { Object element= selection.getFirstElement(); if (element instanceof ICompilationUnit) { return (ICompilationUnit) element; } else if (element instanceof IType) { IType type= (IType) element; if (type.getParent() instanceof ICompilationUnit) { // only top level types return type.getCompilationUnit(); } } } return null; }