Package commandLineMenus
Interface ListItemRenderer<T>
-
public interface ListItemRenderer<T>Overrides the display of an item in a list. By default, the toString() function is used, but you can customize it.- See Also:
ListItemDefaultRenderer
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.Stringempty()What will be printed if the list is empty.java.lang.Stringshortcut(int index, T item)Returns the shortcut that will be displayed, please make sure there will be no collision.java.lang.Stringtitle(int index, T item)Returns the title that will be displayed.
-
-
-
Method Detail
-
shortcut
java.lang.String shortcut(int index, T item)Returns the shortcut that will be displayed, please make sure there will be no collision.- Parameters:
index- The index of the item. Be careful, the indexes begin from 1.item- The item binded with this shortcut.- Returns:
- The shortcut that will be displayed.
-
title
java.lang.String title(int index, T item)Returns the title that will be displayed.- Parameters:
index- The index of the item. Be careful, the indexes begin from 1.item- The item binded with this shortcut.- Returns:
- The title that will be displayed.
-
empty
java.lang.String empty()
What will be printed if the list is empty.- Returns:
- What will be printed if the list is empty.
-
-