Class ToolTip
- Styles:
- BALLOON, ICON_ERROR, ICON_INFORMATION, ICON_WARNING
- Events:
- Selection
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.
- Since:
- 3.2
- See Also:
- Restriction:
- This class is not intended to be subclassed by clients.
- 
Field SummaryFields inherited from class org.eclipse.swt.widgets.WidgetnativeZoom
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddSelectionListener(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 theSelectionListenerinterface.booleanReturnstrueif the receiver is automatically hidden by the platform, andfalseotherwise.Returns the receiver's message, which will be an empty string if it has never been set.Returns the receiver's parent, which must be aShell.getText()Returns the receiver's text, which will be an empty string if it has never been set.booleanReturnstrueif the receiver is visible, andfalseotherwise.booleanReturnstrueif the receiver is visible and all of the receiver's ancestors are visible andfalseotherwise.voidremoveSelectionListener(SelectionListener listener) Removes the listener from the collection of listeners who will be notified when the receiver is selected by the user.voidsetAutoHide(boolean autoHide) Makes the receiver hide automatically whentrue, and remain visible whenfalse.voidsetLocation(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.voidsetLocation(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.voidsetMessage(String string) Sets the receiver's message.voidSets the receiver's text.voidsetVisible(boolean visible) Marks the receiver as visible if the argument istrue, and marks it invisible otherwise.Methods inherited from class org.eclipse.swt.widgets.WidgetaddDisposeListener, addListener, addTypedListener, checkSubclass, checkWidget, dispose, getData, getData, getDisplay, getListeners, getStyle, getTypedListeners, isAutoDirection, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, removeListener, removeTypedListener, reskin, setData, setData, toString
- 
Constructor Details- 
ToolTipConstructs a new instance of this class given its parent and a style value describing its behavior and appearance.The style value is either one of the style constants defined in class SWTwhich is applicable to instances of this class, or must be built by bitwise OR'ing together (that is, using theint"|" operator) two or more of thoseSWTstyle constants. The class description lists the style constants that are applicable to the class. Style bits are also inherited from superclasses.- Parameters:
- parent- a composite control which will be the parent of the new instance (cannot be null)
- style- the style of control to construct
- Throws:
- IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the parent is null
 
- SWTException-- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent
- ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass
 
- See Also:
 
 
- 
- 
Method Details- 
addSelectionListenerAdds 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 theSelectionListenerinterface.widgetSelectedis called when the receiver is selected.widgetDefaultSelectedis not called.- Parameters:
- listener- the listener which should be notified when the receiver is selected by the user
- Throws:
- IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the listener is null
 
- SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
 
- See Also:
 
- 
getAutoHidepublic boolean getAutoHide()Returnstrueif the receiver is automatically hidden by the platform, andfalseotherwise.- Returns:
- the receiver's auto hide state
- Throws:
- SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
 
 
- 
getMessageReturns the receiver's message, which will be an empty string if it has never been set.- Returns:
- the receiver's message
- Throws:
- SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
 
 
- 
getParentReturns the receiver's parent, which must be aShell.- Returns:
- the receiver's parent
- Throws:
- SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
 
 
- 
getTextReturns the receiver's text, which will be an empty string if it has never been set.- Returns:
- the receiver's text
- Throws:
- SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
 
 
- 
getVisiblepublic boolean getVisible()Returnstrueif the receiver is visible, andfalseotherwise.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. - Returns:
- the receiver's visibility state
- Throws:
- SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
 
 
- 
isVisiblepublic boolean isVisible()Returnstrueif the receiver is visible and all of the receiver's ancestors are visible andfalseotherwise.- Returns:
- the receiver's visibility state
- Throws:
- SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
 
- See Also:
 
- 
removeSelectionListenerRemoves the listener from the collection of listeners who will be notified when the receiver is selected by the user.- Parameters:
- listener- the listener which should no longer be notified
- Throws:
- IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the listener is null
 
- SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
 
- See Also:
 
- 
setAutoHidepublic void setAutoHide(boolean autoHide) Makes the receiver hide automatically whentrue, and remain visible whenfalse.- Parameters:
- autoHide- the auto hide state
- Throws:
- SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
 
- See Also:
 
- 
setLocationpublic 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.Note that this is different from most widgets where the location of the widget is relative to the parent. - Parameters:
- x- the new x coordinate for the receiver
- y- the new y coordinate for the receiver
- Throws:
- SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
 
 
- 
setLocationSets the location of the receiver, which must be a tooltip, to the point specified by the argument which is relative to the display.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. - Parameters:
- location- the new location for the receiver
- Throws:
- IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the point is null
 
- SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
 
 
- 
setMessageSets the receiver's message.- Parameters:
- string- the new message
- Throws:
- IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the text is null
 
- SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
 
 
- 
setTextSets the receiver's text.- Parameters:
- string- the new text
- Throws:
- IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the text is null
 
- SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
 
 
- 
setVisiblepublic void setVisible(boolean visible) Marks the receiver as visible if the argument istrue, 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. - Parameters:
- visible- the new visibility state
- Throws:
- SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
 
 
 
-