Package org.eclipse.jdt.core

Examples of org.eclipse.jdt.core.ITypeHierarchy


                final IRunnableWithProgress runnable = new IRunnableWithProgress() {
                    public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
                        try {
                            IType activatorType = javaProject.findType(BundleActivator.class.getName());
                            if (activatorType != null) {
                                ITypeHierarchy hierarchy = activatorType.newTypeHierarchy(javaProject, monitor);
                                for (IType subType : hierarchy.getAllSubtypes(activatorType)) {
                                    if (!Flags.isAbstract(subType.getFlags()) && subType.getElementName().toLowerCase().contains(prefix.toLowerCase())) {
                                        result.add(new JavaTypeContentProposal(subType));
                                    }
                                }
                            }
View Full Code Here


            return false;

        //
        // One of the super classes/interfaces must be a Junit class/interface
        //
        ITypeHierarchy hierarchy = type.newSupertypeHierarchy(null);
        for (IType z : hierarchy.getAllSupertypes(type)) {
            if (z.getFullyQualifiedName().startsWith("junit."))
                return true;
        }

        if (isJUnit4(type))
            return true;

        for (IType z : hierarchy.getAllSuperclasses(type)) {
            if (isJUnit4(z))
                return true;
        }

        return false;
View Full Code Here

                    @Override
                    public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
                        try {
                            IType activatorType = javaProject.findType(BundleActivator.class.getName());
                            if (activatorType != null) {
                                ITypeHierarchy hierarchy = activatorType.newTypeHierarchy(javaProject, monitor);
                                for (IType subType : hierarchy.getAllSubtypes(activatorType)) {
                                    if (!Flags.isAbstract(subType.getFlags()) && subType.getElementName().toLowerCase().contains(prefix.toLowerCase())) {
                                        result.add(new JavaTypeContentProposal(subType));
                                    }
                                }
                            }
View Full Code Here

        throws JavaModelException
    {
        if (ifaceOrParentClass == null)
            return true;

        ITypeHierarchy h = type.newSupertypeHierarchy(null);

        for (IType superType : h.getAllClasses())
        {
            String name = superType.getFullyQualifiedName();
            if (name.equals(ifaceOrParentClass))
            {
                return true;
            }
        }
        for (IType ifaceType : h.getAllInterfaces())
        {
            String name = ifaceType.getFullyQualifiedName();
            if (name.equals(ifaceOrParentClass))
            {
                return true;
View Full Code Here

          }
        }
       
        // get the class declaration line
        IType type = unit.getType(controllerName);
        ITypeHierarchy superTypes = type.newSupertypeHierarchy(null);
//        String name = JapidController.class.getName(); // this will require play.jar
        String name = "cn.bran.play.JapidController";
        IType japidController = jProject.findType(name);
        if (superTypes.contains(japidController)) {
          useJapid = true;
        }
        else {
          useJapid = false;
        }
View Full Code Here

    Set<String> seen = new TreeSet<String>(); // Used to dedup overridden methods
    for (Template template: getMethodsTemplates(type, query, contextTypeId)) {
      result.add(template);
      seen.add(template.getName());
    }
    ITypeHierarchy hierarchy = type.newTypeHierarchy(null);
    for (IType superclass: hierarchy.getAllSuperclasses(type)) {
      for (Template template: getMethodsTemplates(superclass, query, contextTypeId)) {
        if (!seen.contains(template.getName())) {
          result.add(template);
          seen.add(template.getName());
        }
View Full Code Here

      return null;
    }
    try {
      IMethod method = findMethod(parent, query);
      if (method != null) return method;
      ITypeHierarchy hierarchy = parent.newTypeHierarchy(null);
      for (IType superclass: hierarchy.getAllSuperclasses(parent)) {
        method = findMethod(superclass, query);
        if (method != null) return method;
      }
    } catch (JavaModelException e) {
      e.printStackTrace();
View Full Code Here

    {
      final NamedMember method = (NamedMember) javaElement;
      final IType type = method.getDeclaringType();
      if (type != null)
      {
        final ITypeHierarchy hierarchy = type.newSupertypeHierarchy(null);
        if (hierarchy != null)
        {
          final IType[] supertypes = hierarchy.getAllSupertypes(type);
          for (final IType iType : supertypes)
          {
            if (iType.getFullyQualifiedName().equals("org.apache.wicket.Component"))
            {
              try {
View Full Code Here

  private void loadNewTree(String qName) {
    try {
      IType baseType = project.findType(qName);
     
      if (baseType != null) {
        ITypeHierarchy hierarchy = baseType.newTypeHierarchy(project, null);   
        addInHierarchy(baseType, hierarchy);     
       
        //Yeah...that just wasted a bunch of resources. Clean up now...
        Runtime r = Runtime.getRuntime();
        r.gc();
View Full Code Here

  public static IRegion getRegionOfWicketComponent(final IDocument document, final int offset, final IJavaElement javaElement) throws JavaModelException {
    if (javaElement != null && javaElement instanceof NamedMember) {
      final NamedMember method = (NamedMember) javaElement;
      final IType type = method.getDeclaringType();
      if (type != null) {
        final ITypeHierarchy hierarchy = type.newSupertypeHierarchy(null);
        if (hierarchy != null) {
          final IType[] supertypes = hierarchy.getAllSupertypes(type);
          for (final IType iType : supertypes) {
            if (iType.getFullyQualifiedName().equals(TypeHelper.COMPONENT)) {
              try {
                final IRegion lineInfo = document.getLineInformationOfOffset(offset);
                final String line = document.get(lineInfo.getOffset(), lineInfo.getLength());
View Full Code Here

TOP

Related Classes of org.eclipse.jdt.core.ITypeHierarchy

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.