public class Scroll extends StyledComposite
Horizontal:
Vertical:
EMPTY_ELEMENT_ARRAY
Constructor and Description |
---|
Scroll()
Creates a horizontal scroll composite with a visible scrollbar.
|
Scroll(boolean horizontal,
boolean showScrollbar)
Creates a scroll composite specifying its orientation and the visibility of the scrollbar.
|
Modifier and Type | Method and Description |
---|---|
boolean |
handleEvent(int event) |
void |
hideNotify() |
void |
scrollTo(int position)
Scrolls to a position without animation.
|
void |
scrollTo(int position,
boolean animate)
Scrolls to a position.
|
protected void |
setBoundsContent(Rectangle bounds)
Sets the bounds of this widget by taking into account the border, margin and padding specified in the style.
|
void |
setHorizontal(boolean horizontal)
Sets the scroll orientation: horizontal or vertical.
|
void |
setWidget(ej.mwt.Widget content)
Sets the content to scroll.
|
void |
showNotify() |
void |
showScrollbar(boolean show)
Sets whether the scrollbar is visible or not.
|
Rectangle |
validateContent(Style style,
Rectangle bounds)
Gets the content size of the renderable without the border, margin and padding specified in the style.
|
add, addClassSelector, contains, gainFocus, getAttribute, getChild, getChildrenCount, getChildrenElements, getParentElement, getStyle, hasClassSelector, isInState, isTransparent, lostFocus, mergeStyle, removeAllClassSelectors, removeClassSelector, removeInstanceStyle, render, renderContent, setBounds, setClassSelectors, setEnabled, updateStyle, updateStyleOnly, validate
getFocus, getFocusIndex, getNext, getWidget, getWidgetAt, getWidgets, getWidgetsCount, iterator, remove, removeAllWidgets, requestFocus, requestFocus, requestFocusFrom
getAbsoluteX, getAbsoluteX, getAbsoluteY, getAbsoluteY, getEventHandler, getHeight, getPanel, getParent, getPreferredHeight, getPreferredWidth, getRelativeX, getRelativeY, getWidth, getX, getY, hasFocus, invalidate, isEnabled, isShown, isValid, isVisible, repaint, repaint, revalidate, revalidateSubTree, setEventHandler, setLocation, setPreferredSize, setSize, setVisible
public Scroll()
public Scroll(boolean horizontal, boolean showScrollbar)
horizontal
- true
to scroll horizontally, false
to scroll vertically.showScrollbar
- true
to show the scrollbar, false
otherwise.public void setWidget(ej.mwt.Widget content)
content
- the widget to scroll.public void setHorizontal(boolean horizontal)
horizontal
- true
to scroll horizontally, false
to scroll vertically.public void showScrollbar(boolean show)
show
- true
to show the scrollbar, false
to hide it.public Rectangle validateContent(Style style, Rectangle bounds)
StyledComposite
Lays out the children of this composite.
validateContent
in interface StyledRenderable
validateContent
in class StyledComposite
style
- the style to use.bounds
- the bounds available for the content. A width or a height equals to MWT.NONE
means no
constraint on this dimension.protected void setBoundsContent(Rectangle bounds)
StyledComposite
setBoundsContent
in class StyledComposite
bounds
- the bounds available for the content.public void showNotify()
showNotify
in interface ej.mwt.Renderable
showNotify
in class ej.mwt.Composite
public void hideNotify()
hideNotify
in interface ej.mwt.Renderable
hideNotify
in class ej.mwt.Composite
public void scrollTo(int position, boolean animate)
position
- the x or y target (depending on the orientation).animate
- whether the scrolling action should be animated.public void scrollTo(int position)
position
- the x or y target (depending on the orientation).public boolean handleEvent(int event)
handleEvent
in interface ej.mwt.Renderable
handleEvent
in class ej.mwt.Composite