Class AbstractNativeScrollbar
- java.lang.Object
-
- com.google.gwt.user.client.ui.UIObject
-
- com.google.gwt.user.client.ui.Widget
-
- com.google.gwt.user.client.ui.AbstractNativeScrollbar
-
- All Implemented Interfaces:
HasScrollHandlers,HasAttachHandlers,HasHandlers,EventListener,HasVisibility,IsWidget
- Direct Known Subclasses:
NativeHorizontalScrollbar,NativeVerticalScrollbar
public abstract class AbstractNativeScrollbar extends Widget implements HasScrollHandlers
Abstract parent class for scrollbars implemented using the native browser scrollbars.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled
-
-
Field Summary
-
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
Constructors Constructor Description AbstractNativeScrollbar()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description HandlerRegistrationaddScrollHandler(ScrollHandler handler)Adds aScrollEventhandler.static intgetNativeScrollbarHeight()Get the height of a native horizontal scrollbar.static intgetNativeScrollbarWidth()Get the width of a native vertical scrollbar.protected abstract ElementgetScrollableElement()Get the scrollable element.static booleanisScrollbarLeftAlignedInRtl()Check whether or not the native vertical scrollbar is aligned on the left side of the scrollable element in RTL mode.protected voidonAttach()This method is called when a widget is attached to the browser's document.protected voidonDetach()This method is called when a widget is detached from the browser's document.-
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.shared.HasHandlers
fireEvent
-
-
-
-
Method Detail
-
getNativeScrollbarHeight
public static int getNativeScrollbarHeight()
Get the height of a native horizontal scrollbar.This method assumes that all native scrollbars on the page have the same height.
- Returns:
- the height in pixels
-
getNativeScrollbarWidth
public static int getNativeScrollbarWidth()
Get the width of a native vertical scrollbar.This method assumes that all native vertical scrollbars on the page have the same width.
- Returns:
- the height in pixels
-
isScrollbarLeftAlignedInRtl
public static boolean isScrollbarLeftAlignedInRtl()
Check whether or not the native vertical scrollbar is aligned on the left side of the scrollable element in RTL mode.- Returns:
- true if left aligned, false if not
-
addScrollHandler
public HandlerRegistration addScrollHandler(ScrollHandler handler)
Description copied from interface:HasScrollHandlersAdds aScrollEventhandler.- Specified by:
addScrollHandlerin interfaceHasScrollHandlers- Parameters:
handler- the scroll handler- Returns:
HandlerRegistrationused to remove this handler
-
getScrollableElement
protected abstract Element getScrollableElement()
Get the scrollable element.- Returns:
- the scrollable element
-
onAttach
protected void onAttach()
Description copied from class:WidgetThis method is called when a widget is attached to the browser's document. To receive notification after a Widget has been added to the document, override the
Widget.onLoad()method or useWidget.addAttachHandler(com.google.gwt.event.logical.shared.AttachEvent.Handler).It is strongly recommended that you override
Widget.onLoad()orWidget.doAttachChildren()instead of this method to avoid inconsistencies between logical and physical attachment states.Subclasses that override this method must call
super.onAttach()to ensure that the Widget has been attached to its underlying Element.- Overrides:
onAttachin classWidget- See Also:
Widget.onLoad(),Widget.doAttachChildren()
-
onDetach
protected void onDetach()
Description copied from class:WidgetThis method is called when a widget is detached from the browser's document. To receive notification before a Widget is removed from the document, override the
Widget.onUnload()method or useWidget.addAttachHandler(com.google.gwt.event.logical.shared.AttachEvent.Handler).It is strongly recommended that you override
Widget.onUnload()orWidget.doDetachChildren()instead of this method to avoid inconsistencies between logical and physical attachment states.Subclasses that override this method must call
super.onDetach()to ensure that the Widget has been detached from the underlying Element. Failure to do so will result in application memory leaks due to circular references between DOM Elements and JavaScript objects.- Overrides:
onDetachin classWidget- See Also:
Widget.onUnload(),Widget.doDetachChildren()
-
-