Class IzToolTipImpl
java.lang.Object
org.eclipse.jface.window.ToolTip
org.eclipse.jface.window.DefaultToolTip
com.iizigo.swt.IzToolTipImpl
The tooltip implementor class controlled by
IzToolTip.- Author:
- Christopher Mindus
Field Summary
FieldsFields inherited from class ToolTip
NO_RECREATE, RECREATEConstructor Summary
ConstructorsConstructorDescriptionIzToolTipImpl(Control control, boolean useHideTimeout) Constructs the tooltip.IzToolTipImpl(Control control, boolean useRegions, boolean useHideTimeout) Constructs the tooltip.Method Summary
Modifier and TypeMethodDescriptionstatic CompositecreateHTMLComposite(Composite topMost, Composite parent, KString kstring, KStringInfoProviderAdapter adapter) Creates a HTML composite for HTML preview.static CompositecreateJavaDocComposite(Composite topMost, Composite parent, org.eclipse.jdt.core.IMember member) Creates a JavaDoc tooltip composite for a member.protected CompositecreateToolTipContentArea(Event event, Composite parent) Creates the tooltip content area for HTML.static booleanhideWhenNoBrowser(Composite content, Runnable hide) Hides a tooltip whose content holds no Browser the way an IzToolTipImpl hides its own: when the shell ofcontentcarries the marker ofmarkNoBrowser(Composite)(taken, seetakeNoBrowser(Composite)),hideruns in the shell's Show event, where SWT allows the shell to be disposed of, so that nothing is shown and the next hover tries again.voidSets the text, type is 0=normal text, 1=text with fixed font, 2=text in HTML.static voidmarkNoBrowser(Composite content) Marks the tooltip shell of a content composite: a Browser of the content could not be created (e.g.voidsetHideTimeout(boolean on) Sets using hide timeout.voidsetJavaMember(org.eclipse.jdt.core.IMember member) Sets a Java member to show as HTML from its JavaDoc.voidSets the DesignerProp as the tooltip creator for the contents area.voidsetProperty(DesignerProp dp, IzToolTipPropEnhancer enhancer) Sets the DesignerProp as the tooltip creator for the contents area.voidsetProperty(GProp<?> gp) Sets the property as the tooltip creator for the contents area.voidsetText(String text, int type, KStringInfoProviderAdapter adapter) Sets the text, type is 0=normal text, 1=text with fixed font, 2=text in HTML.static booleantakeNoBrowser(Composite content) Whether the content created in a tooltip shell holds no Browser: the shell ofcontentcarries the marker ofmarkNoBrowser(Composite).Methods inherited from class DefaultToolTip
getBackgroundColor, getBackgroundImage, getFont, getForegroundColor, getImage, getStyle, getText, setBackgroundColor, setBackgroundImage, setFont, setForegroundColor, setImage, setStyle, setTextMethods inherited from class ToolTip
activate, afterHideToolTip, deactivate, getData, getLocation, getToolTipArea, hide, isHideOnMouseDown, isRespectDisplayBounds, isRespectMonitorBounds, setData, setHideDelay, setHideOnMouseDown, setPopupDelay, setRespectDisplayBounds, setRespectMonitorBounds, setShift, shouldCreateToolTip, show
Field Details
KEY
Constructor Details
IzToolTipImpl
Constructs the tooltip.- Parameters:
control- The owner of the tooltip.useHideTimeout- true to hide the tooltip after a timeout, false to leave it shown.
IzToolTipImpl
Constructs the tooltip.- Parameters:
control- The owner of the tooltip.useRegions- true to keep the tooltip shell between shows, false to recreate it each time.useHideTimeout- true to hide the tooltip after a timeout, false to leave it shown.
Method Details
setHideTimeout
public void setHideTimeout(boolean on) Sets using hide timeout.createToolTipContentArea
Creates the tooltip content area for HTML.- Overrides:
createToolTipContentAreain classDefaultToolTip
ksetText
Sets the text, type is 0=normal text, 1=text with fixed font, 2=text in HTML.setText
Sets the text, type is 0=normal text, 1=text with fixed font, 2=text in HTML.setProperty
Sets the DesignerProp as the tooltip creator for the contents area. This will cancel tooltip text as text/HTML.setProperty
Sets the DesignerProp as the tooltip creator for the contents area. This will cancel tooltip text as text/HTML.setProperty
Sets the property as the tooltip creator for the contents area. This will cancel tooltip text as text/HTML.setJavaMember
public void setJavaMember(org.eclipse.jdt.core.IMember member) Sets a Java member to show as HTML from its JavaDoc.createJavaDocComposite
public static Composite createJavaDocComposite(Composite topMost, Composite parent, org.eclipse.jdt.core.IMember member) Creates a JavaDoc tooltip composite for a member.- Parameters:
topMost- The top-most composite, forwarded to createTooltipComposite, which does not consult it.parent- The parent composite.member- The member.- Returns:
- null if not possible.
markNoBrowser
Marks the tooltip shell of a content composite: a Browser of the content could not be created (e.g. WebView2's creation timed out). The hosts that hide such a tooltip (hideWhenNoBrowser(Composite, Runnable),takeNoBrowser(Composite)) then show nothing, and the next hover tries again. Called bycreateTooltipComposite(Composite, Composite, String, int, boolean)for the HTML and JavaDoc tooltips, and by a content whose own Browser failed (the image preview of a component).- Parameters:
content- A composite of the tooltip's content (its shell is the tooltip shell).
takeNoBrowser
Whether the content created in a tooltip shell holds no Browser: the shell ofcontentcarries the marker ofmarkNoBrowser(Composite). The marker is taken (cleared), so that a shell shown again later with a new content is judged by that content.- Parameters:
content- A composite of the tooltip's content (its shell is the tooltip shell).- Returns:
- true when a Browser of the content could not be created.
hideWhenNoBrowser
Hides a tooltip whose content holds no Browser the way an IzToolTipImpl hides its own: when the shell ofcontentcarries the marker ofmarkNoBrowser(Composite)(taken, seetakeNoBrowser(Composite)),hideruns in the shell's Show event, where SWT allows the shell to be disposed of, so that nothing is shown and the next hover tries again.- Parameters:
content- A composite of the tooltip's content (its shell is the tooltip shell).hide- What hides the tooltip, e.g. a JFace ToolTip'shide().- Returns:
- true when the tooltip will be hidden.
createHTMLComposite
public static Composite createHTMLComposite(Composite topMost, Composite parent, KString kstring, KStringInfoProviderAdapter adapter) Creates a HTML composite for HTML preview.