com.jeans.trayicon
Class TrayIconPopupSimpleItem

java.lang.Object
  extended bycom.jeans.trayicon.TrayIconPopupSimpleItem
All Implemented Interfaces:
com.jeans.trayicon.TrayIconPopupItem
Direct Known Subclasses:
TrayIconPopupCheckItem

public class TrayIconPopupSimpleItem
extends java.lang.Object
implements com.jeans.trayicon.TrayIconPopupItem


Constructor Summary
TrayIconPopupSimpleItem(java.lang.String item)
          Create a new menu item Param item = name of new item
 
Method Summary
 void addActionListener(java.awt.event.ActionListener listener)
          Add an ActionLister to this menu item Just like with java.awt.Button or javax.swing.JButton Param listener = your listener
 java.lang.String getName()
          Return the name of this item
 int getNbLevels()
          Return submenu depth - used by WindowsTrayIcon.setPopup()/initPopup()
 boolean onSelected(int menuId)
          Callback when user selects menu item (find it by comparing menu id's) Param menuId = the id of the selected item
 void setDefault(boolean def)
          Set item as default Param def = set item as default?
 void setEnabled(boolean enable)
          Enable/Disable item Param enable = enable/disable item?
 void setTrayIcon(WindowsTrayIcon trayicon, int id, int level)
          Create menu in native library - used by WindowsTrayIcon.setPopup() Param trayicon = the owner of this menu Param id = the icon's id Param level = the level (submenu depth)
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TrayIconPopupSimpleItem

public TrayIconPopupSimpleItem(java.lang.String item)
Create a new menu item Param item = name of new item

Method Detail

getName

public java.lang.String getName()
Return the name of this item


addActionListener

public void addActionListener(java.awt.event.ActionListener listener)
Add an ActionLister to this menu item Just like with java.awt.Button or javax.swing.JButton Param listener = your listener


getNbLevels

public int getNbLevels()
Return submenu depth - used by WindowsTrayIcon.setPopup()/initPopup()

Specified by:
getNbLevels in interface com.jeans.trayicon.TrayIconPopupItem

setEnabled

public void setEnabled(boolean enable)
Enable/Disable item Param enable = enable/disable item?


setDefault

public void setDefault(boolean def)
Set item as default Param def = set item as default?


onSelected

public boolean onSelected(int menuId)
Callback when user selects menu item (find it by comparing menu id's) Param menuId = the id of the selected item

Specified by:
onSelected in interface com.jeans.trayicon.TrayIconPopupItem

setTrayIcon

public void setTrayIcon(WindowsTrayIcon trayicon,
                        int id,
                        int level)
Create menu in native library - used by WindowsTrayIcon.setPopup() Param trayicon = the owner of this menu Param id = the icon's id Param level = the level (submenu depth)

Specified by:
setTrayIcon in interface com.jeans.trayicon.TrayIconPopupItem