public class TrayItem extends Item
IMPORTANT: This class is not intended to be subclassed.
Constructor and Description |
---|
TrayItem(Tray parent,
int style)
Constructs a new instance of this class given its parent (which must be a
Tray ) and a style value describing its behavior and
appearance. |
Modifier and Type | Method and Description |
---|---|
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
MenuDetectListener interface. |
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
SelectionListener interface. |
Tray |
getParent()
Returns the receiver's parent, which must be a
Tray . |
ToolTip |
getToolTip()
Returns the receiver's tool tip, or null if it has
not been set.
|
java.lang.String |
getToolTipText()
Returns the receiver's tool tip text, or null if it has not been set.
|
boolean |
getVisible()
Returns
true if the receiver is visible and false
otherwise. |
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.
|
void |
removeSelectionListener(SelectionListener listener)
Removes the listener from the collection of listeners who will be notified
when the receiver is selected by the user.
|
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.
|
void |
setToolTipText(java.lang.String value)
Sets the receiver's tool tip text to the argument, which may be null
indicating that no tool tip text should be shown.
|
void |
setVisible(boolean visible)
Makes the receiver visible if the argument is
true , and makes
it invisible otherwise. |
addDisposeListener, addListener, checkSubclass, checkWidget, dispose, getAdapter, getData, getData, getDisplay, getListeners, getStyle, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, reskin, setData, setData, toString
public TrayItem(Tray parent, int style)
Tray
) and a style value describing its behavior and
appearance. The item is added to the end of the items maintained by its
parent.
The style value is either one of the style constants defined in class
SWT
which is applicable to instances of this class, or must be
built by bitwise OR'ing together (that is, using the
int
"|" operator) two or more of those SWT
style
constants. The class description lists the style constants that are
applicable to the class. Style bits are also inherited from superclasses.
parent
- a composite control which will be the parent of the new
instance (cannot be null)style
- the style of control to constructjava.lang.IllegalArgumentException
- SWTException
- SWT
,
Widget.checkSubclass()
,
Widget.getStyle()
public Tray getParent()
Tray
.SWTException
- public void addSelectionListener(SelectionListener listener)
SelectionListener
interface.
widgetSelected
is called when the receiver is selected
widgetDefaultSelected
is called when the receiver is
double-clicked
listener
- the listener which should be notified when the receiver is
selected by the userjava.lang.IllegalArgumentException
- SWTException
- SelectionListener
,
removeSelectionListener(org.eclipse.swt.events.SelectionListener)
,
SelectionEvent
public java.lang.String getToolTipText()
SWTException
- public boolean getVisible()
true
if the receiver is visible and false
otherwise.SWTException
- public void removeSelectionListener(SelectionListener listener)
listener
- the listener which should no longer be notifiedjava.lang.IllegalArgumentException
- SWTException
- SelectionListener
,
addSelectionListener(org.eclipse.swt.events.SelectionListener)
public void setToolTipText(java.lang.String value)
value
- the new tool tip text (or null)SWTException
- public void setVisible(boolean visible)
true
, and makes
it invisible otherwise.visible
- the new visibility stateSWTException
- public void addMenuDetectListener(MenuDetectListener listener)
MenuDetectListener
interface.listener
- the listener which should be notifiedjava.lang.IllegalArgumentException
- SWTException
- MenuDetectListener
,
removeMenuDetectListener(org.eclipse.swt.events.MenuDetectListener)
public void removeMenuDetectListener(MenuDetectListener listener)
listener
- the listener which should no longer be notifiedjava.lang.IllegalArgumentException
- SWTException
- MenuDetectListener
,
addMenuDetectListener(org.eclipse.swt.events.MenuDetectListener)
public void setToolTip(ToolTip toolTip)
toolTip
- the new tool tip (or null)SWTException
- public ToolTip getToolTip()
SWTException
-
Copyright (c) EclipseSource and others 2002, 2016.
All rights reserved. This program and the accompanying materials
are made available under the terms of the
Eclipse Public License v1.0