Interface FocusModel<K>
- Type Parameters:
K- the focus key type
- All Known Implementing Classes:
SimpleKeyedFocusModel
public interface FocusModel<K>
Manages the state of individual foci in a widget.
Each instance should be specific to one widget.
- Since:
- 7.0.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionfoci()Returns a stream of all foci in the target widget.booleanChecks if a focus is focused in the target widget.voidsetFocused(Focus<K> focus) Applies a focus to the target widget.static FocusModel<?> Creates a simple focus model for a focusable widget.
-
Method Details
-
isFocused
Checks if a focus is focused in the target widget. If the target widget is not focused itself, none of its foci should have focus.- Parameters:
focus- the focus to check- Returns:
trueif the focus is focused,falseotherwise
-
setFocused
Applies a focus to the target widget.This method does not need to request the GUI's focus for the widget; that is the responsibility of the caller.
- Parameters:
focus- the focus
-
foci
Returns a stream of all foci in the target widget.- Returns:
- a stream of all foci in the target widget
-
simple
Creates a simple focus model for a focusable widget. The focus model provides the whole widget area as its only focus area.- Parameters:
widget- the widget- Returns:
- the focus model
-