// Change
//
////////////////////////////////////////////////////////////////////////////
@Override
public Change createChangeEx(IProgressMonitor pm) throws Exception {
CompositeChange compositeChange = new CompositeChange("Remote service rename");
// prepare types
IType serviceType = m_type;
IType asyncType = GwtRefactoringUtils.getServiceAsyncType(serviceType, pm);
IType implType = GwtRefactoringUtils.getServiceImplType(serviceType, pm);
// prepare names
String oldServiceName = serviceType.getElementName();
String newServiceName = getArguments().getNewName();
// rename Async
if (!Utils.hasGPE()) {
if (asyncType != null) {
String newAsyncName = newServiceName + "Async";
Change renameChange = RefactoringUtils.createRenameTypeChange(asyncType, newAsyncName, pm);
// renameChange also changes serviceType compilation unit, so merge changes for its file
RefactoringUtils.mergeTextChange(this, renameChange);
// after merge add remainder to the composite change
compositeChange.add(renameChange);
}
}
// Impl
if (implType != null) {
compositeChange.add(createImplChange(
serviceType,
implType,
oldServiceName,
newServiceName,
pm));