Examples of newTypeHierarchy()


Examples of org.eclipse.dltk.core.IType.newTypeHierarchy()

  private List<IMethod> getOverridingMethods(IProgressMonitor pm) throws ModelException {
    if (overridingMethods == null) {
      overridingMethods = new ArrayList<IMethod>();
      IType declaringType = ((IMethod) modelElement).getDeclaringType();
      if (declaringType != null) {
        for (IType subType: declaringType.newTypeHierarchy(pm).getAllSubtypes(declaringType)) {
          for (IMethod methodBySubType: subType.getMethods()) {
            if (methodBySubType.getElementName().equals(getCurrentElementName())) {
              overridingMethods.add(methodBySubType);
              break;
            }
View Full Code Here

Examples of org.eclipse.jdt.core.IType.newTypeHierarchy()

                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

Examples of org.eclipse.jdt.core.IType.newTypeHierarchy()

                    @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

Examples of org.eclipse.jdt.core.IType.newTypeHierarchy()

      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) {
View Full Code Here

Examples of org.eclipse.jdt.core.IType.newTypeHierarchy()

  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

Examples of org.eclipse.jdt.core.IType.newTypeHierarchy()

  public ITypeHierarchy getHierarchy() {   
    if (hierarchy == null) {
      IType iType = (IType) getJavaElement();
      try {
        hierarchy = iType.newTypeHierarchy((IJavaProject) iType
            .getAncestor(IJavaElement.JAVA_PROJECT), null);
      } catch (Throwable e) {
        logger.log(Level.SEVERE, "Could not get type hierarchy for "
            + getHandle(), e);
View Full Code Here

Examples of org.eclipse.jdt.core.IType.newTypeHierarchy()

            IType type = project.findType(parentClassName);
            if (type == null) {
                throw new RuntimeException("Type not found: " + parentClassName);
            }
            // get all subclasses of parent class
            IType[] types = type.newTypeHierarchy(project, null).getAllSubtypes(type);
            for (IType childType : types) {
                try {
                    if (!Flags.isAbstract(childType.getFlags()) && !Flags.isEnum(childType.getFlags())) {
                        result.add(childType);
                    }
View Full Code Here

Examples of org.eclipse.jdt.core.IType.newTypeHierarchy()

      //ensure that it is not abstract or anonymous
      if (!isInnerOrAnonymousClass(type) && !isAbstractClass(type)){
        //now verify that it meets the criteria
        ITypeHierarchy hierarchy;
        try {
          hierarchy = type.newTypeHierarchy(jp, null);
        } catch (JavaModelException e) {
          return false;
        }
           
        //check that all interfaces
View Full Code Here

Examples of org.eclipse.jdt.core.IType.newTypeHierarchy()

    List descriptorResults = new ArrayList();
    try {
      IType type = javaProject.findType(typeQualifiedName.getQualifier() + "." + typeQualifiedName.getLocalName()); //$NON-NLS-1$
      // type must exist
      if(type != null) {
        ITypeHierarchy hierarchy = type.newTypeHierarchy(null);
        IType[] supers = hierarchy.getAllSuperclasses(type);
 
        IMethod[] methods = type.getMethods();
        // iterate the bean's methods
        for (int i = 0; i < methods.length; i++)
View Full Code Here

Examples of org.eclipse.jdt.core.IType.newTypeHierarchy()

          subTypesList.add(baseType.getFullyQualifiedName());
          // prepare sub-types
          IType[] subTypes;
          {
            m_monitor.subTask(baseType.getFullyQualifiedName());
            ITypeHierarchy th = baseType.newTypeHierarchy(javaProject, new NullProgressMonitor());
            subTypes = th.getAllSubtypes(baseType);
            m_monitor.worked(1);
          }
          //
          for (int subTypeIndex = 0; subTypeIndex < subTypes.length; subTypeIndex++) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.