public abstract class HoverBase extends MarkupWidget implements IsWidget, HasWidgets, HasOneWidget, IsAnimated, HasTrigger, HasPlacement, HasText, HasShowDelay, HasVisibility
HasWidgets.ForIsWidget
Modifier and Type | Field and Description |
---|---|
protected boolean |
animated
Whether the widget is animated or not.
|
protected String |
container
Appends the popover to a specific element.
|
protected int |
hideDelayInMilliseconds
The delay until the widget is hidden.
|
protected Placement |
placement
The placement of the widget relative to its trigger element.
|
protected int |
showDelayInMilliseconds
The delay until the widget is shown.
|
protected Trigger |
trigger
The action that triggers the widget.
|
widget
Constructor and Description |
---|
HoverBase()
Creates a new widget based on the provided HTML tag.
|
Modifier and Type | Method and Description |
---|---|
Widget |
asWidget() |
protected abstract void |
changeVisibility(VisibilityChange visibilityChange)
Changes the visibility of the widget.
|
boolean |
getAnimation()
Gets whether the widget is animated.
|
String |
getContainer() |
protected abstract String |
getDataName()
Get data name of JS Data API.
|
int |
getHideDelay()
Gets the time to wait until the widget is hidden.
|
Placement |
getPlacement()
Gets the widget's placement.
|
int |
getShowDelay()
Gets the time to wait until the widget is shown.
|
Trigger |
getTrigger()
Gets the widget's Trigger.
|
void |
hide()
Hides the widget if it was previously shown.
|
abstract void |
reconfigure()
Redraws the widget with the currently set options.
|
protected void |
removeDataIfExists() |
protected abstract void |
removeDataIfExists(Element e,
String dataName) |
void |
setAnimation(boolean animated)
Sets whether the Widget should be animated.
|
void |
setContainer(String container)
Set specific element the Popover/Tooltip is appended to
|
protected void |
setDataAttribute(Element e,
String attribute,
String value)
Adds an HTML data attribute to the widget's tag.
|
void |
setHideDelay(int delayInMilliseconds)
Sets the time to wait until the widget is hidden.
|
void |
setPlacement(Placement placement)
Sets the widget's placement.
|
void |
setShowDelay(int delayInMilliseconds)
Sets the time to wait until the widget is shown.
|
void |
setTrigger(Trigger trigger)
Sets the trigger that activates the widget.
|
void |
show()
Shows the widget if it was previously hidden.
|
void |
toggle()
Toggles the view state of the widget.
|
add, add, clear, getId, getWidget, iterator, remove, setId, setWidget, setWidget
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
add, clear, iterator, remove
getWidget, setWidget
setWidget
protected boolean animated
protected Placement placement
protected int showDelayInMilliseconds
protected int hideDelayInMilliseconds
public HoverBase()
public Widget asWidget()
asWidget
in interface IsWidget
asWidget
in class MarkupWidget
protected void removeDataIfExists()
protected abstract void removeDataIfExists(Element e, String dataName)
protected void setDataAttribute(Element e, String attribute, String value)
e
- target elementattribute
- the name of the attribute without leading "data-"
value
- the value to be storedpublic void setAnimation(boolean animated)
setAnimation
in interface IsAnimated
animated
- true
if the widget should be animated.public abstract void reconfigure()
public boolean getAnimation()
getAnimation
in interface IsAnimated
true
if the widget is animatedpublic void setPlacement(Placement placement)
setPlacement
in interface HasPlacement
placement
- the placementpublic Placement getPlacement()
getPlacement
in interface HasPlacement
public void setTrigger(Trigger trigger)
setTrigger
in interface HasTrigger
trigger
- the triggerpublic Trigger getTrigger()
getTrigger
in interface HasTrigger
public void setShowDelay(int delayInMilliseconds)
setShowDelay
in interface HasShowDelay
delayInMilliseconds
- the delay in millisecondspublic int getShowDelay()
getShowDelay
in interface HasShowDelay
public void setHideDelay(int delayInMilliseconds)
setHideDelay
in interface HasShowDelay
delayInMilliseconds
- the delay in millisecondspublic int getHideDelay()
getHideDelay
in interface HasShowDelay
public void show()
show
in interface HasVisibility
public void hide()
hide
in interface HasVisibility
public void toggle()
It will be hidden if it was previously shown and shown if it was previously hidden.
toggle
in interface HasVisibility
protected abstract void changeVisibility(VisibilityChange visibilityChange)
visibilityChange
- the action to be performedprotected abstract String getDataName()
public String getContainer()
public void setContainer(String container)
container
- Specific element the Popover/Tooltip is appended to. E.g. 'body' or null.Copyright © 2012-2014 gwtbootstrap. All Rights Reserved.