Package org.eclipse.jdt.core.dom

Examples of org.eclipse.jdt.core.dom.AST.newImportDeclaration()


            importsToBeRemoved.add(anImportDecl);
        }

        imports.removeAll(importsToBeRemoved);

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


         
        }
       
        imports.removeAll(importsToBeRemoved);

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

            importsToBeRemoved.add(anImportDecl);
        }
       
        imports.removeAll(importsToBeRemoved);

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

                    break;
                }
            }

            if (transform) {
                ImportDeclaration importDeclaration = ast
                        .newImportDeclaration();
                importDeclaration.setName(AbstractTransformer.createName(ast,
                        fullName));
                root.imports().add(importDeclaration);
                loader.importClass(fullName);
View Full Code Here

                }
            }
        }

        AST ast = root.getAST();
        ImportDeclaration declaration = ast.newImportDeclaration();
        declaration.setName(createName(ast, name));
        root.imports().add(declaration);
        loader.importClass(name);
        return simpleName;
    }
View Full Code Here

  void addImportToCompilationUnit(String classToImport, CompilationUnit compilationUnit) {
    if (!isClassImported(classToImport, compilationUnit)) {
      AST ast = compilationUnit.getAST();

      Name name = createQualifiedName(ast, classToImport);
      ImportDeclaration importDeclaration = ast.newImportDeclaration();
      importDeclaration.setName(name);
      importDeclaration.setOnDemand(false);
      importDeclaration.setStatic(false);

      compilationUnit.imports().add(importDeclaration);
View Full Code Here

      if (importDeclaration.getName().toString().equals(qualifiedName)) {
        return;
      }
    }
    // add new ImportDeclaration
    ImportDeclaration importDeclaration = ast.newImportDeclaration();
    importDeclaration.setName(ast.newName(qualifiedName));
    imports.add(importDeclaration);
  }

  /**
 
View Full Code Here

      }
    }
    else group = model;
    // 2°) Second step, we build a rewriter from the compilation unit
    AST ast = u.getAST();
    ImportDeclaration id = ast.newImportDeclaration();
    id.setName(ast.newName(new String[] {"java", "util", "Set"}));
    ASTRewrite rewriter = ASTRewrite.create(ast);
    // 3°) Third step, we can process the type declaration
    if(t.isInterface()) {
      result = new InterfaceService(t, group, rewriter, u);
View Full Code Here

        checkForNull(imports, "imports");

        final AST ast = rewrite.getAST();
        SortedSet<ImportDeclaration> importDeclarations = new TreeSet<ImportDeclaration>(comparator);
        for (String importName : imports) {
            ImportDeclaration importDeclaration = ast.newImportDeclaration();
            importDeclaration.setName(ast.newName(importName));
            importDeclaration.setStatic(staticImports);
            importDeclarations.add(importDeclaration);
        }
        addImports(rewrite, compilationUnit, importDeclarations);
View Full Code Here

    PackageDeclaration p1 = ast.newPackageDeclaration();
    p1.setName(ast.newSimpleName("foo"));
    cu.setPackage(p1);

    ImportDeclaration id = ast.newImportDeclaration();
    id.setName(ast.newName(new String[] {
        "java", "util", "Set" }));
    cu.imports().add(id);

    TypeDeclaration td = ast.newTypeDeclaration();
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.