|
Eclipse Platform Release 3.3 |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.jface.window.ToolTip
This class gives implementors to provide customized tooltips for any control.
Field Summary | |
---|---|
static int |
NO_RECREATE
Don't recreate the tooltip as long the mouse doesn't leave the area triggering the Tooltip creation |
static int |
RECREATE
Recreate the tooltip on every mouse move |
Constructor Summary | |
---|---|
ToolTip(Control control)
Create new instance which add TooltipSupport to the widget |
|
ToolTip(Control control,
int style,
boolean manualActivation)
|
Method Summary | |
---|---|
void |
activate()
Activate tooltip support for this control |
protected void |
afterHideToolTip(Event event)
This method is called after a Tooltip is hidden. |
protected abstract Composite |
createToolTipContentArea(Event event,
Composite parent)
Creates the content area of the the tooltip. |
void |
deactivate()
Deactivate tooltip support for the underlying control |
Object |
getData(String key)
Get the data restored under the key |
Point |
getLocation(Point tipSize,
Event event)
Get the display relative location where the tooltip is displayed. |
protected Object |
getToolTipArea(Event event)
This method is called to check for which area the tooltip is created/hidden for. |
void |
hide()
Hide the currently active tool tip |
boolean |
isHideOnMouseDown()
Return if hiding on mouse down is set. |
boolean |
isRespectDisplayBounds()
Return whther the tooltip respects bounds of the display. |
boolean |
isRespectMonitorBounds()
Return whther the tooltip respects bounds of the monitor. |
void |
setData(String key,
Object value)
Restore arbitary data under the given key |
void |
setHideDelay(int hideDelay)
Set the hide delay. |
void |
setHideOnMouseDown(boolean hideOnMouseDown)
If you don't want the tool tip to be hidden when the user clicks inside the tool tip set this to false . |
void |
setPopupDelay(int popupDelay)
Set the popup delay. |
void |
setRespectDisplayBounds(boolean respectDisplayBounds)
Set to false if display bounds should not be respected or
to true if the tooltip is should repositioned to not
overlap the display bounds.
|
void |
setRespectMonitorBounds(boolean respectMonitorBounds)
Set to false if monitor bounds should not be respected or
to true if the tooltip is should repositioned to not
overlap the monitors bounds. |
void |
setShift(Point p)
Set the shift (from the mouse position triggered the event) used to display the tooltip. |
protected boolean |
shouldCreateToolTip(Event event)
Should the tooltip displayed because of the given event. |
void |
show(Point location)
Start up the tooltip programmatically |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int RECREATE
public static final int NO_RECREATE
Constructor Detail |
public ToolTip(Control control)
control
- the control on whose action the tooltip is shownpublic ToolTip(Control control, int style, boolean manualActivation)
control
- the control to which the tooltip is boundstyle
- style passed to control tooltip behaviourmanualActivation
- true
if the activation is done manually using
show(Point)
RECREATE
,
NO_RECREATE
Method Detail |
public void setData(String key, Object value)
key
- the keyvalue
- the valuepublic Object getData(String key)
key
- the key
null
if no entry is restored under the keypublic void setShift(Point p)
p
- the new shiftpublic void activate()
public void deactivate()
public boolean isRespectDisplayBounds()
true
if the tooltip respects bounds of the displaypublic void setRespectDisplayBounds(boolean respectDisplayBounds)
false
if display bounds should not be respected or
to true
if the tooltip is should repositioned to not
overlap the display bounds.
Default is true
respectDisplayBounds
- public boolean isRespectMonitorBounds()
true
if tooltip respects the bounds of the monitorpublic void setRespectMonitorBounds(boolean respectMonitorBounds)
false
if monitor bounds should not be respected or
to true
if the tooltip is should repositioned to not
overlap the monitors bounds. The monitor the tooltip belongs to is the
same is control's monitor the tooltip is shown for.
Default is true
respectMonitorBounds
- protected boolean shouldCreateToolTip(Event event)
Subclasses may overwrite this to get custom behaviour
event
- the event
true
if tooltip should be displayedprotected Object getToolTipArea(Event event)
NO_RECREATE
this is used to
decide if the tooltip is hidden recreated.
By the default it is the widget the tooltip is created for but could be any object. To decide if
the area changed the Object.equals(Object)
method is used.
event
- the event
null
this could be any object describing the area
(e.g. the Control
onto which the tooltip is bound to, a part of
this area e.g. for ColumnViewer
this could be a
ViewerCell
)public void show(Point location)
location
- the location relative to the control the tooltip is shownpublic Point getLocation(Point tipSize, Event event)
tipSize
- the size of the tooltip to be shownevent
- the event triggered showing the tooltip
protected abstract Composite createToolTipContentArea(Event event, Composite parent)
event
- the event that triggered the activation of the tooltipparent
- the parent of the content area
protected void afterHideToolTip(Event event)
Subclasses may override to clean up requested system resources
event
- event triggered the hiding action (may be null
if event wasn't triggered by user actions directly)public void setHideDelay(int hideDelay)
hideDelay
- the delay before the tooltip is hidden. If 0
the tooltip is shown until user moves to other itempublic void setPopupDelay(int popupDelay)
popupDelay
- the delay before the tooltip is shown to the user. If
0
the tooltip is shown immediatelypublic boolean isHideOnMouseDown()
true
if hiding on mouse down in the tool tip is onpublic void setHideOnMouseDown(boolean hideOnMouseDown)
false
. You maybe also need to
hide the tool tip yourself depending on what you do after clicking in the
tooltip (e.g. if you open a new Shell
)
hideOnMouseDown
- flag to indicate of tooltip is hidden automatically on mouse
down inside the tool tippublic void hide()
|
Eclipse Platform Release 3.3 |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Guidelines for using Eclipse APIs.
Copyright (c) IBM Corp. and others 2000, 2007. All rights reserved.