com.github.gwtbootstrap.client.ui.base
Class HoverBase

java.lang.Object
  extended by com.google.gwt.user.client.ui.UIObject
      extended by com.google.gwt.user.client.ui.Widget
          extended by com.google.gwt.user.client.ui.Panel
              extended by com.google.gwt.user.client.ui.ComplexPanel
                  extended by com.github.gwtbootstrap.client.ui.base.ComplexWidget
                      extended by com.github.gwtbootstrap.client.ui.base.HoverBase
All Implemented Interfaces:
HasPlacement, HasShowDelay, HasStyle, HasTrigger, IsAnimated, IsResponsive, HasAttachHandlers, HasHandlers, EventListener, AcceptsOneWidget, HasOneWidget, HasText, HasVisibility, HasWidgets, HasWidgets.ForIsWidget, IndexedPanel, IndexedPanel.ForIsWidget, IsWidget, Iterable<Widget>
Direct Known Subclasses:
Popover, Tooltip

public abstract class HoverBase
extends ComplexWidget
implements HasWidgets, HasOneWidget, IsAnimated, HasTrigger, HasPlacement, HasText, HasShowDelay, HasVisibility

Base class for widgets that hover above other widgets.

Since:
2.0.4.0
Author:
Dominik Mayer
See Also:
Bootstrap documentation

Nested Class Summary
 
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled
 
Nested classes/interfaces inherited from interface com.google.gwt.user.client.ui.HasWidgets
HasWidgets.ForIsWidget
 
Nested classes/interfaces inherited from interface com.google.gwt.user.client.ui.IndexedPanel
IndexedPanel.ForIsWidget
 
Field Summary
protected  boolean animated
          Whether the widget is animated or not.
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.
 
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
 
Constructor Summary
HoverBase()
          Creates a new widget based on the provided HTML tag.
 
Method Summary
 void add(Widget w)
          Adds a widget to this panel.
protected abstract  void changeVisibility(VisibilityChange visibilityChange)
          Changes the visibility of the widget.
 boolean getAnimation()
          Gets whether the widget is animated.
protected  Element getContainerElement()
          Override this method to specify that an element other than the root element be the container for the panel's child widget.
protected  String getDataAttribute(String attribute)
          Returns the data stored in one of the widget's HTML data attributes.
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.
 Widget getWidget()
          Gets the panel's child widget.
 void hide()
          Hides the widget if it was previously shown.
 Iterator<Widget> iterator()
           
protected  void onLoad()
          
abstract  void reconfigure()
          Redraws the widget with the currently set options.
 boolean remove(Widget w)
           
protected  void removeDataIfExists()
           
protected  void removeDataIfExists(Element e, String dataName)
           
 void setAnimation(boolean animated)
          Sets whether the Widget should be animated.
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 setWidget(IsWidget w)
           
 void setWidget(Widget w)
          Sets this panel's widget.
 void show()
          Shows the widget if it was previously hidden.
 void toggle()
          Toggles the view state of the widget.
 
Methods inherited from class com.github.gwtbootstrap.client.ui.base.ComplexWidget
addStyle, insert, removeStyle, setHideOn, setShowOn, setStyle
 
Methods inherited from class com.google.gwt.user.client.ui.ComplexPanel
add, adjustIndex, checkIndexBoundsForAccess, checkIndexBoundsForInsertion, getChildren, getWidget, getWidgetCount, getWidgetIndex, getWidgetIndex, insert, insert, remove
 
Methods inherited from class com.google.gwt.user.client.ui.Panel
add, adopt, adopt, clear, disown, doAttachChildren, doDetachChildren, orphan, remove
 
Methods inherited from class com.google.gwt.user.client.ui.Widget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onAttach, onBrowserEvent, onDetach, onUnload, removeFromParent, setLayoutData, sinkEvents
 
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, resolvePotentialElement, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toString, unsinkEvents
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.google.gwt.user.client.ui.HasWidgets
clear
 
Methods inherited from interface com.google.gwt.user.client.ui.HasText
getText, setText
 

Field Detail

animated

protected boolean animated
Whether the widget is animated or not.


placement

protected Placement placement
The placement of the widget relative to its trigger element.


trigger

protected Trigger trigger
The action that triggers the widget.


showDelayInMilliseconds

protected int showDelayInMilliseconds
The delay until the widget is shown.


hideDelayInMilliseconds

protected int hideDelayInMilliseconds
The delay until the widget is hidden.

Constructor Detail

HoverBase

public HoverBase()
Creates a new widget based on the provided HTML tag.

Method Detail

onLoad

protected void onLoad()

Overrides:
onLoad in class Widget

removeDataIfExists

protected void removeDataIfExists()

removeDataIfExists

protected void removeDataIfExists(Element e,
                                  String dataName)

setDataAttribute

protected void setDataAttribute(Element e,
                                String attribute,
                                String value)
Adds an HTML data attribute to the widget's tag.

Parameters:
e - target element
attribute - the name of the attribute without leading "data-"
value - the value to be stored

getDataAttribute

protected String getDataAttribute(String attribute)
Returns the data stored in one of the widget's HTML data attributes.

Parameters:
attribute - the name of the attribute without leading "data-"
Returns:
the value stored in the tag

setAnimation

public void setAnimation(boolean animated)
Sets whether the Widget should be animated.

Specified by:
setAnimation in interface IsAnimated
Parameters:
animated - true if the widget should be animated.

reconfigure

public abstract void reconfigure()
Redraws the widget with the currently set options. This must not be called when a parameter is updated because it would deactivate all other parameters. No idea why...


getAnimation

public boolean getAnimation()
Gets whether the widget is animated.

Specified by:
getAnimation in interface IsAnimated
Returns:
true if the widget is animated

setPlacement

public void setPlacement(Placement placement)
Sets the widget's placement. Relative to its trigger element.

Specified by:
setPlacement in interface HasPlacement
Parameters:
placement - the placement

getPlacement

public Placement getPlacement()
Gets the widget's placement.

Specified by:
getPlacement in interface HasPlacement
Returns:
the widget's placement

setTrigger

public void setTrigger(Trigger trigger)
Sets the trigger that activates the widget.

Specified by:
setTrigger in interface HasTrigger
Parameters:
trigger - the trigger

getTrigger

public Trigger getTrigger()
Gets the widget's Trigger.

Specified by:
getTrigger in interface HasTrigger
Returns:
the trigger

setShowDelay

public void setShowDelay(int delayInMilliseconds)
Sets the time to wait until the widget is shown.

Specified by:
setShowDelay in interface HasShowDelay
Parameters:
delayInMilliseconds - the delay in milliseconds

getShowDelay

public int getShowDelay()
Gets the time to wait until the widget is shown.

Specified by:
getShowDelay in interface HasShowDelay
Returns:
the delay in milliseconds

setHideDelay

public void setHideDelay(int delayInMilliseconds)
Sets the time to wait until the widget is hidden.

Specified by:
setHideDelay in interface HasShowDelay
Parameters:
delayInMilliseconds - the delay in milliseconds

getHideDelay

public int getHideDelay()
Gets the time to wait until the widget is hidden.

Specified by:
getHideDelay in interface HasShowDelay
Returns:
the delay in milliseconds

show

public void show()
Shows the widget if it was previously hidden.


hide

public void hide()
Hides the widget if it was previously shown.


toggle

public void toggle()
Toggles the view state of the widget.

It will be hidden if it was previously shown and shown if it was previously hidden.


changeVisibility

protected abstract void changeVisibility(VisibilityChange visibilityChange)
Changes the visibility of the widget.

Parameters:
visibilityChange - the action to be performed

add

public void add(Widget w)
Adds a widget to this panel.

Specified by:
add in interface HasWidgets
Overrides:
add in class ComplexWidget
Parameters:
w - the child widget to be added

getWidget

public Widget getWidget()
Gets the panel's child widget.

Specified by:
getWidget in interface HasOneWidget
Returns:
the child widget, or null if none is present

iterator

public Iterator<Widget> iterator()
Specified by:
iterator in interface HasWidgets
Specified by:
iterator in interface Iterable<Widget>
Overrides:
iterator in class ComplexPanel

remove

public boolean remove(Widget w)
Specified by:
remove in interface HasWidgets
Overrides:
remove in class ComplexPanel

setWidget

public void setWidget(IsWidget w)
Specified by:
setWidget in interface AcceptsOneWidget

setWidget

public void setWidget(Widget w)
Sets this panel's widget. Any existing child widget will be removed.

Specified by:
setWidget in interface HasOneWidget
Parameters:
w - the panel's new widget, or null to clear the panel

getContainerElement

protected Element getContainerElement()
Override this method to specify that an element other than the root element be the container for the panel's child widget. This can be useful when you want to create a simple panel that decorates its contents. Note that this method continues to return the Element class defined in the User module to maintain backwards compatibility.

Returns:
the element to be used as the panel's container

getDataName

protected abstract String getDataName()
Get data name of JS Data API.

Returns:
data name


Copyright © 2012 gwtbootstrap. All Rights Reserved.