eu.webtoolkit.jwt
Class WOverlayLoadingIndicator

java.lang.Object
  extended by eu.webtoolkit.jwt.WObject
      extended by eu.webtoolkit.jwt.WWidget
          extended by eu.webtoolkit.jwt.WWebWidget
              extended by eu.webtoolkit.jwt.WInteractWidget
                  extended by eu.webtoolkit.jwt.WContainerWidget
                      extended by eu.webtoolkit.jwt.WOverlayLoadingIndicator
All Implemented Interfaces:
WLoadingIndicator

public class WOverlayLoadingIndicator
extends WContainerWidget
implements WLoadingIndicator

A more obvious loading indicator that grays the window.

This loading indicator uses a gray semi-transparent overlay to darken the window contents, and centers a loading icon (with some text).

Usage example:

The overlay loading indicator

The overlay loading indicator

Note: For this loading indicator to render properly in IE, you need to reset the "body" margin to 0. Using the inline stylesheet, this could be done using:

CSS

This widget does not provide styling, and can be styled using inline or external CSS as appropriate.

i18n

The strings used in this class can be translated by overriding the default values for the following localization keys:

See Also:
WApplication.setLoadingIndicator(WLoadingIndicator indicator)

Nested Class Summary
 
Nested classes/interfaces inherited from class eu.webtoolkit.jwt.WContainerWidget
WContainerWidget.Overflow
 
Constructor Summary
WOverlayLoadingIndicator()
          Construct the loading indicator.
WOverlayLoadingIndicator(java.lang.String styleClass)
          Construct the loading indicator.
WOverlayLoadingIndicator(java.lang.String styleClass, java.lang.String backgroundStyleClass)
          Construct the loading indicator.
WOverlayLoadingIndicator(java.lang.String styleClass, java.lang.String backgroundStyleClass, java.lang.String textStyleClass)
          Construct the loading indicator.
 
Method Summary
 WWidget getWidget()
          Returns the widget that visually represents the indicator.
 void setMessage(java.lang.CharSequence text)
          Sets the message that you want to be displayed.
 
Methods inherited from class eu.webtoolkit.jwt.WContainerWidget
addWidget, clear, getContentAlignment, getCount, getIndexOf, getLayout, getPadding, getWidget, insertBefore, insertWidget, isList, isOrderedList, isUnorderedList, remove, removeWidget, scrolled, setContentAlignment, setContentAlignment, setLayout, setLayout, setLayout, setList, setList, setOverflow, setOverflow, setOverflow, setPadding, setPadding, setPadding
 
Methods inherited from class eu.webtoolkit.jwt.WInteractWidget
clicked, doubleClicked, enterPressed, escapePressed, gestureChanged, gestureEnded, gestureStarted, isEnabled, keyPressed, keyWentDown, keyWentUp, load, mouseDragged, mouseMoved, mouseWentDown, mouseWentOut, mouseWentOver, mouseWentUp, mouseWheel, propagateSetEnabled, setDraggable, setDraggable, setDraggable, setDraggable, touchEnded, touchMoved, touchStarted
 
Methods inherited from class eu.webtoolkit.jwt.WWebWidget
addStyleClass, callJavaScriptMember, childrenChanged, doJavaScript, domCanBeSaved, enableAjax, escapeText, escapeText, escapeText, escapeText, find, getAttributeValue, getChildren, getClearSides, getDecorationStyle, getFloatSide, getHeight, getId, getJavaScriptMember, getLineHeight, getMargin, getMaximumHeight, getMaximumWidth, getMinimumHeight, getMinimumWidth, getOffset, getPositionScheme, getStyleClass, getTabIndex, getToolTip, getVerticalAlignment, getVerticalAlignmentLength, getWidth, isDisabled, isHidden, isHiddenKeepsGeometry, isInline, isLoaded, isPopup, isRendered, isVisible, jsStringLiteral, jsStringLiteral, refresh, removeScript, removeStyleClass, render, resize, setAttributeValue, setClearSides, setDecorationStyle, setDisabled, setFloatSide, setHidden, setHiddenKeepsGeometry, setId, setInline, setJavaScriptMember, setLineHeight, setLoadLaterWhenInvisible, setMargin, setMaximumSize, setMinimumSize, setOffsets, setPopup, setPositionScheme, setSelectable, setStyleClass, setTabIndex, setToolTip, setVerticalAlignment, updateSignalConnection
 
Methods inherited from class eu.webtoolkit.jwt.WWidget
acceptDrops, acceptDrops, addCssRule, addCssRule, addStyleClass, animateHide, animateShow, boxBorder, boxPadding, containsExposed, disable, dropEvent, enable, getDrop, getJsRef, getParent, hide, htmlText, isLayoutSizeAware, layoutSizeChanged, positionAt, positionAt, removeStyleClass, resize, setClearSides, setHeight, setHidden, setLayoutSizeAware, setMargin, setMargin, setMargin, setMargin, setMargin, setOffsets, setOffsets, setOffsets, setOffsets, setOffsets, setToolTip, setVerticalAlignment, setWidth, show, stopAcceptDrops, toggleStyleClass, toggleStyleClass, tr
 
Methods inherited from class eu.webtoolkit.jwt.WObject
addChild, getObjectName, setObjectName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WOverlayLoadingIndicator

public WOverlayLoadingIndicator(java.lang.String styleClass,
                                java.lang.String backgroundStyleClass,
                                java.lang.String textStyleClass)
Construct the loading indicator.

Parameters:
styleClass - the style class for the central box }
backgroundStyleClass - the style class for the "background" part of the indicator }
textStyleClass - the style class for the text that is displayed}

Note: if styleClass is not set, the central box gets the CSS style elements

 background: white;
                border: 3px solid #333333;
                z-index: 10001; visibility: visible;
                position: absolute; left: 50%; top: 50%;
                margin-left: -50px; margin-top: -40px;
                width: 100px; height: 80px;
                font-family: arial,sans-serif;
                text-align: center
   
 

if backgroundStyleClass is not set, the background gets the CSS style elements

 background: #DDDDDD;
                height: 100%; width: 100%;
                top: 0px; left: 0px;
                z-index: 10000;
                -moz-background-clip: -moz-initial;
                -moz-background-origin: -moz-initial;
                -moz-background-inline-policy: -moz-initial;
                opacity: 0.5; filter: alpha(opacity=50); -moz-opacity:0.5;
                position: absolute;
   
 


WOverlayLoadingIndicator

public WOverlayLoadingIndicator()
Construct the loading indicator.

Calls this("", "", "")


WOverlayLoadingIndicator

public WOverlayLoadingIndicator(java.lang.String styleClass)
Construct the loading indicator.

Calls this(styleClass, "", "")


WOverlayLoadingIndicator

public WOverlayLoadingIndicator(java.lang.String styleClass,
                                java.lang.String backgroundStyleClass)
Construct the loading indicator.

Calls this(styleClass, backgroundStyleClass, "")

Method Detail

getWidget

public WWidget getWidget()
Description copied from interface: WLoadingIndicator
Returns the widget that visually represents the indicator.

You should reimplement this method to return a widget that will be shown to indicate that a response is pending. The widget should be positioned using CSS.

The widget will be shown and hidden using WWidget#show() and WWidget#hide(). If you want to customize this behaviour, you should reimplement the WWidget#setHidden() method. Note that show() and hide() are stateless slots, and thus you need to make sure that your implementation comforms to that contract, so that it may be optimized to JavaScript (the server-side implementation will only be called during stateless slot prelearning).

Note: The widget will not be added to the WApplication#getRoot() container.

Specified by:
getWidget in interface WLoadingIndicator

setMessage

public void setMessage(java.lang.CharSequence text)
Description copied from interface: WLoadingIndicator
Sets the message that you want to be displayed.

If the indicator is capable of displaying a text message, then you should reimplement this method to allow this message to be modified.

Specified by:
setMessage in interface WLoadingIndicator