use of org.eclipse.ltk.core.refactoring.UndoTextFileChange in project che by eclipse.
the class RefactoringSession method prepareChangesInfo.
/**
* Prepare the information about changes which were applied.
*
* @param changes array of the applied changes
* @param changesInfo prepared list of {@link ChangeInfo}
*/
public void prepareChangesInfo(Change[] changes, List<ChangeInfo> changesInfo) {
for (Change ch : changes) {
if (ch instanceof DynamicValidationStateChange) {
prepareChangesInfo(((DynamicValidationStateChange) ch).getChildren(), changesInfo);
} else {
ChangeInfo changeInfo = DtoFactory.newDto(ChangeInfo.class);
String refactoringName = ch.getName();
if (ch instanceof UndoTextFileChange) {
changeInfo.setName(ChangeInfo.ChangeName.UPDATE);
changeInfo.setPath(((CompilationUnit) ch.getModifiedElement()).getPath().toString());
}
if (refactoringName.startsWith("Rename")) {
if (ch instanceof RenameCompilationUnitChange) {
prepareRenameCompilationUnitChange(changeInfo, ch);
} else if (ch instanceof RenamePackageChange) {
prepareRenamePackageChange(changesInfo, changeInfo, ch);
}
}
if (refactoringName.startsWith("Move")) {
prepareMoveChange(changeInfo, ch);
}
changesInfo.add(changeInfo);
}
}
}
Aggregations