Package org.eclipse.jdt.internal.corext.codemanipulation

Examples of org.eclipse.jdt.internal.corext.codemanipulation.ContextSensitiveImportRewriteContext


  {
    importRewrite = importRw;

    if (importRewrite != null)
    {
      context = new ContextSensitiveImportRewriteContext(unit, offset, importRewrite);
    }
    else
    {
      importRewrite = StubUtility.createImportRewrite(unit, true); // create a dummy import rewriter to have one
      context = createImportRewriteContext();
View Full Code Here


      CompilationUnit astRoot = SharedASTProvider
        .getAST(src, SharedASTProvider.WAIT_YES, null);

      edits = new MultiTextEdit();
      ImportRewrite importRewrite = StubUtility.createImportRewrite(astRoot, true);
      ImportRewriteContext context = new ContextSensitiveImportRewriteContext(
          astRoot, offset, importRewrite);
      String res = importRewrite.addImport(type, context);
      if (type.equals(res)){
        return CodeGenerationMessages.AddImportsOperation_error_importclash;
      }
View Full Code Here

      IJavaProject javaProject = compilationUnit.getJavaProject();
      CodeGenerationSettings settings = JavaPreferencesSettings.getCodeGenerationSettings(javaProject);
      MethodDeclaration methodDecl = createNewConstructor(typeDecl, ast);
      IMethodBinding constructorBinding = ASTNodes.getMethodBinding(methodDecl.getName());
      ITypeBinding typeBinding = ASTNodes.getTypeBinding(typeDecl.getName());
      ImportRewriteContext context = new ContextSensitiveImportRewriteContext(typeDecl, importRewrite);

      MethodDeclaration stub = StubUtility2.createConstructorStub(compilationUnit, astRewrite, importRewrite,
          context, typeBinding, constructorBinding, this.variableBindings, Modifier.PUBLIC, settings);
      if (stub != null) {
View Full Code Here

TOP

Related Classes of org.eclipse.jdt.internal.corext.codemanipulation.ContextSensitiveImportRewriteContext

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.