use of org.eclipse.che.plugin.java.server.refactoring.session.RefactoringSession 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;
}
use of org.eclipse.che.plugin.java.server.refactoring.session.RefactoringSession in project che by eclipse.
the class RefactoringManager method changeChangeEnabled.
/**
* Include/exclude refactoring change from refactoring
*
* @param state
* updating state
* @throws RefactoringException
* when refactoring session not found.
*/
public void changeChangeEnabled(ChangeEnabledState state) throws RefactoringException {
RefactoringSession session = getRefactoringSession(state.getSessionId());
session.updateChangeEnabled(state.getChangeId(), state.isEnabled());
}
Aggregations