Package org.eclipse.jdt.core

Examples of org.eclipse.jdt.core.ITypeHierarchy


    fLink.setLayoutData(gd);
    updateBuildPathMessage();
  }

  private void createConstructor(IType type, ImportsManager imports) throws CoreException {
    ITypeHierarchy typeHierarchy = null;
    IType[] superTypes = null;
    String content;
    IMethod methodTemplate = null;
    if (type.exists()) {
      typeHierarchy = type.newSupertypeHierarchy(null);
      superTypes = typeHierarchy.getAllSuperclasses(type);
      for (IType superType : superTypes) {
        if (superType.exists()) {
          IMethod constrMethod = superType.getMethod(superType.getElementName(),
              new String[] { "Ljava.lang.String;" }); //$NON-NLS-1$
          if (constrMethod.exists() && constrMethod.isConstructor()) {
View Full Code Here


    ControlContentAssistHelper.createTextContentAssistant(fXmlFileUnderTestControl,
        fXmlFileToTestCompletionProcessor);
  }

  private IMethod findInHierarchy(IType type, String methodName) throws JavaModelException {
    ITypeHierarchy typeHierarchy = null;
    IType[] superTypes = null;
    if (type.exists()) {
      typeHierarchy = type.newSupertypeHierarchy(null);
      superTypes = typeHierarchy.getAllSuperclasses(type);
      for (IType superType : superTypes) {
        if (superType.exists()) {
          IMethod testMethod = superType.getMethod(methodName, new String[] {});
          if (testMethod.exists()) {
            return testMethod;
View Full Code Here

    IType javaType = JdtUtils.getJavaType(project, className);
   
    if (javaType == null)
      return false;
   
    ITypeHierarchy hierarchy = javaType.newSupertypeHierarchy(new NullProgressMonitor());
    IType[] interfaces = hierarchy.getAllSuperInterfaces(javaType);
   
    for (IType type : interfaces) {
      if (type.getElementName().equals("CustomConverter")) {
        return true;
      }
View Full Code Here

      if(!methods[i].isConstructor() && !methods[i].isMainMethod() && Flags.isPublic(methods[i].getFlags())){
        list.add(methods[i]);
      }
    }
    // search super class
    ITypeHierarchy hierarchy = type.newSupertypeHierarchy(null);
    extractMethods(hierarchy.getAllSuperclasses(type), list);
    extractMethods(hierarchy.getSuperInterfaces(type), list);
   
    if(type.isInterface()){
      extractMethods(new IType[]{
          type.getJavaProject().findType("java.lang.Object")}, list);
    }
View Full Code Here

    IMethod method = type.getMethod(methodName, paramTypes);
    if(method != null && method.exists()) {
        return method;
    }

    ITypeHierarchy typeHierarchy = type.newSupertypeHierarchy(null);
    IType[] types = typeHierarchy.getAllSuperclasses(type);
    for(int i = 0; i < types.length; i++) {
      method = types[i].getMethod(methodName, paramTypes);
      if((method != null) && method.exists()) {
        return method;
      }
View Full Code Here

          fuzzyResults.add(methods[i]);
        }
      }
    }

    ITypeHierarchy typeHierarchy = type.newSupertypeHierarchy(null);
    IType[] types = typeHierarchy.getAllSuperclasses(type);
    for(int i = 0; i < types.length; i++) {
      methods = types[i].getMethods();
      for(int j = 0; j < methods.length; j++) {
        if(methodName.equals(methods[j].getElementName()) && methods[j].exists()) {
          return methods[j];
View Full Code Here

        if(methodName.equals(typemethods[i].getElementName())) {
          return typemethods[i];
        }
      }
     
      ITypeHierarchy typeHierarchy= type.newSupertypeHierarchy(null);
      IType[] superTypes= typeHierarchy.getAllSuperclasses(type);
      for(int i= 0; i < superTypes.length; i++) {
        IMethod[] methods= superTypes[i].getMethods();
       
        for(int j=0; j < methods.length; j++) {
          if(methodName.equals(methods[j].getElementName())) {
View Full Code Here

      try {
        if (type != null && file.getProject().hasNature(JavaCore.NATURE_ID)) {
 
          // Make sure that JDT's type filter preferences are applied
          if (!TypeFilter.isFiltered(type)) {
            ITypeHierarchy hierachy = type.newTypeHierarchy(JavaCore.create(file.getProject()),
                new NullProgressMonitor());
            IType[] types = hierachy.getAllSubtypes(type);
            Map<String, IType> sortMap = new HashMap<String, IType>();
            for (IType foundType : types) {
              if ((foundType.getFullyQualifiedName().startsWith(prefix) || foundType.getElementName()
                  .startsWith(prefix))
                  && !sortMap.containsKey(foundType.getFullyQualifiedName())
View Full Code Here

    // fall back for manual installation of the post processor
    IType[] allSubtypes = null;
    try {
      IType beanClassType = JdtUtils.getJavaType(context.getRootElementProject(), beanClass);
      ITypeHierarchy hierarchy = SuperTypeHierarchyCache.getTypeHierarchy(beanClassType);
      allSubtypes = hierarchy.getAllSubtypes(beanClassType);
    }
    catch (JavaModelException e) {
      // ignore, falls back to JdtUtils.doesExtend
    }
View Full Code Here

      String className = BeansEditorUtils.getClassNameForBean(file, document, ref);
      IType type = JdtUtils.getJavaType(file.getProject(), className);
      if (type != null) {
        types.add(type);
        try {
          ITypeHierarchy hierarchy = SuperTypeHierarchyCache.getTypeHierarchy(type);
          IType[] interfaces = hierarchy.getAllSuperInterfaces(type);
          types.addAll(Arrays.asList(interfaces));
        }
        catch (JavaModelException e) {
          StatusHandler.log(new Status(IStatus.ERROR, ConfigUiPlugin.PLUGIN_ID,
              Messages.getString("InterfaceTableContentProvider.ERROR_CONTENT_PROVIDER_DATA"), e)); //$NON-NLS-1$
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.