GWT 2.7.0

com.google.gwt.user.client.ui
Class NativeHorizontalScrollbar

java.lang.Object
  extended by com.google.gwt.user.client.ui.UIObject
      extended by com.google.gwt.user.client.ui.Widget
          extended by com.google.gwt.user.client.ui.AbstractNativeScrollbar
              extended by com.google.gwt.user.client.ui.NativeHorizontalScrollbar
All Implemented Interfaces:
HasScrollHandlers, HasAttachHandlers, HasHandlers, EventListener, HasHorizontalScrolling, HasVisibility, HorizontalScrollbar, IsWidget

public class NativeHorizontalScrollbar
extends AbstractNativeScrollbar
implements HorizontalScrollbar

A horizontal scrollbar implemented using the browsers native scrollbar.


Nested Class Summary
(package private) static interface NativeHorizontalScrollbar.NativeHorizontalScrollbarUiBinder
           
static interface NativeHorizontalScrollbar.Resources
          A ClientBundle of resources used by this widget.
static interface NativeHorizontalScrollbar.ResourcesTransparant
          A variation of NativeHorizontalScrollbar.Resources that renders the scrollbar semi-transparent until it is hovered.
static interface NativeHorizontalScrollbar.Style
          Styles used by this widget.
static interface NativeHorizontalScrollbar.StyleTransparant
          A variation of NativeHorizontalScrollbar.Style that renders the scrollbar semi-transparent until it is hovered.
 
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled
 
Field Summary
(package private)  Element contentDiv
          The div inside the scrollable div that forces scrollbars to appear.
(package private)  Element scrollable
          The scrollable div used to create a scrollbar.
 
Fields inherited from class com.google.gwt.user.client.ui.Widget
eventsToSink
 
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX, MISSING_ELEMENT_ERROR, SETELEMENT_TWICE_ERROR
 
Constructor Summary
NativeHorizontalScrollbar()
          Construct a new NativeHorizontalScrollbar.
NativeHorizontalScrollbar(NativeHorizontalScrollbar.Resources resources)
          Construct a new NativeHorizontalScrollbar.
 
Method Summary
 int getHorizontalScrollPosition()
          Gets the horizontal scroll position.
 int getMaximumHorizontalScrollPosition()
          Get the maximum position of horizontal scrolling.
 int getMinimumHorizontalScrollPosition()
          Get the minimum position of horizontal scrolling.
protected  int getNativeHeight()
          Get the height of the scrollbar.
protected  Element getScrollableElement()
          Get the scrollable element.
 int getScrollWidth()
          Get the width in pixels of the scrollable content that the scrollbar controls.
 void setHorizontalScrollPosition(int position)
          Sets the horizontal scroll position.
 void setScrollWidth(int width)
          Set the width in pixels of the scrollable content that the scrollbar controls.
 
Methods inherited from class com.google.gwt.user.client.ui.AbstractNativeScrollbar
addScrollHandler, getNativeScrollbarHeight, getNativeScrollbarWidth, isScrollbarLeftAlignedInRtl, onAttach, onDetach
 
Methods inherited from class com.google.gwt.user.client.ui.Widget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, ensureHandlers, fireEvent, getHandlerCount, getHandlerManager, getLayoutData, getParent, isAttached, isOrWasAttached, onBrowserEvent, onLoad, onUnload, removeFromParent, replaceElement, setLayoutData, setParent, sinkEvents, unsinkEvents
 
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, resolvePotentialElement, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.google.gwt.event.dom.client.HasScrollHandlers
addScrollHandler
 
Methods inherited from interface com.google.gwt.event.shared.HasHandlers
fireEvent
 
Methods inherited from interface com.google.gwt.user.client.ui.IsWidget
asWidget
 

Field Detail

contentDiv

@UiField
Element contentDiv
The div inside the scrollable div that forces scrollbars to appear.


scrollable

@UiField
Element scrollable
The scrollable div used to create a scrollbar.

Constructor Detail

NativeHorizontalScrollbar

public NativeHorizontalScrollbar()
Construct a new NativeHorizontalScrollbar.


NativeHorizontalScrollbar

public NativeHorizontalScrollbar(NativeHorizontalScrollbar.Resources resources)
Construct a new NativeHorizontalScrollbar.

Parameters:
resources - the resources used by this widget
Method Detail

getHorizontalScrollPosition

public int getHorizontalScrollPosition()
Description copied from interface: HasHorizontalScrolling
Gets the horizontal scroll position.

Specified by:
getHorizontalScrollPosition in interface HasHorizontalScrolling
Returns:
the horizontal scroll position, in pixels

getMaximumHorizontalScrollPosition

public int getMaximumHorizontalScrollPosition()
Description copied from interface: HasHorizontalScrolling
Get the maximum position of horizontal scrolling. This is usually the scrollWidth - clientWidth.

Specified by:
getMaximumHorizontalScrollPosition in interface HasHorizontalScrolling
Returns:
the maximum horizontal scroll position

getMinimumHorizontalScrollPosition

public int getMinimumHorizontalScrollPosition()
Description copied from interface: HasHorizontalScrolling
Get the minimum position of horizontal scrolling.

Specified by:
getMinimumHorizontalScrollPosition in interface HasHorizontalScrolling
Returns:
the minimum horizontal scroll position

getScrollWidth

public int getScrollWidth()
Get the width in pixels of the scrollable content that the scrollbar controls.

This is not the same as the maximum scroll left position. The maximum scroll position equals the scrollWidth - offsetWidth;

Specified by:
getScrollWidth in interface HorizontalScrollbar
Returns:
the scroll width
See Also:
setScrollWidth(int)

setHorizontalScrollPosition

public void setHorizontalScrollPosition(int position)
Description copied from interface: HasHorizontalScrolling
Sets the horizontal scroll position.

Specified by:
setHorizontalScrollPosition in interface HasHorizontalScrolling
Parameters:
position - the new horizontal scroll position, in pixels

setScrollWidth

public void setScrollWidth(int width)
Set the width in pixels of the scrollable content that the scrollbar controls.

This is not the same as the maximum scroll left position. The maximum scroll position equals the scrollWidth - offsetWidth;

Specified by:
setScrollWidth in interface HorizontalScrollbar
Parameters:
width - the size width pixels

getNativeHeight

protected int getNativeHeight()
Get the height of the scrollbar.

Returns:
the height of the scrollbar in pixels

getScrollableElement

protected Element getScrollableElement()
Description copied from class: AbstractNativeScrollbar
Get the scrollable element.

Specified by:
getScrollableElement in class AbstractNativeScrollbar
Returns:
the scrollable element

GWT 2.7.0