Examples of types()


Examples of org.eclipse.jdt.core.dom.CompilationUnit.types()

                .add(ast.newModifier(Modifier.ModifierKeyword.PUBLIC_KEYWORD));
            type.setName(ast.newSimpleName(className));
            type.bodyDeclarations().add(
                BodyDeclaration.copySubtree(type.getAST(),
                    methodDec));
            unit.types().add(type);

            String source = unit.toString();
            pkg.createCompilationUnit(className + ".java", source,
                true, null);
          } catch (Exception e) {
View Full Code Here

Examples of org.eclipse.jdt.core.dom.CompilationUnit.types()

      // creation of ASTRewrite
      AST ast = astRoot.getAST();
      ASTRewrite rewrite = ASTRewrite.create(ast);

      // description of the change
      for (Object typeObj : astRoot.types()) {
        if (typeObj instanceof TypeDeclaration) {
          TypeDeclaration typeDec = (TypeDeclaration) typeObj;
          if (typeDec.getName().toString()
              .equals(dropTypeDec.getName().toString())) {
            logger.debug("Replace existing type declaration");
View Full Code Here

Examples of org.eclipse.jdt.core.dom.CompilationUnit.types()

        }
      }

      ASTNode a = ASTNode.copySubtree(ast, dropTypeDec);
      @SuppressWarnings("unchecked")
      List<TypeDeclaration> types = astRoot.types();
      ArrayList<TypeDeclaration> newTypes = new ArrayList<TypeDeclaration>();
      newTypes.add((TypeDeclaration) a);
      if (types.addAll(newTypes)) {
        if (!target.getElementName().equals(
            dropTypeDec.getName().toString() + ".java")) {
View Full Code Here

Examples of org.eclipse.jdt.core.dom.CompilationUnit.types()

  @Override
  protected void initChildren(IProgressMonitor monitor) {
    CompilationUnit astNode = getASTNode();
 
    List<?> types = astNode.types();
    for (int i = 0; i < types.size(); i++) {
      AbstractTypeDeclaration declaration = (AbstractTypeDeclaration) types
          .get(i);
      if (declaration instanceof TypeDeclaration) {
        TypeDeclaration typeDeclaration = (TypeDeclaration) declaration;
View Full Code Here

Examples of org.eclipse.jdt.core.dom.CompilationUnit.types()

        ImportDeclaration importDecl = ast.newImportDeclaration();
        importDecl.setName(ast.newName("com.google.gwt.user.client.rpc.AsyncCallback")); //$NON-NLS-1$
        astRoot.imports().add(importDecl);

        // Add Async to the name
        TypeDeclaration aRemoteService = (TypeDeclaration) astRoot.types().get(0);
        String remoteServiceAsyncName = aRemoteService.getName().getFullyQualifiedName() + "Async"; //$NON-NLS-1$
        aRemoteService.setName(astRoot.getAST().newSimpleName(remoteServiceAsyncName));

        // Remote all interfaces
        aRemoteService.superInterfaceTypes().clear();
View Full Code Here

Examples of org.eclipse.jdt.core.dom.CompilationUnit.types()

        ImportDeclaration importDecl = ast.newImportDeclaration();
        importDecl.setName(ast.newName("com.google.gwt.user.client.rpc.AsyncCallback")); //$NON-NLS-1$
        astRoot.imports().add(importDecl);

        // Add Async to the name
        TypeDeclaration aRemoteService = (TypeDeclaration) astRoot.types().get(0);
        String remoteServiceAsyncName = aRemoteService.getName().getFullyQualifiedName()+"Async"; //$NON-NLS-1$
        aRemoteService.setName(astRoot.getAST().newSimpleName(remoteServiceAsyncName));
       
        // Remote all interfaces
        aRemoteService.superInterfaceTypes().clear();
View Full Code Here

Examples of org.eclipse.jdt.core.dom.CompilationUnit.types()

        ImportDeclaration importDecl = ast.newImportDeclaration();
        importDecl.setName(ast.newName("com.google.gwt.user.client.rpc.AsyncCallback")); //$NON-NLS-1$
        astRoot.imports().add(importDecl);

        // Add Async to the name
        TypeDeclaration aRemoteService = (TypeDeclaration) astRoot.types().get(0);
        String remoteServiceAsyncName = aRemoteService.getName().getFullyQualifiedName()+"Async"; //$NON-NLS-1$
        aRemoteService.setName(astRoot.getAST().newSimpleName(remoteServiceAsyncName));
       
        // Remote all interfaces
        aRemoteService.superInterfaceTypes().clear();
View Full Code Here

Examples of org.eclipse.jdt.core.dom.CompilationUnit.types()

    // Modify imports (+AsyncCallback, -RemoteService, -*Exception)
    updateImports(astRoot, ast);

    // Add Async to the name
    TypeDeclaration aRemoteService = (TypeDeclaration) astRoot.types().get(0);
    String remoteServiceAsyncName = aRemoteService.getName().getFullyQualifiedName() + "Async"; //$NON-NLS-1$
    aRemoteService.setName(astRoot.getAST().newSimpleName(remoteServiceAsyncName));

    // Remote all interfaces
    aRemoteService.superInterfaceTypes().clear();
View Full Code Here

Examples of org.eclipse.jdt.core.dom.CompilationUnit.types()

  public TypeDeclaration getTypeDeclaration(IType type) {
    ICompilationUnit compilationUnit = type.getCompilationUnit();

    CompilationUnit cu = getCompilationUnit(compilationUnit);

    List types = cu.types();
    for (int i = 0; i < types.size(); i++) {
      TypeDeclaration typeDeclaration = (TypeDeclaration) types.get(i);
      if (typeDeclaration.getName().toString().equals(type.getElementName())) {
        return typeDeclaration;
      }
View Full Code Here

Examples of org.eclipse.sapphire.java.JavaTypeConstraintService.types()

       
        if( javaTypeConstraintService != null )
        {
            final JavaTypeConstraintBehavior behavior = javaTypeConstraintService.behavior();

            final Collection<String> types = javaTypeConstraintService.types();
            final Iterator<String> iterator = types.iterator();

            for( int i = 0, n = ( behavior == JavaTypeConstraintBehavior.ALL ? types.size() : min( 1, types.size() ) ); i < n; i++ )
            {
                final String typeName = iterator.next();
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.