Class AnahataStatusBarWidget
java.lang.Object
uno.anahata.asi.intellij.ui.status.AnahataStatusBarWidget
- All Implemented Interfaces:
com.intellij.openapi.Disposable, com.intellij.openapi.wm.StatusBarWidget, com.intellij.openapi.wm.StatusBarWidget.TextPresentation, com.intellij.openapi.wm.StatusBarWidget.WidgetPresentation
public class AnahataStatusBarWidget
extends Object
implements com.intellij.openapi.wm.StatusBarWidget, com.intellij.openapi.wm.StatusBarWidget.TextPresentation
Status-bar widget showing the number of active Anahata sessions, with a click that focuses
the Anahata tool window.
The count is refreshed on a short recurring Swing-thread timer via Alarm. Session
data is read through AgiContext (the live container/session registry).
- Author:
- anahata
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.intellij.openapi.Disposable
com.intellij.openapi.Disposable.Default, com.intellij.openapi.Disposable.ParentNested classes/interfaces inherited from interface com.intellij.openapi.wm.StatusBarWidget
com.intellij.openapi.wm.StatusBarWidget.IconPresentation, com.intellij.openapi.wm.StatusBarWidget.Multiframe, com.intellij.openapi.wm.StatusBarWidget.MultipleTextValuesPresentation, com.intellij.openapi.wm.StatusBarWidget.PlatformType, com.intellij.openapi.wm.StatusBarWidget.TextPresentation, com.intellij.openapi.wm.StatusBarWidget.WidgetBorder, com.intellij.openapi.wm.StatusBarWidget.WidgetPresentation -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final com.intellij.util.AlarmRecurring refresh timer, disposed with the widget.private final com.intellij.openapi.project.ProjectThe project this widget belongs to (used to focus the tool window).private com.intellij.openapi.wm.StatusBarThe hosting status bar, set on install. -
Constructor Summary
ConstructorsConstructorDescriptionAnahataStatusBarWidget(com.intellij.openapi.project.Project project) Constructs the widget for a project. -
Method Summary
Modifier and TypeMethodDescriptionvoiddispose()floatcom.intellij.util.Consumer<MouseEvent> com.intellij.openapi.wm.StatusBarWidget.WidgetPresentationgetText()@NotNull StringID()voidinstall(@NotNull com.intellij.openapi.wm.StatusBar statusBar) private voidSchedules the next status-bar refresh (~2.5s), re-arming itself.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.intellij.openapi.wm.StatusBarWidget
getPresentationMethods inherited from interface com.intellij.openapi.wm.StatusBarWidget.WidgetPresentation
getShortcutText
-
Field Details
-
project
private final com.intellij.openapi.project.Project projectThe project this widget belongs to (used to focus the tool window). -
alarm
private final com.intellij.util.Alarm alarmRecurring refresh timer, disposed with the widget. -
statusBar
private com.intellij.openapi.wm.StatusBar statusBarThe hosting status bar, set on install.
-
-
Constructor Details
-
AnahataStatusBarWidget
public AnahataStatusBarWidget(com.intellij.openapi.project.Project project) Constructs the widget for a project.- Parameters:
project- the owning project.
-
-
Method Details
-
ID
- Specified by:
IDin interfacecom.intellij.openapi.wm.StatusBarWidget
-
getPresentation
public com.intellij.openapi.wm.StatusBarWidget.WidgetPresentation getPresentation()- Specified by:
getPresentationin interfacecom.intellij.openapi.wm.StatusBarWidget
-
install
public void install(@NotNull @NotNull com.intellij.openapi.wm.StatusBar statusBar) Records the status bar and starts the refresh loop.
- Specified by:
installin interfacecom.intellij.openapi.wm.StatusBarWidget
-
dispose
public void dispose()- Specified by:
disposein interfacecom.intellij.openapi.Disposable- Specified by:
disposein interfacecom.intellij.openapi.wm.StatusBarWidget
-
getText
Shows the active-session count.
- Specified by:
getTextin interfacecom.intellij.openapi.wm.StatusBarWidget.TextPresentation
-
getAlignment
public float getAlignment()- Specified by:
getAlignmentin interfacecom.intellij.openapi.wm.StatusBarWidget.TextPresentation
-
getTooltipText
- Specified by:
getTooltipTextin interfacecom.intellij.openapi.wm.StatusBarWidget.WidgetPresentation
-
getClickConsumer
Focuses the Anahata tool window on click.
- Specified by:
getClickConsumerin interfacecom.intellij.openapi.wm.StatusBarWidget.WidgetPresentation
-
scheduleRefresh
private void scheduleRefresh()Schedules the next status-bar refresh (~2.5s), re-arming itself.
-

