public class ToolTip extends Widget
Note: Only one of the styles ICON_ERROR, ICON_INFORMATION, and ICON_WARNING may be specified.
IMPORTANT: This class is not intended to be subclassed.
Modifier and Type | Field and Description |
---|---|
(package private) boolean |
autoHide |
(package private) boolean |
hasLocation |
(package private) int |
id |
(package private) TrayItem |
item |
(package private) java.lang.String |
message |
(package private) Shell |
parent |
(package private) java.lang.String |
text |
(package private) static int |
TIMER_ID |
(package private) boolean |
visible |
(package private) int |
x |
(package private) int |
y |
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 |
---|
ToolTip(Shell parent,
int style)
Constructs a new instance of this class given its parent
and a style value describing its behavior and appearance.
|
Modifier and Type | Method and Description |
---|---|
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. |
(package private) static int |
checkStyle(int style) |
(package private) void |
destroyWidget()
Destroys the widget in the operating system and releases
the widget's handle.
|
boolean |
getAutoHide()
Returns
true if the receiver is automatically
hidden by the platform, and false otherwise. |
java.lang.String |
getMessage()
Returns the receiver's message, which will be an empty
string if it has never been set.
|
Shell |
getParent()
Returns the receiver's parent, which must be a
Shell . |
java.lang.String |
getText()
Returns the receiver's text, which will be an empty
string if it has never been set.
|
boolean |
getVisible()
Returns
true if the receiver is visible, and
false otherwise. |
(package private) int |
hwndToolTip() |
boolean |
isVisible()
Returns
true if the receiver is visible and all
of the receiver's ancestors are visible and false
otherwise. |
(package private) void |
releaseHandle() |
(package private) void |
releaseWidget() |
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 |
setAutoHide(boolean autoHide)
Makes the receiver hide automatically when
true ,
and remain visible when false . |
void |
setLocation(int x,
int y)
Sets the location of the receiver, which must be a tooltip,
to the point specified by the arguments which are relative
to the display.
|
void |
setLocation(Point location)
Sets the location of the receiver, which must be a tooltip,
to the point specified by the argument which is relative
to the display.
|
void |
setMessage(java.lang.String string)
Sets the receiver's message.
|
void |
setText(java.lang.String string)
Sets the receiver's text.
|
void |
setVisible(boolean visible)
Marks the receiver as visible if the argument is
true ,
and marks it invisible otherwise. |
_addListener, addDisposeListener, addListener, callWindowProc, checkBits, checkOpened, checkOrientation, checkParent, checkSubclass, checkWidget, DeferWindowPos, dispose, dragDetect, error, filters, findItem, fixMnemonic, fixMnemonic, getData, getData, getDisplay, getListeners, getMenu, getName, getNameText, 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
Shell parent
TrayItem item
java.lang.String text
java.lang.String message
int id
int x
int y
boolean autoHide
boolean hasLocation
boolean visible
static final int TIMER_ID
public ToolTip(Shell parent, int style)
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.BALLOON
,
SWT.ICON_ERROR
,
SWT.ICON_INFORMATION
,
SWT.ICON_WARNING
,
Widget.checkSubclass()
,
Widget.getStyle()
static int checkStyle(int style)
public void addSelectionListener(SelectionListener listener)
SelectionListener
interface.
widgetSelected
is called when the receiver is selected.
widgetDefaultSelected
is not called.
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
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 boolean getAutoHide()
true
if the receiver is automatically
hidden by the platform, and false
otherwise.SWTException
- public java.lang.String getMessage()
SWTException
- public Shell getParent()
Shell
.SWTException
- public java.lang.String getText()
SWTException
- public boolean getVisible()
true
if the receiver is visible, and
false
otherwise.
If one of the receiver's ancestors is not visible or some other condition makes the receiver not visible, this method may still indicate that it is considered visible even though it may not actually be showing.
SWTException
- int hwndToolTip()
public boolean isVisible()
true
if the receiver is visible and all
of the receiver's ancestors are visible and false
otherwise.SWTException
- getVisible()
void releaseHandle()
releaseHandle
in class Widget
void releaseWidget()
releaseWidget
in class Widget
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 setAutoHide(boolean autoHide)
true
,
and remain visible when false
.autoHide
- the auto hide stateSWTException
- getVisible()
,
setVisible(boolean)
public void setLocation(int x, int y)
Note that this is different from most widgets where the location of the widget is relative to the parent.
x
- the new x coordinate for the receivery
- the new y coordinate for the receiverSWTException
- public void setLocation(Point location)
Note that this is different from most widgets where the location of the widget is relative to the parent.
Note that the platform window manager ultimately has control over the location of tooltips.
location
- the new location for the receiverjava.lang.IllegalArgumentException
- SWTException
- public void setMessage(java.lang.String string)
string
- the new messagejava.lang.IllegalArgumentException
- SWTException
- public void setText(java.lang.String string)
string
- the new textjava.lang.IllegalArgumentException
- SWTException
- public void setVisible(boolean visible)
true
,
and marks it invisible otherwise.
If one of the receiver's ancestors is not visible or some other condition makes the receiver not visible, marking it visible may not actually cause it to be displayed.
visible
- the new visibility stateSWTException
-