Conflicts Dialog: Add handler for "Show conflicts" action
This commit is contained in:
+7
@@ -222,6 +222,13 @@ public class KotlinExtractFunctionDialog extends DialogWrapper {
|
||||
RefactoringPackage.checkConflictsInteractively(
|
||||
project,
|
||||
conflicts,
|
||||
new Function0<Unit>() {
|
||||
@Override
|
||||
public Unit invoke() {
|
||||
close(OK_EXIT_CODE);
|
||||
return Unit.INSTANCE$;
|
||||
}
|
||||
},
|
||||
new Function0<Unit>() {
|
||||
@Override
|
||||
public Unit invoke() {
|
||||
|
||||
@@ -175,13 +175,21 @@ public fun PsiElement.getExtractionContainers(strict: Boolean = true, includeAll
|
||||
}
|
||||
}
|
||||
|
||||
public fun Project.checkConflictsInteractively(conflicts: MultiMap<PsiElement, String>, onAccept: () -> Unit) {
|
||||
public fun Project.checkConflictsInteractively(
|
||||
conflicts: MultiMap<PsiElement, String>,
|
||||
onShowConflicts: () -> Unit = {},
|
||||
onAccept: () -> Unit) {
|
||||
if (!conflicts.isEmpty()) {
|
||||
if (ApplicationManager.getApplication()!!.isUnitTestMode()) throw ConflictsInTestsException(conflicts.values())
|
||||
|
||||
val dialog = ConflictsDialog(this, conflicts, onAccept)
|
||||
val dialog = ConflictsDialog(this, conflicts) { onAccept() }
|
||||
dialog.show()
|
||||
if (!dialog.isOK()) return
|
||||
if (!dialog.isOK()) {
|
||||
if (dialog.isShowConflicts()) {
|
||||
onShowConflicts()
|
||||
}
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
onAccept()
|
||||
|
||||
Reference in New Issue
Block a user