Package swingtree
Class UIForPopup<P extends JPopupMenu>
A SwingTree builder node designed for configuring
JPopupMenu
instances.
Take a look at the living swing-tree documentation where you can browse a large collection of examples demonstrating how to use the API of this class or other classes.
-
Method Summary
Modifier and TypeMethodDescriptionprotected UIForPopup
<P> _newBuilderWithState
(swingtree.BuilderState<P> newState) An internal wither method which creates a new builder instance with the providedBuilderState
stored inside it.protected swingtree.BuilderState
<P> _state()
Returns the state of the builder, which is a container for the wrapped component as well as it's type and currentEventProcessor
.add
(JSeparator separator) final UIForPopup
<P> borderIsPaintedIf
(boolean borderPainted) Determines if the border is painted or not.final UIForPopup
<P> borderIsPaintedIf
(sprouts.Val<Boolean> isPainted) Determines if the border is painted or not based on the value of the givenVal
.onCancel
(sprouts.Action<ComponentDelegate<P, PopupMenuEvent>> action) Registers a listener to be notified when the popup is canceled.onInvisible
(sprouts.Action<ComponentDelegate<P, PopupMenuEvent>> action) Registers a listener to be notified when the popup becomes invisible, meaning its popup menu is hidden.onVisible
(sprouts.Action<ComponentDelegate<P, PopupMenuEvent>> action) Registers a listener to be notified when the popup is shown.Methods inherited from class swingtree.UIForAnySwing
_addComponentTo, _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, _onShow, _onShow, _runInApp, _runInApp, _runInUI, _this, _with, _withOnShow, _withOnShow, add, add, add, add, apply, applyIf, applyIfPresent, component, equals, get, getComponent, getType, hashCode, peek, toString
-
Method Details
-
_state
Description copied from class:UIForAnything
Returns the state of the builder, which is a container for the wrapped component as well as it's type and currentEventProcessor
.- Specified by:
_state
in classUIForAnything<UIForPopup<P extends JPopupMenu>,
P extends JPopupMenu, JComponent> - Returns:
- The state of the builder.
-
_newBuilderWithState
Description copied from class:UIForAnything
An internal wither method which creates a new builder instance with the providedBuilderState
stored inside it.- Specified by:
_newBuilderWithState
in classUIForAnything<UIForPopup<P extends JPopupMenu>,
P extends JPopupMenu, JComponent> - Parameters:
newState
- The new state which should be stored inside the new builder instance.- Returns:
- A new builder instance with the provided state stored inside it.
-
borderIsPaintedIf
Determines if the border is painted or not.- Parameters:
borderPainted
- True if the border is painted, false otherwise- Returns:
- This builder node, to qllow for method chaining.
-
borderIsPaintedIf
Determines if the border is painted or not based on the value of the givenVal
. If the value of theVal
changes, the border will be painted or not.- Parameters:
isPainted
- AVal
which will be used to determine if the border is painted or not.- Returns:
- This builder node, to qllow for method chaining.
-
onVisible
Registers a listener to be notified when the popup is shown. This is typically triggered whenJPopupMenu.show(Component, int, int)
is called.- Parameters:
action
- The action to be executed when the popup is shown.- Returns:
- this
-
onInvisible
Registers a listener to be notified when the popup becomes invisible, meaning its popup menu is hidden.- Parameters:
action
- The action to be executed when the popup becomes invisible.- Returns:
- This builder node, to allow for method chaining.
-
onCancel
Registers a listener to be notified when the popup is canceled. This is typically triggered when the user clicks outside the popup.- Parameters:
action
- the action to be executed when the popup is canceled.- Returns:
- this
-
add
-
add
-
add
-