Package swingtree
Class UIForAnyScrollPane<I,P extends JScrollPane>
java.lang.Object
swingtree.UIForAnything<I,P,JComponent>
swingtree.UIForAnySwing<I,P>
swingtree.UIForAnyScrollPane<I,P>
- Type Parameters:
I
- The concrete type of the builder instance, which is important as a return type for the builder methods.P
- The type of the scroll pane or any subclass ofJScrollPane
.
- Direct Known Subclasses:
UIForScrollPane
,UIForScrollPanels
Defines an abstract builder for
constructing a scroll pane or any subclass of
JScrollPane
.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
_addComponentTo
(P thisComponent, JComponent addedComponent, @Nullable AddConstraint constraints) This builder class expects its implementations to be builder types for anything which can be built in a nested tree-like structure.final I
withBlockScrollIncrement
(int increment) Use this to set both the vertical and horizontal scroll block increment.final I
withHorizontalBlockScrollIncrement
(int increment) Use this to set the horizontal scroll bar block increment, which typically controls how far the content moves to the left or right when you: press the page up or page down keys (not to be confused with the arrow keys) click on a scroll bar track (the empty area of the scrollbar, not the thumb or arrows)
Please be aware that look and feel implementations that provide custom scrolling behavior may ignore the block increment value.final I
withHorizontalScrollBarPolicy
(sprouts.Val<UI.Active> scrollBarPolicy) Use this to dynamically set the scroll bars policy for the horizontal scroll bar.final I
withHorizontalScrollBarPolicy
(UI.Active scrollBarPolicy) Use this to set the scroll bars policy for the horizontal scroll bar.final I
withHorizontalScrollIncrement
(int increment) Use this to set the horizontal scroll increment unit, which typically controls how far the content moves when you: press the left and right arrow buttons on the scrollbar press the left and right arrow buttons on the keyboard use the mouse wheel or scroll gesture on a touchpad
This can be thought of as the smallest step size for scrolling.final I
withScrollBarPolicy
(UI.Active scrollPolicy) Use this to set the scroll bars policy for both horizontal and vertical scroll bars.
The scroll policy can be one of the following:UI.Active.NEVER
: The scrolls bar will never be displayed.UI.Active.ALWAYS
: The scrolls bar will always be displayed.UI.Active.AS_NEEDED
: The two scroll bars will only be displayed when needed, i.e.final I
withScrollIncrement
(int increment) Use this to set the vertical and horizontal scroll increment, which controls how far the content moves when you: press the arrow buttons on the scrollbars press the arrow buttons on the keyboard use the mouse wheel or scroll gesture on a touchpad
This can be thought of as the smallest step size for scrolling.final I
withVerticalBlockScrollIncrement
(int increment) Use this to set the vertical scroll bar block increment, which typically controls how far the content moves when you: press the page up or page down keys (not to be confused with the arrow keys) click on a scroll bar track (the empty area of the scrollbar, not the thumb or arrows) It represents a larger jump, like moving an entire "page" or a significant chunk of content.final I
withVerticalScrollBarPolicy
(sprouts.Val<UI.Active> scrollBarPolicy) Use this to dynamically set the scroll bars policy for the vertical scroll bar.final I
withVerticalScrollBarPolicy
(UI.Active scrollBarPolicy) Use this to set the scroll bars policy for the vertical scroll bar, which controls when the vertical scroll bar should be displayed or not.
The scroll policy can be one of the following:UI.Active.NEVER
: The vertical scroll bar will never be displayed.UI.Active.ALWAYS
: The vertical scroll bar will always be displayed.UI.Active.AS_NEEDED
: The vertical scroll bar will only be displayed when needed, i.e.final I
withVerticalScrollIncrement
(int increment) Use this to set the vertical scroll increment unit, which controls how far the content moves when you use the mouse wheel, scroll gesture on a touchpad or press the arrow buttons on the scrollbar.Methods inherited from class swingtree.UIForAnySwing
_addViewableProps, _addViewableProps, _isUndefinedColor, _isUndefinedFont, _setBackground, _setEnabled, _setMinHeight, _setMinWidth, _setPrefWidth, add, add, add, add, add, add, add, add, add, add, addAll, addAll, addAll, addAll, addAll, addAll, doUpdates, group, group, id, id, isEnabledIf, isEnabledIf, isEnabledIf, isEnabledIfNot, isEnabledIfNot, isEnabledIfNot, isFocusableIf, isFocusableIf, isFocusableIf, isFocusableIfNot, isFocusableIfNot, isFocusableIfNot, isValidIf, isVisibleIf, isVisibleIf, isVisibleIf, isVisibleIfNot, isVisibleIfNot, isVisibleIfNot, makeFocused, makeNonOpaque, makeOpaque, on, on, onCharTyped, onFocusGain, onFocusLoss, onHidden, onKeyPress, onKeyRelease, onKeyTyped, onMouseClick, onMouseDrag, onMouseEnter, onMouseEnter, onMouseEnterGreedy, onMouseExit, onMouseExit, onMouseExitGreedy, onMouseMove, onMousePress, onMouseRelease, onMouseWheelDown, onMouseWheelMove, onMouseWheelUp, onMoved, onPressed, onRelease, onResize, onShown, onTyped, onTyped, onView, withBackground, withBackground, withBackgroundColor, withBackgroundIf, withBackgroundIf, withBackgroundIf, withBackgroundIf, withBorder, withBorder, withBorderTitled, withBorderTitled, withBoxLayout, withCompoundBorder, withCompoundBorderTitled, withCursor, withCursor, withCursorIf, withCursorIf, withDragAway, withDropSite, withEmptyBorder, withEmptyBorder, withEmptyBorder, withEmptyBorder, withEmptyBorderTitled, withEmptyBorderTitled, withEmptyBorderTitled, withEmptyBorderTitled, withEmptyBorderTitled, withEmptyBorderTitled, withEmptyBorderTitled, withEmptyBorderTitled, withFlowLayout, withFlowLayout, withFlowLayout, withForeground, withForeground, withForegroundColor, withForegroundIf, withForegroundIf, withForegroundIf, withForegroundIf, withGridBagLayout, withGridLayout, withGridLayout, withGridLayout, withHeight, withHeight, withHeightExactly, withHeightExactly, withLayout, withLayout, withLayout, withLayout, withLayout, withLayout, withLayout, withLayout, withLayout, withLayout, withLayout, withLayout, withLineBorder, withLineBorder, withLineBorder, withLineBorderTitled, withLineBorderTitled, withLineBorderTitled, withLineBorderTitled, withMatteBorder, withMatteBorder, withMatteBorder, withMatteBorderTitled, withMatteBorderTitled, withMatteBorderTitled, withMaxHeight, withMaxHeight, withMaxSize, withMaxSize, withMaxSize, withMaxSize, withMaxSize, withMaxWidth, withMaxWidth, withMinHeight, withMinHeight, withMinSize, withMinSize, withMinSize, withMinSize, withMinSize, withMinWidth, withMinWidth, withPrefHeight, withPrefHeight, withPrefSize, withPrefSize, withPrefSize, withPrefSize, withPrefSize, withPrefWidth, withPrefWidth, withProperty, withRepaintOn, withRepaintOn, withRepaintOn, withRepaintOn, withRepaintOn, withRepaintOn, withRoundedLineBorder, withRoundedLineBorder, withRoundedLineBorder, withRoundedLineBorder, withRoundedLineBorderTitled, withRoundedLineBorderTitled, withRoundedLineBorderTitled, withRoundedLineBorderTitled, withRoundedLineBorderTitled, withRoundedLineBorderTitled, withRoundedLineBorderTitled, withSize, withSize, withSize, withSize, withSizeExactly, withSizeExactly, withSizeExactly, withSizeExactly, withStyle, withTooltip, withTooltip, withTransitionalStyle, withTransitoryStyle, withWidth, withWidth, withWidthExactly, withWidthExactly
Methods inherited from class swingtree.UIForAnything
_addBuildersTo, _addBuilderTo, _addComponentsTo, _disposeState, _newBuilderWithState, _onShow, _onShow, _runInApp, _runInApp, _runInUI, _state, _this, _with, _withOnShow, _withOnShow, add, add, add, add, apply, applyIf, applyIfPresent, component, equals, get, getComponent, getType, hashCode, peek, toString
-
Constructor Details
-
UIForAnyScrollPane
public UIForAnyScrollPane()
-
-
Method Details
-
_addComponentTo
protected void _addComponentTo(P thisComponent, JComponent addedComponent, @Nullable AddConstraint constraints) Description copied from class:UIForAnything
This builder class expects its implementations to be builder types for anything which can be built in a nested tree-like structure. Implementations of this abstract method ought to enable support for nested building.- Overrides:
_addComponentTo
in classUIForAnySwing<I,
P extends JScrollPane> - Parameters:
thisComponent
- The component which is wrapped by this builder.addedComponent
- A component instance which ought to be added to the wrapped component type.constraints
- The layout constraint which ought to be used to add the component to the wrapped component type.
-
withScrollBarPolicy
Use this to set the scroll bars policy for both horizontal and vertical scroll bars.
The scroll policy can be one of the following:UI.Active.NEVER
: The scrolls bar will never be displayed.UI.Active.ALWAYS
: The scrolls bar will always be displayed.UI.Active.AS_NEEDED
: The two scroll bars will only be displayed when needed, i.e. when the content is too large to fit in the viewport and scrolling is required.
- Parameters:
scrollPolicy
- The scroll policy to use.- Returns:
- The next builder instance, to allow for method chaining.
- Throws:
NullPointerException
- If the argument is null.
-
withVerticalScrollBarPolicy
Use this to set the scroll bars policy for the vertical scroll bar, which controls when the vertical scroll bar should be displayed or not.
The scroll policy can be one of the following:UI.Active.NEVER
: The vertical scroll bar will never be displayed.UI.Active.ALWAYS
: The vertical scroll bar will always be displayed.UI.Active.AS_NEEDED
: The vertical scroll bar will only be displayed when needed, i.e. when the content is too large to fit in the viewport and scrolling is required.
- Parameters:
scrollBarPolicy
- The scroll policy to determine when the vertical scroll bar should be displayed.- Returns:
- This builder node, to allow for method chaining.
- Throws:
NullPointerException
- If the argument is null.
-
withVerticalScrollBarPolicy
Use this to dynamically set the scroll bars policy for the vertical scroll bar. When the property changes, the scroll bar policy will be updated accordingly.The scroll policy can be one of the following:
UI.Active.NEVER
: The vertical scroll bar will never be displayed.UI.Active.ALWAYS
: The vertical scroll bar will always be displayed.UI.Active.AS_NEEDED
: The vertical scroll bar will only be displayed when needed, i.e. when the content is too large to fit in the viewport and scrolling is required.
- Parameters:
scrollBarPolicy
- The scroll policy property, whose value will determine when the vertical scroll bar should be displayed.- Returns:
- This builder instance, to allow for method chaining.
-
withHorizontalScrollBarPolicy
Use this to set the scroll bars policy for the horizontal scroll bar. The scroll policy can be one of the following:UI.Active.NEVER
: The horizontal scroll bar will never be displayed.UI.Active.ALWAYS
: The horizontal scroll bar will always be displayed.UI.Active.AS_NEEDED
: The horizontal scroll bar will only be displayed when needed, i.e. when the content is too large to fit in the viewport and scrolling is required.
- Parameters:
scrollBarPolicy
- The scroll policy to use.- Returns:
- The next builder instance, to allow for method chaining.
- Throws:
NullPointerException
- If the argument is null.
-
withHorizontalScrollBarPolicy
Use this to dynamically set the scroll bars policy for the horizontal scroll bar. When the property changes, the scroll bar policy will be updated accordingly.The scroll policy can be one of the following:
UI.Active.NEVER
: The horizontal scroll bar will never be displayed.UI.Active.ALWAYS
: The horizontal scroll bar will always be displayed.UI.Active.AS_NEEDED
: The horizontal scroll bar will only be displayed when needed, i.e. when the content is too large to fit in the viewport and scrolling is required.
- Parameters:
scrollBarPolicy
- The scroll policy property, whose value will determine when the horizontal scroll bar should be displayed.- Returns:
- The next builder instance, to allow for method chaining.
- Throws:
NullPointerException
- If the argument is null.
-
withVerticalScrollIncrement
Use this to set the vertical scroll increment unit, which controls how far the content moves when you use the mouse wheel, scroll gesture on a touchpad or press the arrow buttons on the scrollbar. This can be thought of as the smallest step size for scrolling. Like for example, scrolling by one line of text at a time in a text area.- Parameters:
increment
- The scroll vertical increment to use.- Returns:
- This builder instance, to allow for method chaining.
-
withHorizontalScrollIncrement
Use this to set the horizontal scroll increment unit, which typically controls how far the content moves when you:- press the left and right arrow buttons on the scrollbar
- press the left and right arrow buttons on the keyboard
- use the mouse wheel or scroll gesture on a touchpad
This can be thought of as the smallest step size for scrolling. Like for example, scrolling by one line of text at a time in a text area.- Parameters:
increment
- The scroll horizontal increment to use.- Returns:
- This builder instance, to allow for method chaining.
-
withScrollIncrement
Use this to set the vertical and horizontal scroll increment, which controls how far the content moves when you:- press the arrow buttons on the scrollbars
- press the arrow buttons on the keyboard
- use the mouse wheel or scroll gesture on a touchpad
This can be thought of as the smallest step size for scrolling. Like for example, scrolling by one line of text at a time in a text area.- Parameters:
increment
- The scroll increment to use.- Returns:
- This builder instance, to allow for method chaining.
- See Also:
-
withVerticalBlockScrollIncrement
Use this to set the vertical scroll bar block increment, which typically controls how far the content moves when you:- press the page up or page down keys (not to be confused with the arrow keys)
- click on a scroll bar track (the empty area of the scrollbar, not the thumb or arrows)
Note, that if the argument is equal to the value of Integer.MIN_VALUE, then most look and feel implementations will not provide scrolling to the right/down.
Please be aware that look and feel implementations that provide custom scrolling behavior may ignore the block increment value.- Parameters:
increment
- The scroll vertical block increment to use when scrolling by a "block".- Returns:
- This builder instance, to allow for method chaining.
-
withHorizontalBlockScrollIncrement
Use this to set the horizontal scroll bar block increment, which typically controls how far the content moves to the left or right when you:- press the page up or page down keys (not to be confused with the arrow keys)
- click on a scroll bar track (the empty area of the scrollbar, not the thumb or arrows)
Please be aware that look and feel implementations that provide custom scrolling behavior may ignore the block increment value.- Parameters:
increment
- The scroll horizontal block increment to use.- Returns:
- This builder instance, to allow for method chaining.
-
withBlockScrollIncrement
Use this to set both the vertical and horizontal scroll block increment. The block increment is the amount to change the scrollbar's value by, given a block (usually "page") up/down request or when the user clicks above or below the scrollbar "knob" to change the value up or down by large amount.
Please be aware that look and feel implementations that provide custom scrolling behavior may ignore the block increment value.- Parameters:
increment
- The scroll block increment to use.- Returns:
- This builder instance, to allow for method chaining.
- See Also:
-