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(
|
RefactoringPackage.checkConflictsInteractively(
|
||||||
project,
|
project,
|
||||||
conflicts,
|
conflicts,
|
||||||
|
new Function0<Unit>() {
|
||||||
|
@Override
|
||||||
|
public Unit invoke() {
|
||||||
|
close(OK_EXIT_CODE);
|
||||||
|
return Unit.INSTANCE$;
|
||||||
|
}
|
||||||
|
},
|
||||||
new Function0<Unit>() {
|
new Function0<Unit>() {
|
||||||
@Override
|
@Override
|
||||||
public Unit invoke() {
|
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 (!conflicts.isEmpty()) {
|
||||||
if (ApplicationManager.getApplication()!!.isUnitTestMode()) throw ConflictsInTestsException(conflicts.values())
|
if (ApplicationManager.getApplication()!!.isUnitTestMode()) throw ConflictsInTestsException(conflicts.values())
|
||||||
|
|
||||||
val dialog = ConflictsDialog(this, conflicts, onAccept)
|
val dialog = ConflictsDialog(this, conflicts) { onAccept() }
|
||||||
dialog.show()
|
dialog.show()
|
||||||
if (!dialog.isOK()) return
|
if (!dialog.isOK()) {
|
||||||
|
if (dialog.isShowConflicts()) {
|
||||||
|
onShowConflicts()
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onAccept()
|
onAccept()
|
||||||
|
|||||||
Reference in New Issue
Block a user