|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Scrollable
This interface is implemented by all visual objects that can be scrolled programmatically from the server-side, or for which it is possible to know the scroll position on the server-side. The unit of scrolling is pixel.
Method Summary | |
---|---|
int |
getScrollLeft()
Gets scroll left offset. |
int |
getScrollTop()
Gets scroll top offset. |
boolean |
isScrollable()
Is programmatic scrolling enabled. |
void |
setScrollable(boolean isScrollingEnabled)
Enables or disables programmatic scrolling. |
void |
setScrollLeft(int pixelsScrolled)
Sets scroll left offset. |
void |
setScrollTop(int pixelsScrolled)
Sets scroll top offset. |
Method Detail |
---|
int getScrollLeft()
Scrolling offset is the number of pixels this scrollable has been scrolled right.
void setScrollLeft(int pixelsScrolled)
Scrolling offset is the number of pixels this scrollable has been scrolled right.
The method only has effect if programmatic scrolling is enabled for the
scrollable. Some implementations may require enabling programmatic before
this method can be used. See setScrollable(boolean)
for more
information.
pixelsScrolled
- the xOffset.int getScrollTop()
Scrolling offset is the number of pixels this scrollable has been scrolled down.
void setScrollTop(int pixelsScrolled)
Scrolling offset is the number of pixels this scrollable has been scrolled down.
The method only has effect if programmatic scrolling is enabled for the
scrollable. Some implementations may require enabling programmatic before
this method can be used. See setScrollable(boolean)
for more
information.
The scrolling position is limited by the current height of the content area. If the position is below the height, it is scrolled to the bottom. However, if the same response also adds height to the content area, scrolling to bottom only scrolls to the bottom of the previous content area.
pixelsScrolled
- the yOffset.boolean isScrollable()
Whether programmatic scrolling with setScrollLeft(int)
and
setScrollTop(int)
is enabled.
true
if the scrolling is enabled, otherwise
false
.void setScrollable(boolean isScrollingEnabled)
Enables setting the scroll position with setScrollLeft(int)
and
setScrollTop(int)
. Implementations of the interface may have
programmatic scrolling disabled by default, in which case you need to
enable it to use the mentioned methods.
Notice that this does not control whether scroll bars are shown for a scrollable component. That normally happens automatically when the content grows too big for the component, relying on the "overflow: auto" property in CSS.
isScrollingEnabled
- true if the scrolling is allowed.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |