Class WScrollArea
public class WScrollArea extends WWebWidget
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
Nested Classes Modifier and Type Class Description static class
WScrollArea.ScrollBarPolicy
brief Policy for showing a scrollbar.Nested classes/interfaces inherited from class eu.webtoolkit.jwt.WObject
WObject.FormData
-
Constructor Summary
Constructors Constructor Description WScrollArea()
Creates a scroll area.WScrollArea(WContainerWidget parent)
Creates a scroll area. -
Method Summary
Modifier and Type Method Description 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, blurred, callJavaScriptMember, childrenChanged, createDomElement, doJavaScript, enableAjax, escapeText, escapeText, escapeText, escapeText, find, findById, focussed, getAttributeValue, getBaseZIndex, getChildren, getClearSides, getDecorationStyle, getDomChanges, getFloatSide, getHeight, getHtmlTagName, getId, getJavaScriptMember, getLineHeight, getMargin, getMaximumHeight, getMaximumWidth, getMinimumHeight, getMinimumWidth, getOffset, getPositionScheme, getScrollVisibilityMargin, getStyleClass, getTabIndex, getToolTip, getVerticalAlignment, getVerticalAlignmentLength, getWidth, hasFocus, hasStyleClass, isCanReceiveFocus, isDisabled, isEnabled, isHidden, isHiddenKeepsGeometry, isInline, isLoaded, isPopup, isRendered, isScrollVisibilityEnabled, isScrollVisible, isSetFirstFocus, isThemeStyleEnabled, isVisible, jsStringLiteral, jsStringLiteral, load, parentResized, parentResized, propagateSetEnabled, propagateSetVisible, refresh, removeScript, removeStyleClass, render, resize, scrollVisibilityChanged, setAttributeValue, setBaseZIndex, setCanReceiveFocus, setClearSides, setDecorationStyle, setDeferredToolTip, setDisabled, setFloatSide, setFocus, setHidden, setHiddenKeepsGeometry, setHtmlTagName, setId, setInline, setJavaScriptMember, setLineHeight, setLoadLaterWhenInvisible, setMargin, setMaximumSize, setMinimumSize, setOffsets, setPopup, setPositionScheme, setScrollVisibilityEnabled, setScrollVisibilityMargin, setSelectable, setStyleClass, setTabIndex, setThemeStyleEnabled, setToolTip, setVerticalAlignment, updateSignalConnection, voidEventSignal
Methods inherited from class eu.webtoolkit.jwt.WWidget
acceptDrops, acceptDrops, addCssRule, addCssRule, addJSignal, addStyleClass, animateHide, animateShow, boxBorder, boxPadding, createJavaScript, disable, dropEvent, enable, getDropTouch, getJsRef, getParent, hide, htmlText, isExposed, isLayoutSizeAware, layoutSizeChanged, needsRerender, positionAt, positionAt, removeChild, removeStyleClass, render, resize, scheduleRender, scheduleRender, scheduleRender, setClearSides, setDeferredToolTip, setFocus, setHeight, setHidden, setLayoutSizeAware, setMargin, setMargin, setMargin, setMargin, setMargin, setObjectName, setOffsets, setOffsets, setOffsets, setOffsets, setOffsets, setToolTip, setVerticalAlignment, setWidth, show, stopAcceptDrops, toggleStyleClass, toggleStyleClass, tr
Methods inherited from class eu.webtoolkit.jwt.WObject
addChild, getObjectName, setFormData
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
WScrollArea
Creates a scroll area. -
WScrollArea
public WScrollArea()Creates a scroll area.
-
-
Method Details
-
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 classWWebWidget
- See Also:
WContainerWidget.removeWidget(WWidget widget)
-
setWidget
Sets the widget that is the content of the scroll area.Setting a new widget will delete the previously set widget.
-
takeWidget
Removes the widget content. -
getWidget
Returns the widget content. -
getHorizontalScrollBar
Returns the horizontal scrollbar. -
getVerticalScrollBar
Returns the vertical scrollbar. -
setScrollBarPolicy
Sets the policy for both scrollbars. -
setHorizontalScrollBarPolicy
Sets the horizontal scroll bar policy. -
setVerticalScrollBarPolicy
Sets the vertical scroll bar policy. -
getHorizontalScrollBarPolicy
Returns the horizontal scroll bar policy. -
getVerticalScrollBarPolicy
Returns the vertical scroll bar policy.
-