Codota Logo
IType.newTypeHierarchy
Code IndexAdd Codota to your IDE (free)

How to use
newTypeHierarchy
method
in
org.eclipse.jdt.core.IType

Best Java code snippets using org.eclipse.jdt.core.IType.newTypeHierarchy (Showing top 20 results out of 315)

  • Common ways to obtain IType
private void myMethod () {
IType i =
  • Codota IconIMethod method;method.getDeclaringType()
  • Codota IconIJavaProject javaProject;String fullyQualifiedName;javaProject.findType(fullyQualifiedName)
  • Codota IconIMember member;member.getDeclaringType()
  • Smart code suggestions by Codota
}
origin: stackoverflow.com

 IFile myJavaFile = <get the file>
ICompilationUnit unit = JavaCore.createFromFile(myJavaFile);
IType[] types = unit.getAllTypes();
for (IType type : types) {
 ITypeHierarchy th= type.newTypeHierarchy(null);
 // do something with the hierarchy
}
origin: org.eclipse.jdt/org.eclipse.jdt.ui

private ITypeHierarchy getHierarchyOfDeclaringClass(IProgressMonitor monitor) throws JavaModelException {
  try {
    if (fCachedClassHierarchy != null)
      return fCachedClassHierarchy;
    fCachedClassHierarchy= getDeclaringType().newTypeHierarchy(monitor);
    return fCachedClassHierarchy;
  } finally {
    monitor.done();
  }
}
origin: org.eclipse/org.eclipse.jdt.ui

private ITypeHierarchy getHierarchyOfDeclaringClass(IProgressMonitor monitor) throws JavaModelException {
  try {
    if (fCachedClassHierarchy != null)
      return fCachedClassHierarchy;
    fCachedClassHierarchy= getDeclaringType().newTypeHierarchy(monitor);
    return fCachedClassHierarchy;
  } finally {
    monitor.done();
  }
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

private ITypeHierarchy getHierarchyOfDeclaringClass(IProgressMonitor monitor) throws JavaModelException {
  try {
    if (fCachedClassHierarchy != null)
      return fCachedClassHierarchy;
    fCachedClassHierarchy= getDeclaringType().newTypeHierarchy(monitor);
    return fCachedClassHierarchy;
  } finally {
    monitor.done();
  }
}
origin: angelozerr/jdt-codemining

/**
 * Return the count of implementation for the given java element type.
 * 
 * @param type    the java element type.
 * @param monitor the monitor
 * @return the count of implementation for the given java element type.
 * @throws JavaModelException throws when Java error
 */
private static long countImplementations(IType type, IProgressMonitor monitor) throws JavaModelException {
  IType[] results = type.newTypeHierarchy(monitor).getAllSubtypes(type);
  return Stream.of(results).filter(t -> t.getAncestor(IJavaElement.COMPILATION_UNIT) != null).count();
}
origin: org.eclipse.jdt/org.eclipse.jdt.ui

/**
 * Return the count of implementation for the given java element type.
 * 
 * @param type the java element type.
 * @param monitor the monitor
 * @return the count of implementation for the given java element type.
 * @throws JavaModelException throws when Java error
 */
private static long countImplementations(IType type, IProgressMonitor monitor) throws JavaModelException {
  IType[] results= type.newTypeHierarchy(monitor).getAllSubtypes(type);
  return Stream.of(results).filter(t -> t.getAncestor(IJavaElement.COMPILATION_UNIT) != null).count();
}
origin: org.eclipse/org.eclipse.jdt.ui

public Collection findImplementingTypes(IType type, IProgressMonitor progressMonitor) {
  ITypeHierarchy typeHierarchy;
  try {
    typeHierarchy = type.newTypeHierarchy(progressMonitor);
    IType[] implementingTypes = typeHierarchy.getAllClasses();
    HashSet result = new HashSet(Arrays.asList(implementingTypes));
    return result;
  } catch (JavaModelException e) {
    JavaPlugin.log(e);
  }
  return null;
}
origin: eclipse/eclipse.jdt.ls

private ITypeHierarchy getCachedHierarchy(IType declaring, IProgressMonitor monitor) throws JavaModelException {
  if (fCachedHierarchy != null && declaring.equals(fCachedHierarchy.getType())) {
    return fCachedHierarchy;
  }
  fCachedHierarchy= declaring.newTypeHierarchy(new SubProgressMonitor(monitor, 1));
  return fCachedHierarchy;
}
origin: org.eclipse.jdt/org.eclipse.jdt.ui

private ITypeHierarchy getCachedHierarchy(IType declaring, IProgressMonitor monitor) throws JavaModelException {
  if (fCachedHierarchy != null && declaring.equals(fCachedHierarchy.getType()))
    return fCachedHierarchy;
  fCachedHierarchy= declaring.newTypeHierarchy(new SubProgressMonitor(monitor, 1));
  return fCachedHierarchy;
}
origin: org.eclipse/org.eclipse.jdt.ui

private ITypeHierarchy getCachedHierarchy(IType declaring, IProgressMonitor monitor) throws JavaModelException {
  if (fCachedHierarchy != null && declaring.equals(fCachedHierarchy.getType()))
    return fCachedHierarchy;
  fCachedHierarchy= declaring.newTypeHierarchy(new SubProgressMonitor(monitor, 1));
  return fCachedHierarchy;
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

private ITypeHierarchy getCachedHierarchy(IType declaring, IProgressMonitor monitor) throws JavaModelException {
  if (fCachedHierarchy != null && declaring.equals(fCachedHierarchy.getType()))
    return fCachedHierarchy;
  fCachedHierarchy= declaring.newTypeHierarchy(new SubProgressMonitor(monitor, 1));
  return fCachedHierarchy;
}
origin: org.eclipse.jdt/org.eclipse.jdt.ui

private ITypeHierarchy getCachedTypeHierarchy(IProgressMonitor monitor) throws JavaModelException {
  if (fCachedTypeHierarchy == null)
    fCachedTypeHierarchy= fMethod.getDeclaringType().newTypeHierarchy(new SubProgressMonitor(monitor, 1));
  return fCachedTypeHierarchy;
}
origin: org.eclipse.jdt/org.eclipse.jdt.ui

public ITypeHierarchy getDestinationTypeHierarchy(final IProgressMonitor monitor) throws JavaModelException {
  try {
    if (fCachedDestinationTypeHierarchy != null && fCachedDestinationTypeHierarchy.getType().equals(getDestinationType()))
      return fCachedDestinationTypeHierarchy;
    fCachedDestinationTypeHierarchy= getDestinationType().newTypeHierarchy(fOwner, monitor);
    return fCachedDestinationTypeHierarchy;
  } finally {
    monitor.done();
  }
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

public ITypeHierarchy getDestinationTypeHierarchy(final IProgressMonitor monitor) throws JavaModelException {
  try {
    if (fCachedDestinationTypeHierarchy != null && fCachedDestinationTypeHierarchy.getType().equals(getDestinationType()))
      return fCachedDestinationTypeHierarchy;
    fCachedDestinationTypeHierarchy= getDestinationType().newTypeHierarchy(fOwner, monitor);
    return fCachedDestinationTypeHierarchy;
  } finally {
    monitor.done();
  }
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

private ITypeHierarchy getCachedTypeHierarchy(IProgressMonitor monitor) throws JavaModelException {
  if (fCachedTypeHierarchy == null)
    fCachedTypeHierarchy= fMethod.getDeclaringType().newTypeHierarchy(new SubProgressMonitor(monitor, 1));
  return fCachedTypeHierarchy;
}
origin: org.eclipse/org.eclipse.jdt.ui

public ITypeHierarchy getDestinationTypeHierarchy(final IProgressMonitor monitor) throws JavaModelException {
  try {
    if (fCachedDestinationTypeHierarchy != null && fCachedDestinationTypeHierarchy.getType().equals(getDestinationType()))
      return fCachedDestinationTypeHierarchy;
    fCachedDestinationTypeHierarchy= getDestinationType().newTypeHierarchy(fOwner, monitor);
    return fCachedDestinationTypeHierarchy;
  } finally {
    monitor.done();
  }
}
origin: org.eclipse/org.eclipse.jdt.ui

private ITypeHierarchy getCachedTypeHierarchy(IProgressMonitor monitor) throws JavaModelException {
  if (fCachedTypeHierarchy == null)
    fCachedTypeHierarchy= fMethod.getDeclaringType().newTypeHierarchy(new SubProgressMonitor(monitor, 1));
  return fCachedTypeHierarchy;
}
origin: org.eclipse.scout.sdk.s2e/org.eclipse.scout.sdk.s2e

protected ITypeHierarchy createHierarchy(IType iTypeWithClassId, SubMonitor monitor) throws CoreException {
 if (useRegion()) {
  return createRegionHierarchy(monitor);
 }
 return iTypeWithClassId.newTypeHierarchy(monitor);
}
origin: stackoverflow.com

private ITypeHierarchy createTypeHierarchy(IJavaElement element, IProgressMonitor pm) throws JavaModelException {
 if (element.getElementType() == IJavaElement.TYPE) {
   IType type= (IType) element;
   if (fIsSuperTypesOnly) {
     return type.newSupertypeHierarchy(pm);
   } else {
     return type.newTypeHierarchy(pm);
   }
 } else {
origin: org.eclipse.jdt/org.eclipse.jdt.ui

private ITypeHierarchy hierarchy(IProgressMonitor pm, WorkingCopyOwner owner, IType type)
    throws JavaModelException {
  ITypeHierarchy hierarchy= getCachedHierarchy(type, owner, new SubProgressMonitor(pm, 1));
  if (hierarchy == null)
    hierarchy= type.newTypeHierarchy(owner, new SubProgressMonitor(pm, 1));
  return hierarchy;
}
org.eclipse.jdt.coreITypenewTypeHierarchy

Javadoc

Creates and returns a type hierarchy for this type containing this type, all of its supertypes, and all its subtypes in the workspace.

Popular methods of IType

  • getFullyQualifiedName
    Returns the fully qualified name of this type, including qualification for any containing types and
  • getElementName
    Returns the simple name of this type, unqualified by package or enclosing type. This is a handle-onl
  • getMethods
    Returns the methods and constructors declared by this type. For binary types, this may include the s
  • getFlags
  • getPackageFragment
    Returns the package fragment in which this element is defined. This is a handle-only method.
  • getCompilationUnit
  • newSupertypeHierarchy
    Creates and returns a type hierarchy for this type containing this type and all of its supertypes, c
  • exists
  • getJavaProject
  • isInterface
    Returns whether this type represents an interface. Note that an interface can also be an annotation
  • getDeclaringType
  • getMethod
    Returns the method with the specified name and parameter types in this type (for example, "foo", {"I
  • getDeclaringType,
  • getMethod,
  • getParent,
  • isClass,
  • getSourceRange,
  • isAnonymous,
  • isBinary,
  • getResource,
  • getTypeParameters

Popular in Java

  • Start an intent from android
  • scheduleAtFixedRate (ScheduledExecutorService)
  • getSystemService (Context)
  • addToBackStack (FragmentTransaction)
  • PrintStream (java.io)
    A PrintStream adds functionality to another output stream, namely the ability to print representatio
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • ResultSet (java.sql)
    An interface for an object which represents a database table entry, returned as the result of the qu
  • JButton (javax.swing)
  • JComboBox (javax.swing)
  • JOptionPane (javax.swing)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now