use of com.intellij.openapi.Disposable in project intellij-community by JetBrains.
the class InvokerTest method testQueueOnBgPool.
@Test
public void testQueueOnBgPool() {
Disposable parent = InvokerTest::dispose;
testQueue(parent, new Invoker.BackgroundPool(parent), false);
}
use of com.intellij.openapi.Disposable in project intellij-community by JetBrains.
the class TestTreeView method attachToModel.
public void attachToModel(final TestFrameworkRunningModel model) {
setModel(new DefaultTreeModel(new DefaultMutableTreeNode(model.getRoot())));
getSelectionModel().setSelectionMode(model.getProperties().getSelectionMode());
myModel = model;
Disposer.register(myModel, myModel.getRoot());
Disposer.register(myModel, new Disposable() {
public void dispose() {
setModel(null);
myModel = null;
}
});
installHandlers();
setCellRenderer(getRenderer(myModel.getProperties()));
}
use of com.intellij.openapi.Disposable in project intellij-community by JetBrains.
the class TestTreeExpander method setModel.
public void setModel(final TestFrameworkRunningModel model) {
myModel = model;
Disposer.register(model, new Disposable() {
public void dispose() {
myModel = null;
}
});
}
use of com.intellij.openapi.Disposable in project intellij-community by JetBrains.
the class ReadWriteDirectBufferWrapper method flush.
@Override
public void flush() {
final ByteBuffer buffer = getCachedBuffer();
if (buffer == null || !isDirty())
return;
Disposable disposable = doFlush(null, buffer);
if (disposable != null) {
Disposer.dispose(disposable);
}
}
use of com.intellij.openapi.Disposable in project intellij-community by JetBrains.
the class MessageListenerList method add.
public void add(@NotNull final T listener, @NotNull Disposable parentDisposable) {
Disposer.register(parentDisposable, new Disposable() {
@Override
public void dispose() {
myListenerToConnectionMap.remove(listener);
}
});
final MessageBusConnection connection = myMessageBus.connect(parentDisposable);
connection.subscribe(myTopic, listener);
myListenerToConnectionMap.put(listener, connection);
}
Aggregations