use of org.eclipse.ltk.internal.ui.refactoring.ChangePreviewViewerDescriptor in project che by eclipse.
the class RefactoringManager method getChangePreview.
/**
* generate preview for refactoring change
*
* @param change
* the refactoring change
* @return refactoring change preview
* @throws RefactoringException
* when refactoring session or change not found.
*/
public ChangePreview getChangePreview(RefactoringChange change) throws RefactoringException {
RefactoringSession session = getRefactoringSession(change.getSessionId());
PreviewNode previewNode = session.getChangePreview(change.getChangeId());
try {
ChangePreviewViewerDescriptor descriptor = previewNode.getChangePreviewViewerDescriptor();
if (descriptor != null) {
IChangePreviewViewer viewer = descriptor.createViewer();
if (viewer != null) {
return previewNode.feedInput(viewer, Collections.EMPTY_LIST);
}
}
} catch (CoreException e) {
throw new RefactoringException(e.getMessage());
}
return null;
}
Aggregations