throw new CoreException(new Status(IStatus.ERROR, RefactoringPlugin.getDefault().getBundleID(), IStatus.ERROR, "Could not locate component: " + _resourcePath.lastSegment(), null)); //$NON-NLS-1$
}
if (oldApiFile != null || oldWoFolders.length > 0) {
CompositeChange compositeChange = new CompositeChange("Rename WOComponent Files");
if (oldApiFile != null) {
TextFileChange apiTextFileChange = new TextFileChange("Rename Java class name in API file", oldApiFile);
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];