Вы можете найти образец в JDT SurroundWithTryCatchAction
(исключая много деталей):
SurroundWithTryCatchRefactoring refactoring= SurroundWithTryCatchRefactoring.create(cu, selection);
Change change= refactoring.createChange(new NullProgressMonitor());
PerformChangeOperation op= new PerformChangeOperation(change);
WorkbenchRunnableAdapter adapter= new WorkbenchRunnableAdapter(op);
PlatformUI.getWorkbench().getProgressService().runInUI(
new BusyIndicatorRunnableContext(), adapter, adapter.getSchedulingRule());
Рефакторинг полностью неинтерактивен через create
-помощь.*