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.Parent

    Nested 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

    Fields
    Modifier and Type
    Field
    Description
    private final com.intellij.util.Alarm
    Recurring refresh timer, disposed with the widget.
    private final com.intellij.openapi.project.Project
    The project this widget belongs to (used to focus the tool window).
    private com.intellij.openapi.wm.StatusBar
    The hosting status bar, set on install.
  • Constructor Summary

    Constructors
    Constructor
    Description
    AnahataStatusBarWidget(com.intellij.openapi.project.Project project)
    Constructs the widget for a project.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    float
    com.intellij.util.Consumer<MouseEvent>
    com.intellij.openapi.wm.StatusBarWidget.WidgetPresentation
    @NotNull String
    ID()
    void
    install(@NotNull com.intellij.openapi.wm.StatusBar statusBar)
    private void
    Schedules 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, wait

    Methods inherited from interface com.intellij.openapi.wm.StatusBarWidget

    getPresentation

    Methods inherited from interface com.intellij.openapi.wm.StatusBarWidget.WidgetPresentation

    getShortcutText
  • Field Details

    • project

      private final com.intellij.openapi.project.Project project
      The project this widget belongs to (used to focus the tool window).
    • alarm

      private final com.intellij.util.Alarm alarm
      Recurring refresh timer, disposed with the widget.
    • statusBar

      private com.intellij.openapi.wm.StatusBar statusBar
      The 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

      @NotNull public @NotNull String ID()
      Specified by:
      ID in interface com.intellij.openapi.wm.StatusBarWidget
    • getPresentation

      public com.intellij.openapi.wm.StatusBarWidget.WidgetPresentation getPresentation()
      Specified by:
      getPresentation in interface com.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:
      install in interface com.intellij.openapi.wm.StatusBarWidget
    • dispose

      public void dispose()
      Specified by:
      dispose in interface com.intellij.openapi.Disposable
      Specified by:
      dispose in interface com.intellij.openapi.wm.StatusBarWidget
    • getText

      public String getText()

      Shows the active-session count.

      Specified by:
      getText in interface com.intellij.openapi.wm.StatusBarWidget.TextPresentation
    • getAlignment

      public float getAlignment()
      Specified by:
      getAlignment in interface com.intellij.openapi.wm.StatusBarWidget.TextPresentation
    • getTooltipText

      public String getTooltipText()
      Specified by:
      getTooltipText in interface com.intellij.openapi.wm.StatusBarWidget.WidgetPresentation
    • getClickConsumer

      public com.intellij.util.Consumer<MouseEvent> getClickConsumer()

      Focuses the Anahata tool window on click.

      Specified by:
      getClickConsumer in interface com.intellij.openapi.wm.StatusBarWidget.WidgetPresentation
    • scheduleRefresh

      private void scheduleRefresh()
      Schedules the next status-bar refresh (~2.5s), re-arming itself.