Examples of newSupertypeHierarchy()


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

          }
        }
       
        // 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;
View Full Code Here

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

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

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

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

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

      if (elem instanceof ICompilationUnit) {
        ICompilationUnit unit = (ICompilationUnit) elem;
        try {
          IType primaryType = unit.findPrimaryType();
          if (primaryType != null) {
            ITypeHierarchy supertypeHierarchy = primaryType.newSupertypeHierarchy(new NullProgressMonitor());
            if (supertypeHierarchy.contains(getDefaultWOComponentType())) {
              setSuperClass(primaryType.getFullyQualifiedName(), true);
            }
          }
        } catch (JavaModelException e) {
View Full Code Here

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

    boolean requiresSuperclass = getSuperClass() == null || getSuperClass().matches("\\s*");
    if (!requiresSuperclass) {
      requiresSuperclass = true;
      try {
        IType supertype = getJavaProject().findType(getSuperClass());
        ITypeHierarchy supertypeHierarchy = supertype.newSupertypeHierarchy(new NullProgressMonitor());
        if (supertypeHierarchy.contains(getDefaultWOComponentType())) {
          requiresSuperclass = false;
        }
      } catch (JavaModelException e) {
        // nothing to do, invalid type
View Full Code Here

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

        superclassStatus.setError(DEFAULT_SUPERCLASS_NAME + " is not on the classpath");
      }
      else {
        try {
          IType type = getJavaProject().findType(getSuperClass());
          ITypeHierarchy typeHierarchy = type.newSupertypeHierarchy(new NullProgressMonitor());
          if (!JavaModelUtil.isSuperType(typeHierarchy, getDefaultWOComponentType(), type)) {
            superclassStatus.setError("The super type must be assignable to " + DEFAULT_SUPERCLASS_NAME);
          }
        } catch (JavaModelException e) {
          System.err.println(getClass().getName() + ".superClassChanged() Failed to determine superclass hierarchy.");
View Full Code Here

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

    if (superclasses == null || superclasses.length == 0) {
      return true;
    }
    ICompilationUnit compilationUnit = (ICompilationUnit) javaElement;
    IType typeToCeck = compilationUnit.findPrimaryType();
    ITypeHierarchy typeHierarchy = typeToCeck.newSupertypeHierarchy(new NullProgressMonitor());
    IType[] types = typeHierarchy.getAllClasses();
    for (int i = 0; i < types.length; i++) {
      IType type = types[i];
      for (int j = 0; j < superclasses.length; j++) {
        String superclass = superclasses[j];
View Full Code Here

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

  @Test
  public void super_hierarchy_should_return_null_at_initialized() throws Exception {

    IType result = builder.build();
   
    assertThat(result.newSupertypeHierarchy(new NullProgressMonitor()),is(notNullValue()));
   
  }

  @Test
  public void get_methods_should_return_no_methods_at_initialized() throws Exception {
View Full Code Here

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

    assertThat(result.isClass(),is(true));
    assertThat(Flags.isPublic(result.getFlags()), is(true));
    assertThat(builder.build().getMethods(),is(instanceOf(IMethod[].class)));
    assertThat(builder.build().getMethods().length,is(0));
    assertThat(result.newSupertypeHierarchy(new NullProgressMonitor()),is(notNullValue()));
   
  }
 
  @Test
  public void add_method_should_be_enabled() throws Exception {
View Full Code Here

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

 
  @Test
  public void junit3_class_should_extends_junit_framework_Test() throws Exception {
   
    IType result = builder.junit3_class().build();
    ITypeHierarchy hierarchy = result.newSupertypeHierarchy(new NullProgressMonitor());
    IType[] interfaces = hierarchy.getAllInterfaces();
    for (IType type : interfaces) {
      if(type.getFullyQualifiedName().equals(JavaTypes.TEST_INTERFACE_NAME)){
        return;
      }
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.