Package org.eclipse.jdt.core.dom

Examples of org.eclipse.jdt.core.dom.TypeDeclaration


      e.printStackTrace();
    }
  }

  protected boolean isSingleton(IType type) {
    TypeDeclaration typeDeclaration = cache.getTypeDeclaration(type);
    ITypeBinding typeBinding = typeDeclaration.resolveBinding();
   
    IAnnotationBinding[] annotations = typeBinding.getAnnotations();
    for (IAnnotationBinding annotation : annotations) {
      String qualifiedName = annotation.getAnnotationType().getQualifiedName();
      if ("javax.ejb.Singleton".equals(qualifiedName)) {
View Full Code Here


   
    IType type = javaProject.findType(singleton);
    ISourceRange sourceRange = type.getSourceRange();

    CompilationUnit compilationUnit = cache.getCompilationUnit(type.getCompilationUnit());
    TypeDeclaration typeDeclaration = cache.getTypeDeclaration(type);
    IAnnotationBinding[] annotations = typeDeclaration.resolveBinding().getAnnotations();

    List<String> declaredDependencies = new ArrayList<String>();

    for (IAnnotationBinding annotation : annotations) {
      if ("javax.ejb.DependsOn".equals(annotation.getAnnotationType().getQualifiedName())) {
View Full Code Here

    packageInfo = typeInfo.writePackage(compilationUnit);
    return this;
  }

  public TypeDeclarationWriter newTypeDeclarationWriter() {
    TypeDeclaration typeDeclaration = ast.newTypeDeclaration();
    compilationUnit.types().add(typeDeclaration);
    return typeDeclarationWriter = new TypeDeclarationWriter(typeDeclaration);
  }
View Full Code Here

      }
      current = current.getParent();
    }
       
    if(current!=root){
      TypeDeclaration classDecl = (TypeDeclaration) current;
      //the Binding representing the Type
      ITypeBinding classBinding = classDecl.resolveBinding();
      //the name of the class
      String name = classBinding.getName();
      //the Package that class is declared in
      packageBinding = classBinding.getPackage();
     
View Full Code Here

            + " "
            + fieldName
            + " = com.google.gwt.core.client.GWT.create("
            + fullClassName
            + ".class);";
    TypeDeclaration typeDeclaration = JavaInfoUtils.getTypeDeclaration(root);
    BodyDeclarationTarget target = new BodyDeclarationTarget(typeDeclaration, true);
    root.getEditor().addFieldDeclaration(code, target);
  }
View Full Code Here

  //
  // Utils
  //
  ////////////////////////////////////////////////////////////////////////////
  private void addKey(String key) throws Exception {
    TypeDeclaration typeDeclaration =
        (TypeDeclaration) m_accessorEditor.getAstUnit().types().get(0);
    m_accessorEditor.addInterfaceMethodDeclaration(
        "String " + key + "()",
        new BodyDeclarationTarget(typeDeclaration, false));
    commitAccessorChanges();
View Full Code Here

    if (commandExpression instanceof ClassInstanceCreation) {
      ClassInstanceCreation newCommandExpression = (ClassInstanceCreation) commandExpression;
      AnonymousClassDeclaration classDeclaration =
          newCommandExpression.getAnonymousClassDeclaration();
      if (classDeclaration != null) {
        TypeDeclaration typeDeclaration = AnonymousTypeDeclaration.create(classDeclaration);
        return typeDeclaration.getMethods()[0];
      }
    }
    return commandExpression;
  }
View Full Code Here

            MessageFormat.format(
                "private {0}<{1}> {2} = new {0}<{1}>(java.util.Collections.<{1}>emptyList());",
                "com.google.gwt.user.cellview.client.ColumnSortEvent.ListHandler",
                rowTypeName,
                listHandlerName);
        TypeDeclaration targetType = JavaInfoUtils.getTypeDeclaration(m_this);
        BodyDeclarationTarget target = new BodyDeclarationTarget(targetType, true);
        editor.addFieldDeclaration(source, target);
      }
      // add cellTable.addColumnSortHandler(sortHandler);
      getParentJava().addMethodInvocation(
View Full Code Here

          I.remove();
        }
      }
    }
    // add Async to the name
    TypeDeclaration serviceType = (TypeDeclaration) serviceRoot.types().get(0);
    String remoteServiceAsyncName = serviceType.getName().getIdentifier() + "Async";
    serviceType.setName(serviceRoot.getAST().newSimpleName(remoteServiceAsyncName));
    // update interfaces
    updateInterfacesOfAsync(javaProject, serviceRoot, serviceType);
    // change methods, fields and inner classes
    {
      List<BodyDeclaration> bodyDeclarations = DomGenerics.bodyDeclarations(serviceType);
View Full Code Here

      }
      implUnit = implType.getCompilationUnit();
    }
    // prepare AST unit and type
    CompilationUnit implRoot = Utils.parseUnit(implUnit);
    TypeDeclaration implType = (TypeDeclaration) implRoot.types().get(0);
    // use standard JDT operation
    final IWorkspaceRunnable workspaceRunnable =
        OverrideMethodsAction.createRunnable(implRoot, implType.resolveBinding(), null, -1, false);
    // execute in UI because operation works with widgets during apply
    ExecutionUtils.runLogUI(new RunnableEx() {
      public void run() throws Exception {
        workspaceRunnable.run(null);
      }
View Full Code Here

TOP

Related Classes of org.eclipse.jdt.core.dom.TypeDeclaration

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.