Examples of newImportDeclaration()


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

        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

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

    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

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

      return null;
    }
  }

  AST ast = this.cuAST.getAST();
  ImportDeclaration importDeclaration = ast.newImportDeclaration();
  importDeclaration.setStatic(Flags.isStatic(this.flags));
  // split import name into individual fragments, checking for on demand imports
  char[][] charFragments = CharOperation.splitOn('.', importActualName.toCharArray(), 0, importActualName.length());
  int length = charFragments.length;
  String[] strFragments = new String[length];
View Full Code Here

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

    PackageDeclaration packageDeclaration = ast.newPackageDeclaration();
    packageDeclaration.setName(ast.newName("org.kissmda.test.junit"));
    cu.setPackage(packageDeclaration);

    ImportDeclaration importDeclaration = ast.newImportDeclaration();
    importDeclaration
        .setName(ast.newName("org.junit.Assert.assertNotNull"));
    importDeclaration.setStatic(true);
    cu.imports().add(importDeclaration);
View Full Code Here

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

    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

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

      return null;
    }
  }

  AST ast = this.cuAST.getAST();
  ImportDeclaration importDeclaration = ast.newImportDeclaration();
  importDeclaration.setStatic(Flags.isStatic(this.flags));
  // split import name into individual fragments, checking for on demand imports
  char[][] charFragments = CharOperation.splitOn('.', importActualName.toCharArray(), 0, importActualName.length());
  int length = charFragments.length;
  String[] strFragments = new String[length];
View Full Code Here

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

        // reconcile the imports
        List<ImportDeclaration> newImports = getNewImports(cu.imports(), newJavaFileVisitor);
        for (ImportDeclaration newImport : newImports) {
            Name name = ast.newName(newImport.getName().getFullyQualifiedName());
            ImportDeclaration newId = ast.newImportDeclaration();
            newId.setName(name);
            cu.imports().add(newId);
        }

        TextEdit textEdit = cu.rewrite(document, null);
View Full Code Here

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

        List<ImportDeclaration> newImports = getNewImports(cu.imports(),
                newJavaFileVisitor);
        for (ImportDeclaration newImport : newImports) {
            Name name = ast
                    .newName(newImport.getName().getFullyQualifiedName());
            ImportDeclaration newId = ast.newImportDeclaration();
            newId.setName(name);
            cu.imports().add(newId);
        }

        TextEdit textEdit = cu.rewrite(document, null);
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.