FocusDelegate
abstract class FocusDelegate<K>
Override methods in this class to provide application specific behaviors related to focusing item.
| Parameters | |
|---|---|
<K> |
Selection key type. @see |
Summary
Public constructors |
|---|
Public functions |
|
|---|---|
abstract Unit |
If the environment supports focus and something is focused, unfocus it. |
abstract Unit |
focusItem(item: ItemDetailsLookup.ItemDetails<K!>)If environment supports focus, focus |
abstract Int |
Returns the position of the currently focused item, or |
abstract Boolean |
Public constructors
Public functions
clearFocus
abstract fun clearFocus(): Unit
If the environment supports focus and something is focused, unfocus it.
focusItem
abstract fun focusItem(item: ItemDetailsLookup.ItemDetails<K!>): Unit
If environment supports focus, focus item.
getFocusedPosition
abstract fun getFocusedPosition(): Int
Returns the position of the currently focused item, or NO_POSITION if nothing is focused.
You must implement this feature if you intend your app to work well with mouse and keyboard. Selection ranges are inferred from focused item when there is no explicit last-selected item.
You can manage and advance focus using keyboard arrows, reflecting this state visibly in the view item. Use can then press shift, then click another item with their mouse to select all items between the focused item and the clicked item.
| Returns | |
|---|---|
Int |
the position of the currently focused item, or |
hasFocusedItem
abstract fun hasFocusedItem(): Boolean
| Returns | |
|---|---|
Boolean |
true if there is a focused item. |