use of com.intellij.refactoring.listeners.impl.RefactoringTransaction in project intellij-community by JetBrains.
the class ChangeSignatureProcessorBase method performRefactoring.
@Override
protected void performRefactoring(@NotNull UsageInfo[] usages) {
RefactoringTransaction transaction = getTransaction();
final ChangeInfo changeInfo = myChangeInfo;
final RefactoringElementListener elementListener = transaction == null ? null : transaction.getElementListener(changeInfo.getMethod());
final String fqn = CopyReferenceAction.elementToFqn(changeInfo.getMethod());
if (fqn != null) {
UndoableAction action = new BasicUndoableAction() {
@Override
public void undo() {
if (elementListener instanceof UndoRefactoringElementListener) {
((UndoRefactoringElementListener) elementListener).undoElementMovedOrRenamed(changeInfo.getMethod(), fqn);
}
}
@Override
public void redo() {
}
};
UndoManager.getInstance(myProject).undoableActionPerformed(action);
}
try {
doChangeSignature(changeInfo, usages);
final PsiElement method = changeInfo.getMethod();
LOG.assertTrue(method.isValid());
if (elementListener != null && changeInfo.isNameChanged()) {
elementListener.elementRenamed(method);
}
} catch (IncorrectOperationException e) {
LOG.error(e);
}
}
Aggregations