Package swingtree.api
Interface ListEntryDelegate<E,L extends JList<E>>
- Type Parameters:
E- The type of the entries in theJList.L- The type of theJListbeing 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.booleanhasFocus()A convenience method to check if the entry has focus, which is usually noticeable by a distinct background color.intindex()Exposes the position of the rendered list entry in the form of an integer based index number.booleanA convenience method to check if the entry is selected, which is usually noticeable by a distinct background color.list()Exposes theJListthat is being rendered.
-
Method Details
-
list
L list()Exposes theJListthat 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.
-