Interface TethysUIScrollMenu<T>
- Type Parameters:
T- the value type
- All Superinterfaces:
OceanusEventRegistrar.OceanusEventProvider<TethysUIEvent>
public interface TethysUIScrollMenu<T>
extends OceanusEventRegistrar.OceanusEventProvider<TethysUIEvent>
ScrollMenu.
-
Method Summary
Modifier and TypeMethodDescriptionAdd Element.addItem(T pValue, TethysUIIcon pGraphic) Add Element.Add Element.addItem(T pValue, String pName, TethysUIIcon pGraphic) Add Element.addNullItem(String pName) Add Null Element.addNullItem(String pName, TethysUIIcon pGraphic) Add Null Element.addSubMenu(String pName) Add subMenu.addSubMenu(String pName, TethysUIIcon pGraphic) Add subMenu.addToggleItem(T pItem) Add New toggle item.addToggleItem(T pItem, String pName) Add New toggle item.Obtain the selected value.booleanisEmpty()is the menu empty?voidRemove all contents.voidsetCloseOnToggle(boolean pCloseOnToggle) Set whether menu should auto-close on selection of a toggle item.voidsetMaxDisplayItems(int pMaxDisplayItems) Set the number of items in the scrolling portion of the menu.Methods inherited from interface io.github.tonywasher.joceanus.oceanus.event.OceanusEventRegistrar.OceanusEventProvider
getEventRegistrar
-
Method Details
-
getSelectedItem
TethysUIScrollItem<T> getSelectedItem()Obtain the selected value.- Returns:
- the selected value
-
isEmpty
boolean isEmpty()is the menu empty?- Returns:
- true/false
-
setMaxDisplayItems
void setMaxDisplayItems(int pMaxDisplayItems) Set the number of items in the scrolling portion of the menu.- Parameters:
pMaxDisplayItems- the maximum number of items to display- Throws:
IllegalArgumentException- if pMaxDisplayItems is 0 or negative
-
setCloseOnToggle
void setCloseOnToggle(boolean pCloseOnToggle) Set whether menu should auto-close on selection of a toggle item.- Parameters:
pCloseOnToggle- true/false
-
removeAllItems
void removeAllItems()Remove all contents. -
addItem
Add Element.- Parameters:
pValue- the value- Returns:
- the item added
-
addItem
Add Element.- Parameters:
pValue- the valuepName- the display name- Returns:
- the item added
-
addItem
Add Element.- Parameters:
pValue- the valuepGraphic- the icon for the item- Returns:
- the item added
-
addNullItem
Add Null Element.- Parameters:
pName- the display name- Returns:
- the item added
-
addNullItem
Add Null Element.- Parameters:
pName- the display namepGraphic- the icon for the item- Returns:
- the item added
-
addItem
Add Element.- Parameters:
pValue- the valuepName- the display namepGraphic- the icon for the item- Returns:
- the item added
-
addSubMenu
Add subMenu.- Parameters:
pName- the display name- Returns:
- the menu added
-
addSubMenu
Add subMenu.- Parameters:
pName- the display namepGraphic- the icon for the menu- Returns:
- the menu added
-
addToggleItem
Add New toggle item.- Parameters:
pItem- the available item- Returns:
- the added item
-
addToggleItem
Add New toggle item.- Parameters:
pItem- the available itempName- the display name- Returns:
- the added item
-