////////////////////////////////////////////////////////////////////////////
/**
* @return {@link Change} for modifications in module file done by {@link DocumentModelVisitor}.
*/
private static Change modifyModule(IType type, DocumentModelVisitor visitor) throws Exception {
ModuleDescription moduleDescription = Utils.getSingleModule(type);
if (moduleDescription instanceof DefaultModuleDescription) {
IFile moduleFile = ((DefaultModuleDescription) moduleDescription).getFile();
GwtDocumentEditContext context = new GwtDocumentEditContext(moduleFile);
return modifyXML(moduleFile, visitor, context);
}