Knopflerfish OSGi 2.4.0

org.knopflerfish.service.trayicon
Interface TrayIcon

All Superinterfaces:
java.awt.event.ActionListener, java.util.EventListener, java.awt.event.MouseListener
All Known Implementing Classes:
DefaultTrayIcon

public interface TrayIcon
extends java.awt.event.ActionListener, java.awt.event.MouseListener

Service interface that should be registered into framework by bundles publishing "Tray Icons".

As soon as a TrayIcon service is registered, the Tray Icon Manager will pick up the service, read the name, icon, menu and start message, and will try to publish the icon in a system dependent manner.

This interface extends MouseListener and ActionListener. The methods in thise interfaces will be called appropiately at mouse or action events on the actual tray icon.


Field Summary
static java.lang.String PROP_NAME
           
 
Method Summary
 java.lang.String getId()
          Unique id of this tray item.
 java.net.URL getImageURL()
          URL pointing to image icon for the tray item.
 java.lang.String getName()
          Human-readable name of this tray item, displayed as tooltip.
 java.lang.String getStartupMessage()
          Initial start up message, displayed in a tray balloon, if possible.
 javax.swing.JPopupMenu getTrayJPopupMenu()
          Get menu for this item.
 void trayEvent(TrayEvent ev)
          Called at clicks etc on the tray item.
 
Methods inherited from interface java.awt.event.ActionListener
actionPerformed
 
Methods inherited from interface java.awt.event.MouseListener
mouseClicked, mouseEntered, mouseExited, mousePressed, mouseReleased
 

Field Detail

PROP_NAME

public static final java.lang.String PROP_NAME
See Also:
Constant Field Values
Method Detail

getId

public java.lang.String getId()
Unique id of this tray item.


getName

public java.lang.String getName()
Human-readable name of this tray item, displayed as tooltip.


getImageURL

public java.net.URL getImageURL()
URL pointing to image icon for the tray item.


getStartupMessage

public java.lang.String getStartupMessage()
Initial start up message, displayed in a tray balloon, if possible.

Returns:
Short startup message, null if no message should be displayed.

getTrayJPopupMenu

public javax.swing.JPopupMenu getTrayJPopupMenu()
Get menu for this item. null if no menu should be displayed.

Note: The menu instance returned by this method may, or may not be used directly for display. Depending on the implementation of tray icons, the returned menu may be wrapped or copied into another structure. The returned swing menu should in this case be viewed as menu data model, rather than a menu view.

ActionListeners and getText/setText/getState/setState on the original, returned instance are however guaranteed to work.


trayEvent

public void trayEvent(TrayEvent ev)
Called at clicks etc on the tray item.


Knopflerfish OSGi 2.4.0