Package org.eclipse.jdt.core.dom

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


        CompilationUnit root = (CompilationUnit) parser.createAST(null);
        if (root.getProblems().length == 0) {
            return;
        }

        List<ImportDeclaration> importsDecls = root.imports();
        if (importsDecls.isEmpty()) {
            return;
        }
        ImportsManager imports = new ImportsManager(root);
View Full Code Here


        if (root.getProblems().length == 0) {
            return;
        }

        @SuppressWarnings("unchecked")
        List<ImportDeclaration> importsDecls = root.imports();
        if (importsDecls.isEmpty()) {
            return;
        }
        ImportsManager imports = new ImportsManager(root);
View Full Code Here

      ASTParser newParser = ASTParser.newParser(AST.JLS3);
      newParser.setSource(str.toCharArray());
      StringBuilder bls=new StringBuilder(str);
      CompilationUnit createAST = (CompilationUnit) newParser.createAST(null);
      //ArrayList<String> results = new ArrayList<String>();
      for (Object n : createAST.imports()) {
        ImportDeclaration decl = (ImportDeclaration) n;
        String name = decl.getName().getFullyQualifiedName();
        if (decl.isOnDemand()) {
          bs.append("import "+name+".*;");
         
 
View Full Code Here

            }

            private String getFullyQualifiedNameForSimpleName(CompilationUnit ast, Name typeName) {
                String name = typeName.getFullyQualifiedName();

                for (ImportDeclaration id : (List<ImportDeclaration>) ast.imports()) {
                    if (id.isStatic())
                        continue;
                    if (id.isOnDemand()) {
                        String packageName = id.getName().getFullyQualifiedName();
                        try {
View Full Code Here

        AST ast = astRoot.getAST();

        astRoot.recordModifications();

        // Modify imports (+AsyncCallback, -RemoteService, -*Exception)
        List imports = astRoot.imports();
        List importsToBeRemoved = new ArrayList();

        for (Iterator j = imports.iterator(); j.hasNext();) {

          ImportDeclaration anImportDecl = (ImportDeclaration) j.next();
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);
        String remoteServiceAsyncName = aRemoteService.getName().getFullyQualifiedName() + "Async"; //$NON-NLS-1$
        aRemoteService.setName(astRoot.getAST().newSimpleName(remoteServiceAsyncName));
View Full Code Here

        AST ast = astRoot.getAST();

        astRoot.recordModifications();

        // Modify imports (+AsyncCallback, -RemoteService, -*Exception)
        List imports = astRoot.imports();
        List importsToBeRemoved = new ArrayList();
       
        for (Iterator j = imports.iterator(); j.hasNext();) {

          ImportDeclaration anImportDecl = (ImportDeclaration) j.next();
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);
        String remoteServiceAsyncName = aRemoteService.getName().getFullyQualifiedName()+"Async"; //$NON-NLS-1$
        aRemoteService.setName(astRoot.getAST().newSimpleName(remoteServiceAsyncName));
View Full Code Here

        AST ast = astRoot.getAST();

        astRoot.recordModifications();

        // Modify imports (+AsyncCallback, -RemoteService, -*Exception)
        List imports = astRoot.imports();
        List importsToBeRemoved = new ArrayList();
       
        for (Iterator j = imports.iterator(); j.hasNext();) {

          ImportDeclaration anImportDecl = (ImportDeclaration) j.next();
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);
        String remoteServiceAsyncName = aRemoteService.getName().getFullyQualifiedName()+"Async"; //$NON-NLS-1$
        aRemoteService.setName(astRoot.getAST().newSimpleName(remoteServiceAsyncName));
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.