Skip to content

Instantly share code, notes, and snippets.

Created August 14, 2015 12:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/67480175a65d97a5f3df to your computer and use it in GitHub Desktop.
Save anonymous/67480175a65d97a5f3df to your computer and use it in GitHub Desktop.
ASTRewrite astRewrite = ASTRewrite.create(unit.getAST());
ImportRewrite importRewrite = ImportRewrite.create(unit, true);
AST ast = unit.getAST();
SimpleType targetType =
ast.newSimpleType(ast.newName(importRewrite.addImport(“FxTextfield”)));
astRewrite.replace(sourceTypeRef, targetType, null);
importRewrite.removeImport(“SwingTextfield”);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment