Class CustomScrollPanel

    • Constructor Detail

      • CustomScrollPanel

        public CustomScrollPanel​(Widget child)
        Creates a CustomScrollPanel with the specified child widget.
        Parameters:
        child - the widget to be wrapped by the scroll panel
    • Method Detail

      • getHorizontalScrollbar

        public HorizontalScrollbar getHorizontalScrollbar()
        Get the scrollbar used for horizontal scrolling.
        Returns:
        the horizontal scrollbar, or null if none specified
      • getVerticalScrollbar

        public VerticalScrollbar getVerticalScrollbar()
        Get the scrollbar used for vertical scrolling.
        Returns:
        the vertical scrollbar, or null if none specified
      • remove

        public boolean remove​(Widget w)
        Description copied from class: Panel
        Removes a child widget.

        How to Override this Method

        There are several important things that must take place in the correct order to properly remove a Widget from a Panel. Not all of these steps will be relevant to every Panel, but all of the steps must be considered.

        1. Validate: Make sure this Panel is actually the parent of the child Widget; return false if it is not.
        2. Orphan: Call Panel.orphan(Widget) first while the child Widget is still attached.
        3. Physical Detach: Adjust the DOM to account for the removal of the child Widget. The Widget's Element must be physically removed from the DOM.
        4. Logical Detach: Update the Panel's state variables to reflect the removal of the child Widget. Example: the Widget is removed from the Panel's WidgetCollection.

        Specified by:
        remove in interface HasWidgets
        Overrides:
        remove in class SimplePanel
        Parameters:
        w - the widget to be removed
        Returns:
        true if the child was present
      • removeHorizontalScrollbar

        public void removeHorizontalScrollbar()
        Remove the HorizontalScrollbar, if one exists.
      • removeVerticalScrollbar

        public void removeVerticalScrollbar()
        Remove the VerticalScrollbar, if one exists.
      • setAlwaysShowScrollBars

        public void setAlwaysShowScrollBars​(boolean alwaysShow)
        Description copied from class: ScrollPanel
        Sets whether this panel always shows its scroll bars, or only when necessary.
        Overrides:
        setAlwaysShowScrollBars in class ScrollPanel
        Parameters:
        alwaysShow - true to show scroll bars at all times
      • setHorizontalScrollbar

        public void setHorizontalScrollbar​(HorizontalScrollbar scrollbar,
                                           int height)
        Set the scrollbar used for horizontal scrolling.
        Parameters:
        scrollbar - the scrollbar, or null to clear it
        height - the height of the scrollbar in pixels
      • setVerticalScrollbar

        public void setVerticalScrollbar​(VerticalScrollbar scrollbar,
                                         int width)
        Set the scrollbar used for vertical scrolling.
        Parameters:
        scrollbar - the scrollbar, or null to clear it
        width - the width of the scrollbar in pixels
      • setWidget

        public void setWidget​(Widget w)
        Description copied from class: SimplePanel
        Sets this panel's widget. Any existing child widget will be removed.
        Specified by:
        setWidget in interface HasOneWidget
        Overrides:
        setWidget in class SimplePanel
        Parameters:
        w - the panel's new widget, or null to clear the panel
      • doAttachChildren

        protected void doAttachChildren()
        Description copied from class: Widget
        If a widget contains one or more child widgets that are not in the logical widget hierarchy (the child is physically connected only on the DOM level), it must override this method and call Widget.onAttach() for each of its child widgets.
        Overrides:
        doAttachChildren in class Panel
        See Also:
        Widget.onAttach()
      • doDetachChildren

        protected void doDetachChildren()
        Description copied from class: Widget
        If a widget contains one or more child widgets that are not in the logical widget hierarchy (the child is physically connected only on the DOM level), it must override this method and call Widget.onDetach() for each of its child widgets.
        Overrides:
        doDetachChildren in class Panel
        See Also:
        Widget.onDetach()
      • onLoad

        protected void onLoad()
        Description copied from class: Widget
        This method is called immediately after a widget becomes attached to the browser's document.
        Overrides:
        onLoad in class Widget