mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[platform] TestDialogManager.setTestDialog with disposable argument
GitOrigin-RevId: 3f0ce6adc31aa7f4cd160c8d0cd299b0e64d0c27
This commit is contained in:
committed by
intellij-monorepo-bot
parent
f4531f9795
commit
ce73510eb1
@@ -4447,6 +4447,7 @@ f:com.intellij.openapi.ui.TestDialogManager
|
||||
- s:getTestImplementation():com.intellij.openapi.ui.TestDialog
|
||||
- s:getTestInputImplementation():com.intellij.openapi.ui.TestInputDialog
|
||||
- s:setTestDialog(com.intellij.openapi.ui.TestDialog):com.intellij.openapi.ui.TestDialog
|
||||
- s:setTestDialog(com.intellij.openapi.ui.TestDialog,com.intellij.openapi.Disposable):com.intellij.openapi.ui.TestDialog
|
||||
- s:setTestInputDialog(com.intellij.openapi.ui.TestInputDialog):com.intellij.openapi.ui.TestInputDialog
|
||||
com.intellij.openapi.ui.TestInputDialog
|
||||
- sf:DEFAULT:com.intellij.openapi.ui.TestInputDialog
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.openapi.ui;
|
||||
|
||||
import com.intellij.openapi.Disposable;
|
||||
import com.intellij.openapi.application.Application;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.util.Disposer;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.annotations.TestOnly;
|
||||
@@ -20,6 +22,13 @@ public final class TestDialogManager {
|
||||
return oldValue;
|
||||
}
|
||||
|
||||
@TestOnly
|
||||
public static TestDialog setTestDialog(@Nullable TestDialog newValue, @NotNull Disposable disposable) {
|
||||
TestDialog oldValue = setTestDialog(newValue);
|
||||
Disposer.register(disposable, () -> implementation = oldValue);
|
||||
return oldValue;
|
||||
}
|
||||
|
||||
public static @NotNull TestDialog getTestImplementation() {
|
||||
TestDialog result = implementation;
|
||||
return result == null ? TestDialog.DEFAULT : result;
|
||||
|
||||
Reference in New Issue
Block a user