*/
public Change createChange(IProgressMonitor pm) throws CoreException {
this.getTextChange(""); //$NON-NLS-1$
//create one multi change to contain all new created changes
CompositeChange multiChange = new CompositeChange(JSPUIMessages.JSP_changes);
//for each element get the changes for it and add it to the multi change
Iterator iter = fElementAndArgumentPairs.values().iterator();
while(iter.hasNext()) {
ElementAndArgumentsPair elemArgsPair = (ElementAndArgumentsPair)iter.next();
Object dest = elemArgsPair.fArgs.getDestination();
if(dest instanceof IPackageFragment) {
Change[] changes = createChangesFor(elemArgsPair.fElement, ((IPackageFragment)dest).getElementName(), pm);
/* add all new text changes to the local list of text changes so that
* future iterations through the while loop will be aware of already
* existing changes
*/
for(int i = 0; i < changes.length; ++i) {
if(changes[i] instanceof TextChange) {
fLocalTextChanges.put(((TextChange)changes[i]).getModifiedElement(), changes[i]);
}
}
if(changes.length > 0) {
multiChange.addAll(changes);
}
}
}
//unless there are actually new changes return null
Change result = null;
if(multiChange.getChildren().length > 0) {
result = multiChange;
}
return result;
}