public class TrayItem extends Item
IMPORTANT: This class is not intended to be subclassed.
Modifier and Type | Field and Description |
---|---|
(package private) Image |
highlightImage |
(package private) int |
id |
(package private) Image |
image2 |
(package private) Tray |
parent |
(package private) ToolTip |
toolTip |
(package private) java.lang.String |
toolTipText |
(package private) boolean |
visible |
CANVAS, data, DEFAULT_HEIGHT, DEFAULT_WIDTH, DISABLED, display, DISPOSE_SENT, DISPOSED, DRAG_DETECT, DRAW_BACKGROUND, eventTable, FOREIGN_HANDLE, HIDDEN, IGNORE_WM_CHANGEUISTATE, KEYED_DATA, LAYOUT_CHANGED, LAYOUT_CHILD, LAYOUT_NEEDED, MAJOR, MINOR, MOVE_DEFERRED, MOVE_OCCURRED, PARENT_BACKGROUND, RELEASED, RESIZE_DEFERRED, RESIZE_OCCURRED, SKIN_NEEDED, state, style, THEME_BACKGROUND, TRACK_MOUSE
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. |
protected void |
checkSubclass()
Checks that this class can be subclassed.
|
(package private) void |
createWidget() |
(package private) void |
destroyWidget()
Destroys the widget in the operating system and releases
the widget's handle.
|
Image |
getHighlightImage()
Returns the receiver's highlight image if it has one, or null
if it does not.
|
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. |
(package private) int |
messageProc(int hwnd,
int msg,
int wParam,
int lParam) |
(package private) void |
recreate() |
(package private) void |
releaseHandle() |
(package private) void |
releaseWidget() |
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 |
setHighlightImage(Image image)
Sets the receiver's highlight image.
|
void |
setImage(Image image)
Sets the receiver's image.
|
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 string)
Sets the receiver's tool tip text to the argument, which
may be null indicating that the default tool tip for the
control will be shown.
|
void |
setVisible(boolean visible)
Makes the receiver visible if the argument is
true ,
and makes it invisible otherwise. |
getImage, getNameText, getText, setText
_addListener, addDisposeListener, addListener, callWindowProc, checkBits, checkOpened, checkOrientation, checkParent, checkWidget, DeferWindowPos, dispose, dragDetect, error, filters, findItem, fixMnemonic, fixMnemonic, getData, getData, getDisplay, getListeners, getMenu, getName, getStyle, hooks, isDisposed, isListening, isValidSubclass, isValidThread, mapEvent, new_GC, notifyListeners, postEvent, postEvent, release, releaseChildren, releaseParent, removeDisposeListener, removeListener, removeListener, reskin, reskinChildren, reskinWidget, sendDragEvent, sendDragEvent, sendEvent, sendEvent, sendEvent, sendEvent, sendFocusEvent, sendKeyEvent, sendKeyEvent, sendMouseEvent, sendMouseEvent, sendMouseWheelEvent, sendSelectionEvent, sendSelectionEvent, setData, setData, setInputState, setKeyState, setLocationMask, setTabGroupFocus, setTabItemFocus, SetWindowPos, showMenu, showMenu, toString, updateMenuLocation, wmCaptureChanged, wmChar, wmContextMenu, wmIMEChar, wmKeyDown, wmKeyUp, wmKillFocus, wmLButtonDblClk, wmLButtonDown, wmLButtonUp, wmMButtonDblClk, wmMButtonDown, wmMButtonUp, wmMouseHover, wmMouseHWheel, wmMouseLeave, wmMouseMove, wmMouseWheel, wmNCPaint, wmPaint, wmPrint, wmRButtonDblClk, wmRButtonDown, wmRButtonUp, wmSetFocus, wmSysChar, wmSysKeyDown, wmSysKeyUp, wmXButtonDblClk, wmXButtonDown, wmXButtonUp
Tray parent
int id
Image image2
Image highlightImage
ToolTip toolTip
java.lang.String toolTipText
boolean visible
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 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 void addMenuDetectListener(MenuDetectListener listener)
MenuDetectListener
interface.listener
- the listener which should be notifiedjava.lang.IllegalArgumentException
- SWTException
- MenuDetectListener
,
removeMenuDetectListener(org.eclipse.swt.events.MenuDetectListener)
protected void checkSubclass()
Widget
The SWT class library is intended to be subclassed
only at specific, controlled points (most notably,
Composite
and Canvas
when
implementing new widgets). This method enforces this
rule unless it is overridden.
IMPORTANT: By providing an implementation of this method that allows a subclass of a class which does not normally allow subclassing to be created, the implementer agrees to be fully responsible for the fact that any such subclass will likely fail between SWT releases and will be strongly platform specific. No support is provided for user-written classes which are implemented in this fashion.
The ability to subclass outside of the allowed SWT classes is intended purely to enable those not on the SWT development team to implement patches in order to get around specific limitations in advance of when those limitations can be addressed by the team. Subclassing should not be attempted without an intimate and detailed understanding of the hierarchy.
checkSubclass
in class Item
void createWidget()
void destroyWidget()
Widget
When a widget is destroyed in the operating system, its
descendants are also destroyed by the operating system.
This means that it is only necessary to call destroyWidget
on the root of the widget tree.
This method is called after releaseWidget()
.
See also releaseChild()
, releaseWidget()
and releaseHandle()
.
destroyWidget
in class Widget
Widget.dispose()
public Image getHighlightImage()
SWTException
- public Tray getParent()
Tray
.SWTException
- public ToolTip getToolTip()
SWTException
- public java.lang.String getToolTipText()
SWTException
- public boolean getVisible()
true
if the receiver is visible and
false
otherwise.SWTException
- int messageProc(int hwnd, int msg, int wParam, int lParam)
void recreate()
void releaseHandle()
releaseHandle
in class Widget
void releaseWidget()
releaseWidget
in class Item
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 removeMenuDetectListener(MenuDetectListener listener)
listener
- the listener which should no longer be notifiedjava.lang.IllegalArgumentException
- SWTException
- MenuDetectListener
,
addMenuDetectListener(org.eclipse.swt.events.MenuDetectListener)
public void setHighlightImage(Image image)
image
- the new highlight imagejava.lang.IllegalArgumentException
- SWTException
- public void setImage(Image image)
setImage
in class Item
image
- the new imagejava.lang.IllegalArgumentException
- SWTException
- public void setToolTip(ToolTip toolTip)
toolTip
- the new tool tip (or null)SWTException
- public void setToolTipText(java.lang.String string)
The mnemonic indicator (character '&') is not displayed in a tool tip. To display a single '&' in the tool tip, the character '&' can be escaped by doubling it in the string.
string
- the new tool tip text (or null)SWTException
- public void setVisible(boolean visible)
true
,
and makes it invisible otherwise.visible
- the new visibility stateSWTException
-