SysTray for Java
v2.4.1  

snoozesoft.systray4j
Class SysTrayMenuItem

java.lang.Object
  extended bysnoozesoft.systray4j.SysTrayMenuItem
Direct Known Subclasses:
CheckableMenuItem, SubMenu

public class SysTrayMenuItem
extends java.lang.Object

This class represents a labeled menu item. Interested listeners are called whenever this item is clicked.


Constructor Summary
SysTrayMenuItem(java.lang.String label)
          Creates a new SysTrayMenuItem object.
SysTrayMenuItem(java.lang.String label, java.lang.String actionCommand)
          Creates a new SysTrayMenuItem object.
 
Method Summary
 void addSysTrayMenuListener(SysTrayMenuListener listener)
          Adds the specified listener to receive events from this menu item.
 java.lang.String getActionCommand()
          Getter for the emitted action command.
 java.lang.String getLabel()
          Getter for the item label.
 boolean isEnabled()
          Method to check whether this item is enabled.
 void removeSysTrayMenuListener(SysTrayMenuListener listener)
          Removes the specified listener so that it no longer receives events from this menu item.
 void setActionCommand(java.lang.String actionCommand)
          Setter for the emitted action command.
 void setEnabled(boolean enabled)
          Enables/disables this item.
 void setLabel(java.lang.String label)
          Setter for the item label.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SysTrayMenuItem

public SysTrayMenuItem(java.lang.String label)
Creates a new SysTrayMenuItem object.

Parameters:
label - The label of the item.

SysTrayMenuItem

public SysTrayMenuItem(java.lang.String label,
                       java.lang.String actionCommand)
Creates a new SysTrayMenuItem object.

Parameters:
label - The label of the item.
actionCommand - The action command emitted when this item is clicked.
Method Detail

addSysTrayMenuListener

public void addSysTrayMenuListener(SysTrayMenuListener listener)
Adds the specified listener to receive events from this menu item.

Parameters:
listener - The systray menu listener.

getActionCommand

public java.lang.String getActionCommand()
Getter for the emitted action command.

Returns:
The action command emitted when this item is clicked.

getLabel

public java.lang.String getLabel()
Getter for the item label.

Returns:
The label of this item.

isEnabled

public boolean isEnabled()
Method to check whether this item is enabled.

Returns:
The enabled state.

removeSysTrayMenuListener

public void removeSysTrayMenuListener(SysTrayMenuListener listener)
Removes the specified listener so that it no longer receives events from this menu item.

Parameters:
listener - The systray menu listener.

setActionCommand

public void setActionCommand(java.lang.String actionCommand)
Setter for the emitted action command.

Parameters:
actionCommand - The action command emitted when this item is clicked.

setEnabled

public void setEnabled(boolean enabled)
Enables/disables this item.

Parameters:
enabled - Value to enable/disable this item.

setLabel

public void setLabel(java.lang.String label)
Setter for the item label.

Parameters:
label - The label of this item.

SysTray for Java
v2.4.1