/**
* @see IActionDelegate#run(IAction)
*/
public void run(IAction action) {
IWorkingCopyManager manager = JavaUI.getWorkingCopyManager();
IEditorInput editorInput = editor.getEditorInput();
try {
manager.connect(editorInput);
ICompilationUnit workingCopy = manager.getWorkingCopy(editorInput);
CreateDialog dialog = new CreateDialog(new Shell(), new BuilderGenerator());
dialog.show(workingCopy);
synchronized (workingCopy) {
workingCopy.reconcile(ICompilationUnit.NO_AST, false, null, null);
}
} catch (JavaModelException e) {
e.printStackTrace();
} catch (CoreException e) {
e.printStackTrace();
} finally {
manager.disconnect(editorInput);
}
}