apiTextFileChange.setTextType("xml");
String javaFileName = getCompilationUnit().getElementName();
String apiContent = apiTextFileChange.getCurrentContent(null);
apiTextFileChange.setEdit(new ReplaceEdit(apiContent.indexOf(javaFileName), javaFileName.length(), getNewName() + ".java"));
compositeChange.add(apiTextFileChange);
compositeChange.add(new RenameResourceChange(oldApiFile.getFullPath(), getNewName() + ".api"));
}
for (int i = 0; i < oldWoFolders.length; i++) {
IFolder oldWoFolder = oldWoFolders[i];
if (oldWoFolder == null) {
continue;
}
CompositeChange renameWoFolderChange = new CompositeChange("Rename " + oldWoFolder.getName());
String[] renameExtensions = { ".html", ".wod", ".woo", ".xml", ".xhtml" };
for (int j = 0; j < renameExtensions.length; j++) {
IFile woFile = oldWoFolder.getFile(getOldName() + renameExtensions[j]);
if (woFile.exists()) {
renameWoFolderChange.add(new RenameResourceChange(woFile.getFullPath(), getNewName() + renameExtensions[j]));
}
}
renameWoFolderChange.add(new RenameResourceChange(oldWoFolder.getFullPath(), getNewName() + ".wo"));
compositeChange.add(renameWoFolderChange);
}
add(compositeChange);
if (_renameClass) {