use of com.intellij.openapi.Disposable in project intellij-community by JetBrains.
the class LowMemoryWatcher method register.
/**
* Registers a runnable to run on low memory events. The notifications will be issued until parentDisposable is disposed.
*/
public static void register(@NotNull Runnable runnable, @NotNull Disposable parentDisposable) {
final LowMemoryWatcher watcher = new LowMemoryWatcher(runnable);
Disposer.register(parentDisposable, new Disposable() {
@Override
public void dispose() {
watcher.stop();
}
});
}
use of com.intellij.openapi.Disposable in project intellij-community by JetBrains.
the class FrequentEventDetector method disableUntil.
public static void disableUntil(@NotNull Disposable reenable) {
enabled = false;
Disposer.register(reenable, new Disposable() {
@Override
public void dispose() {
enabled = true;
}
});
}
use of com.intellij.openapi.Disposable in project intellij-community by JetBrains.
the class ChangesViewContentManager method setUp.
public void setUp(ToolWindow toolWindow) {
final ContentManager contentManager = toolWindow.getContentManager();
myContentManagerListener = new MyContentManagerListener();
contentManager.addContentManagerListener(myContentManagerListener);
Disposer.register(myProject, new Disposable() {
public void dispose() {
contentManager.removeContentManagerListener(myContentManagerListener);
}
});
loadExtensionTabs();
myContentManager = contentManager;
final List<Content> ordered = doPresetOrdering(myAddedContents);
for (Content content : ordered) {
myContentManager.addContent(content);
}
myAddedContents.clear();
if (contentManager.getContentCount() > 0) {
contentManager.setSelectedContent(contentManager.getContent(0));
}
myInitializationWaiter.countDown();
}
use of com.intellij.openapi.Disposable in project intellij-community by JetBrains.
the class BreakpointsDialogFactory method setBalloonToHide.
public void setBalloonToHide(final Balloon balloonToHide, Object breakpoint) {
myBalloonToHide = balloonToHide;
myBreakpoint = breakpoint;
Disposer.register(myBalloonToHide, new Disposable() {
@Override
public void dispose() {
if (myBalloonToHide == balloonToHide) {
myBalloonToHide = null;
myBreakpoint = null;
}
}
});
}
use of com.intellij.openapi.Disposable in project intellij-community by JetBrains.
the class XBreakpointPanelProvider method addListener.
@Override
public void addListener(final BreakpointsListener listener, Project project, Disposable disposable) {
XBreakpointManager breakpointManager = XDebuggerManager.getInstance(project).getBreakpointManager();
final MyXBreakpointListener listener1 = new MyXBreakpointListener(listener, breakpointManager);
breakpointManager.addBreakpointListener(listener1);
myListeners.add(listener1);
Disposer.register(disposable, new Disposable() {
@Override
public void dispose() {
removeListener(listener);
}
});
}
Aggregations