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

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.google.gwt.user.client.ui.HTMLPanel
                      extended by com.github.gwtbootstrap.client.ui.base.HtmlWidget
                          extended by com.github.gwtbootstrap.client.ui.base.AlertBase
All Implemented Interfaces:
HasStyle, HasType<AlertType>, IsAnimated, IsResponsive, HasCloseHandlers, HasAttachHandlers, HasHandlers, EventListener, HasVisibility, HasWidgets, HasWidgets.ForIsWidget, IndexedPanel, IndexedPanel.ForIsWidget, IsWidget, Iterable<Widget>
Direct Known Subclasses:
Alert, AlertBlock

public abstract class AlertBase
extends HtmlWidget
implements IsAnimated, HasCloseHandlers, HasType<AlertType>

Base class for Alert widgets.

Since:
2.0.4.0
Author:
Dominik Mayer, Carlos Alexandro Becker
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.IndexedPanel
IndexedPanel.ForIsWidget
 
Nested classes/interfaces inherited from interface com.google.gwt.user.client.ui.HasWidgets
HasWidgets.ForIsWidget
 
Field Summary
 
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
 
Constructor Summary
AlertBase()
          Initializes an Alert with a close icon.
AlertBase(AlertType type)
          Initializes an Alert of given Type with a close icon.
AlertBase(String html)
          Initializes an Alert with a inner HTML.
AlertBase(String html, boolean hasClose)
          Initializes an Alert with an optional close icon.
 
Method Summary
 HandlerRegistration addClosedHandler(ClosedHandler handler)
          Adds a ClosedHandler to the widget.
 HandlerRegistration addCloseHandler(CloseHandler handler)
          Adds a CloseHandler to the widget.
 void clear()
          Delete the whole content of the Alert.
 void close()
          Close this alert.
 boolean getAnimation()
          Gets whether the widget is animated.
protected  HasWidgets getHeadingContainer()
          Gets heading's container widget
 String getHTML()
          
 String getText()
          
 boolean hasClose()
          has Close
protected  void onAttach()
          
protected  void onClose()
          This method is called immediately when the widget's close method is executed.
protected  void onClosed()
          This method is called once the widget is completely closed.
protected  void onLoad()
          
 void setAnimation(boolean animated)
          Sets whether the Alert should be animated.
 void setClose(boolean hasClose)
          Sets whether the Alert has a close icon or not.
 void setHeading(String text)
          Sets the text of an optional heading.
 void setHTML(String html)
           
 void setText(String text)
          
 void setType(AlertType type)
          Sets the type of the Alert.
 
Methods inherited from class com.github.gwtbootstrap.client.ui.base.HtmlWidget
addStyle, removeStyle, setHideOn, setShowOn, setStyle
 
Methods inherited from class com.google.gwt.user.client.ui.HTMLPanel
add, add, add, addAndReplaceElement, addAndReplaceElement, addAndReplaceElement, addAndReplaceElement, addAndReplaceElement, createUniqueId, getElementById, wrap
 
Methods inherited from class com.google.gwt.user.client.ui.ComplexPanel
add, adjustIndex, checkIndexBoundsForAccess, checkIndexBoundsForInsertion, getChildren, getWidget, getWidgetCount, getWidgetIndex, getWidgetIndex, insert, insert, iterator, remove, remove
 
Methods inherited from class com.google.gwt.user.client.ui.Panel
add, adopt, adopt, 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, 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
 

Constructor Detail

AlertBase

public AlertBase()
Initializes an Alert with a close icon.


AlertBase

public AlertBase(String html)
Initializes an Alert with a inner HTML.

Parameters:
html - inner HTML

AlertBase

public AlertBase(String html,
                 boolean hasClose)
Initializes an Alert with an optional close icon.

Parameters:
html - inner HTML
hasClose - whether the Alert should have a close icon.

AlertBase

public AlertBase(AlertType type)
Initializes an Alert of given Type with a close icon.

Parameters:
type - of the Alert
Method Detail

setClose

public void setClose(boolean hasClose)
Sets whether the Alert has a close icon or not.

Parameters:
hasClose - false if you don't want to have a close icon. Default: true

onAttach

protected void onAttach()

Overrides:
onAttach in class Widget

hasClose

public boolean hasClose()
has Close

Returns:
true:has close false:does not has close

getHeadingContainer

protected HasWidgets getHeadingContainer()
Gets heading's container widget

Returns:
heading's container

onClose

protected void onClose()
This method is called immediately when the widget's close method is executed.


onClosed

protected void onClosed()
This method is called once the widget is completely closed.


setType

public void setType(AlertType type)
Sets the type of the Alert.

Specified by:
setType in interface HasType<AlertType>
Parameters:
type -

setHeading

public void setHeading(String text)
Sets the text of an optional heading. The implementation depends on the subclass.

Parameters:
text - the new heading

setAnimation

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

Specified by:
setAnimation in interface IsAnimated
Parameters:
animated - true if the Alert should fade out. Default: false

getAnimation

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

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

clear

public void clear()
Delete the whole content of the Alert. This includes text, heading and close icon.

Specified by:
clear in interface HasWidgets
Overrides:
clear in class Panel

getText

public String getText()


setText

public void setText(String text)


getHTML

public String getHTML()


setHTML

public void setHTML(String html)

close

public void close()
Close this alert.


onLoad

protected void onLoad()

Overrides:
onLoad in class Widget

addCloseHandler

public HandlerRegistration addCloseHandler(CloseHandler handler)
Adds a CloseHandler to the widget.

Specified by:
addCloseHandler in interface HasCloseHandlers
Parameters:
handler - the handler
Returns:
HandlerRegistration used to remove this handler

addClosedHandler

public HandlerRegistration addClosedHandler(ClosedHandler handler)
Adds a ClosedHandler to the widget.

Specified by:
addClosedHandler in interface HasCloseHandlers
Parameters:
handler - the handler
Returns:
HandlerRegistration used to remove this handler


Copyright © 2012 gwtbootstrap. All Rights Reserved.