Package swingtree.api
Interface ListEntryDelegate<E,L extends JList<E>>
- Type Parameters:
E
- The type of the entries in theJList
.L
- The type of theJList
being rendered.
public interface ListEntryDelegate<E,L extends JList<E>>
A context object providing
JList
entry specific context information
for the functional ListEntryRenderer
interface, which is used to
render list entries.-
Method Summary
Modifier and TypeMethodDescriptionentry()
Exposes the item inside the rendered list entry in the form of anOptional
.boolean
hasFocus()
A convenience method to check if the entry has focus, which is usually noticeable by a distinct background color.int
index()
Exposes the position of the rendered list entry in the form of an integer based index number.boolean
A convenience method to check if the entry is selected, which is usually noticeable by a distinct background color.list()
Exposes theJList
that is being rendered.
-
Method Details
-
list
L list()Exposes theJList
that is being rendered.- Returns:
- The list being rendered.
-
entry
-
index
int index()Exposes the position of the rendered list entry in the form of an integer based index number.- Returns:
- The index of the entry being rendered or -1 if out of bounds.
-
isSelected
boolean isSelected()A convenience method to check if the entry is selected, which is usually noticeable by a distinct background color.- Returns:
- true if the entry is selected, false otherwise.
-
hasFocus
boolean hasFocus()A convenience method to check if the entry has focus, which is usually noticeable by a distinct background color.- Returns:
- true if the entry is focused, false otherwise.
-