void (@NotNull DnDTarget target, @NotNull JComponent component, @NotNull Disposable parentDisposable) { registerTarget(target, component); Disposer.register(parentDisposable, new Disposable() { @Override public void dispose() { unregisterTarget(target, component); } }); }