eu.webtoolkit.jwt
Class WScrollArea

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.WScrollArea

public class WScrollArea
extends WWebWidget

A widget that adds scrolling capabilities to its content.

Use a WScrollArea to add scrolling capabilities to another widget. When the content is bigger than the WScrollArea, scrollbars are added so that the user can still view the entire content.

Use setScrollBarPolicy() to configure if and when the scrollbars may appear.

In many cases, it might be easier to use the CSS overflow property on a WContainerWidget (see WContainerWidget#setOverflow()). However, this class will behave better when used inside a layout manager: in that case it will make sure horizontal scrolling works properly, since otherwise the layout manager would overflow rather than scrollbars appear.

CSS

This widget is rendered using a <div> with a CSS overflow attribute. When in a layout manager it is positioned absolutely. It can be styled using inline or external CSS as appropriate.


Nested Class Summary
static class WScrollArea.ScrollBarPolicy
           brief Policy for showing a scrollbar.
 
Constructor Summary
WScrollArea()
          Creates a scroll area.
WScrollArea(WContainerWidget parent)
          Creates a scroll area.
 
Method Summary
 WScrollBar getHorizontalScrollBar()
          Returns the horizontal scrollbar.
 WScrollArea.ScrollBarPolicy getHorizontalScrollBarPolicy()
          Returns the horizontal scroll bar policy.
 WScrollBar getVerticalScrollBar()
          Returns the vertical scrollbar.
 WScrollArea.ScrollBarPolicy getVerticalScrollBarPolicy()
          Returns the vertical scroll bar policy.
 WWidget getWidget()
          Returns the widget content.
 void remove()
          Destructor.
 void setHorizontalScrollBarPolicy(WScrollArea.ScrollBarPolicy policy)
          Sets the horizontal scroll bar policy.
 void setScrollBarPolicy(WScrollArea.ScrollBarPolicy policy)
          Sets the policy for both scrollbars.
 void setVerticalScrollBarPolicy(WScrollArea.ScrollBarPolicy policy)
          Sets the vertical scroll bar policy.
 void setWidget(WWidget widget)
          Sets the widget that is the content of the scroll area.
 WWidget takeWidget()
          Removes the widget content.
 
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, isEnabled, isHidden, isHiddenKeepsGeometry, isInline, isLoaded, isPopup, isRendered, isVisible, jsStringLiteral, jsStringLiteral, load, propagateSetEnabled, refresh, removeScript, removeStyleClass, 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
getObjectName, setObjectName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WScrollArea

public WScrollArea(WContainerWidget parent)
Creates a scroll area.


WScrollArea

public WScrollArea()
Creates a scroll area.

Calls this((WContainerWidget)null)

Method Detail

remove

public void remove()
Description copied from class: WWidget
Destructor.

Deletes a widget and all children (recursively). If the widget is contained in another widget, it is removed first.

Overrides:
remove in class WWebWidget
See Also:
WContainerWidget.removeWidget(WWidget widget)

setWidget

public void setWidget(WWidget widget)
Sets the widget that is the content of the scroll area.

Setting a new widget will delete the previously set widget.


takeWidget

public WWidget takeWidget()
Removes the widget content.


getWidget

public WWidget getWidget()
Returns the widget content.


getHorizontalScrollBar

public WScrollBar getHorizontalScrollBar()
Returns the horizontal scrollbar.


getVerticalScrollBar

public WScrollBar getVerticalScrollBar()
Returns the vertical scrollbar.


setScrollBarPolicy

public void setScrollBarPolicy(WScrollArea.ScrollBarPolicy policy)
Sets the policy for both scrollbars.

See Also:
setHorizontalScrollBarPolicy(WScrollArea.ScrollBarPolicy policy), setVerticalScrollBarPolicy(WScrollArea.ScrollBarPolicy policy)

setHorizontalScrollBarPolicy

public void setHorizontalScrollBarPolicy(WScrollArea.ScrollBarPolicy policy)
Sets the horizontal scroll bar policy.

See Also:
setScrollBarPolicy(WScrollArea.ScrollBarPolicy policy)

setVerticalScrollBarPolicy

public void setVerticalScrollBarPolicy(WScrollArea.ScrollBarPolicy policy)
Sets the vertical scroll bar policy.

See Also:
setScrollBarPolicy(WScrollArea.ScrollBarPolicy policy)

getHorizontalScrollBarPolicy

public WScrollArea.ScrollBarPolicy getHorizontalScrollBarPolicy()
Returns the horizontal scroll bar policy.

See Also:
setHorizontalScrollBarPolicy(WScrollArea.ScrollBarPolicy policy)

getVerticalScrollBarPolicy

public WScrollArea.ScrollBarPolicy getVerticalScrollBarPolicy()
Returns the vertical scroll bar policy.

See Also:
setVerticalScrollBarPolicy(WScrollArea.ScrollBarPolicy policy)