Interface TrayPeer


public interface TrayPeer
What a backend does for Tray: keep one icon in the system's place for one.

A backend owes four things. Every method here is called on the UI thread and returns at once: what the system needs time for is done elsewhere. Every call it makes on its TrayHost is on the UI thread. The menu is asked of the host each time the system is about to open it, never kept from one opening to the next. And dispose() takes the icon away, as does closing the backend.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final TrayPeer
    The peer of a backend with no desktop under it: no icon, and never available.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Takes the icon away.
    void
    Takes the icon out of the tray until the next update(limn.backend.spi.TrayState), which puts it back as the first one did.
    boolean
     
    void
    Shows this state.
  • Field Details

    • NONE

      static final TrayPeer NONE
      The peer of a backend with no desktop under it: no icon, and never available.
  • Method Details

    • update

      void update(TrayState state)
      Shows this state. The first call is what puts the icon in the tray.
      Parameters:
      state - everything the icon shows
    • hide

      void hide()
      Takes the icon out of the tray until the next update(limn.backend.spi.TrayState), which puts it back as the first one did. The peer is not available meanwhile. Nothing happens when no icon is shown.
    • isAvailable

      boolean isAvailable()
      Returns:
      whether the system took the icon. Not whether somebody sees it: no system says that
    • dispose

      void dispose()
      Takes the icon away. Idempotent; nothing is called on the host afterwards.