public final class Disposer
extends java.lang.Object
newDisposable()
to which children are attached via subsequent calls to register(Disposable, Disposable)
.
Invoking dispose(Disposable)
will process all its registered children's Disposable.dispose()
method.Disposable
Modifier and Type | Method and Description |
---|---|
static void |
assertIsEmpty() |
static void |
assertIsEmpty(boolean throwError) |
static void |
clearDisposalTraces() |
static void |
dispose(Disposable disposable) |
static void |
dispose(Disposable disposable,
boolean processUnregistered) |
static void |
disposeChildren(Disposable disposable) |
static <T extends Disposable> |
findRegisteredObject(Disposable parentDisposable,
T object) |
static Disposable |
get(java.lang.String key) |
static java.lang.Throwable |
getDisposalTrace(Disposable disposable) |
static com.intellij.openapi.util.ObjectTree |
getTree() |
static boolean |
isDebugDisposerOn() |
static boolean |
isDebugMode() |
static boolean |
isDisposed(Disposable disposable) |
static boolean |
isDisposing(Disposable disposable) |
static Disposable |
newDisposable() |
static Disposable |
newDisposable(java.lang.String debugName) |
static void |
register(Disposable parent,
Disposable child)
Registers
child so it is disposed right before its parent . |
static void |
register(Disposable parent,
Disposable child,
java.lang.String key) |
static boolean |
setDebugMode(boolean debugMode) |
public static boolean isDebugDisposerOn()
public static Disposable newDisposable()
public static Disposable newDisposable(java.lang.String debugName)
public static void register(Disposable parent, Disposable child)
IncorrectOperationException
- If child
has been registered with parent
before;
if parent
is being disposed (isDisposing(Disposable)
) or
already disposed (isDisposed(Disposable)
.public static void register(Disposable parent, Disposable child, java.lang.String key)
public static boolean isDisposed(Disposable disposable)
public static boolean isDisposing(Disposable disposable)
public static Disposable get(java.lang.String key)
public static void dispose(Disposable disposable)
public static void disposeChildren(Disposable disposable)
public static void dispose(Disposable disposable, boolean processUnregistered)
public static com.intellij.openapi.util.ObjectTree getTree()
public static void assertIsEmpty()
public static void assertIsEmpty(boolean throwError)
public static boolean setDebugMode(boolean debugMode)
public static boolean isDebugMode()
public static <T extends Disposable> T findRegisteredObject(Disposable parentDisposable, T object)
parentDisposable
which is equal to object, or null
if not foundpublic static java.lang.Throwable getDisposalTrace(Disposable disposable)
public static void clearDisposalTraces()