Class DemoTooltipGenerator
java.lang.Object
com.levigo.jadice.web.demo.common.client.DemoTooltipGenerator
- All Implemented Interfaces:
AnnotationTooltipGenerator
An example of an
AnnotationTooltipGenerator
which creates tooltips for annotations in the
enterprise demo.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.google.gwt.safehtml.shared.SafeHtml
createTooltipText
(Document document, Annotation annotation) Creates the tooltip text for the given annotation.boolean
isEnabled
(Document document, Annotation annotation) Checks if thisAnnotationTooltipGenerator
is enabled/active for the given annotation.
-
Field Details
-
timeFormat
protected com.google.gwt.i18n.shared.DateTimeFormat timeFormat
-
-
Constructor Details
-
DemoTooltipGenerator
public DemoTooltipGenerator()
-
-
Method Details
-
createTooltipText
public com.google.gwt.safehtml.shared.SafeHtml createTooltipText(Document document, Annotation annotation) Description copied from interface:AnnotationTooltipGenerator
Creates the tooltip text for the given annotation.- Specified by:
createTooltipText
in interfaceAnnotationTooltipGenerator
- Parameters:
document
- the correspondingDocument
annotation
- the annotation to create the tooltip for- Returns:
- a
SafeHtml
object with the tooltip text, or null if no tooltip shall be shown.
-
isEnabled
Description copied from interface:AnnotationTooltipGenerator
Checks if thisAnnotationTooltipGenerator
is enabled/active for the given annotation. This method is called before the tooltip is created viaAnnotationTooltipGenerator.createTooltipText(Document, Annotation)
.Subclasses could, for example, check for a specific Annotation type to just provide tooltips for those annotation types.
- Specified by:
isEnabled
in interfaceAnnotationTooltipGenerator
- Parameters:
document
- the correspondingDocument
annotation
- the annotation which is in question to create a tooltip for- Returns:
- true:
AnnotationTooltipGenerator.createTooltipText(Document, Annotation)
will be called for this annotation; false else
-