TrayItem

Instances of this class represent icons that can be placed on the system tray or task bar status area. <p> <dl> <dt><b>Styles:</b></dt> <dd>(none)</dd> <dt><b>Events:</b></dt> <dd>DefaultSelection, MenuDetect, Selection</dd> </dl> </p><p> IMPORTANT: This class is <em>not</em> intended to be subclassed. </p>

@see <a href="http://www.eclipse.org/swt/snippets/#tray">Tray, TrayItem snippets</a> @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>

@since 3.0

Constructors

this
this(Tray parent, int style)

Constructs a new instance of this class given its parent (which must be a <code>Tray</code>) and a style value describing its behavior and appearance. The item is added to the end of the items maintained by its parent. <p> The style value is either one of the style constants defined in class <code>SWT</code> which is applicable to instances of this class, or must be built by <em>bitwise OR</em>'ing together (that is, using the <code>int</code> "|" operator) two or more of those <code>SWT</code> style constants. The class description lists the style constants that are applicable to the class. Style bits are also inherited from superclasses. </p>

Members

Functions

addMenuDetectListener
void addMenuDetectListener(MenuDetectListener listener)

Adds the listener to the collection of listeners who will be notified when the platform-specific context menu trigger has occurred, by sending it one of the messages defined in the <code>MenuDetectListener</code> interface.

addSelectionListener
void addSelectionListener(SelectionListener listener)

Adds the listener to the collection of listeners who will be notified when the receiver is selected by the user, by sending it one of the messages defined in the <code>SelectionListener</code> interface. <p> <code>widgetSelected</code> is called when the receiver is selected <code>widgetDefaultSelected</code> is called when the receiver is double-clicked </p>

getParent
Tray getParent()

Returns the receiver's parent, which must be a <code>Tray</code>.

getToolTip
ToolTip getToolTip()

Returns the receiver's tool tip, or null if it has not been set.

getToolTipText
String getToolTipText()

Returns the receiver's tool tip text, or null if it has not been set.

getVisible
bool getVisible()

Returns <code>true</code> if the receiver is visible and <code>false</code> otherwise.

removeMenuDetectListener
void removeMenuDetectListener(MenuDetectListener listener)

Removes the listener from the collection of listeners who will be notified when the platform-specific context menu trigger has occurred.

removeSelectionListener
void removeSelectionListener(SelectionListener listener)

Removes the listener from the collection of listeners who will be notified when the receiver is selected by the user.

setImage
void setImage(Image image)

Sets the receiver's image.

setToolTip
void setToolTip(ToolTip toolTip)

Sets the receiver's tool tip to the argument, which may be null indicating that no tool tip should be shown.

setToolTipText
void setToolTipText(String string)

Sets the receiver's tool tip text to the argument, which may be null indicating that no tool tip text should be shown.

setVisible
void setVisible(bool visible)

Makes the receiver visible if the argument is <code>true</code>, and makes it invisible otherwise.

Inherited Members

From Item

getImage
Image getImage()

Returns the receiver's image if it has one, or null if it does not.

getText
String getText()

Returns the receiver's text, which will be an empty string if it has never been set.

setImage
void setImage(Image image)

Sets the receiver's image to the argument, which may be null indicating that no image should be displayed.

setText
void setText(String string)

Sets the receiver's text.

Meta