Package com.tonic.vellum.widget
Class AbstractListSection
- java.lang.Object
-
- com.tonic.vellum.Section
-
- com.tonic.vellum.widget.AbstractListSection
-
- Direct Known Subclasses:
MenuSection,RadioGroup,SelectList,Table,TreeView
public abstract class AbstractListSection extends Section
Base for vertical, scrollable, single-selection lists; subclasses supply the row count and row drawing.
-
-
Constructor Summary
Constructors Constructor Description AbstractListSection()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AbstractListSectiononHighlight(java.util.function.IntConsumer handler)Sets the handler called with the row index whenever the selection moves.AbstractListSectiononSelect(java.util.function.IntConsumer handler)Sets the handler called with the row index on ENTER.voidselect(int index)Moves the selection to the given index (clamped to the valid range); firesonHighlightwhen it changes.intselectedIndex()
-
-
-
Method Detail
-
selectedIndex
public int selectedIndex()
- Returns:
- the selected row index
-
select
public void select(int index)
Moves the selection to the given index (clamped to the valid range); firesonHighlightwhen it changes.- Parameters:
index- the requested selection index
-
onSelect
public AbstractListSection onSelect(java.util.function.IntConsumer handler)
Sets the handler called with the row index on ENTER.- Parameters:
handler- the activation handler- Returns:
- this AbstractListSection for chaining
-
onHighlight
public AbstractListSection onHighlight(java.util.function.IntConsumer handler)
Sets the handler called with the row index whenever the selection moves.- Parameters:
handler- the highlight handler- Returns:
- this AbstractListSection for chaining
-
-