Package frclib.driverio
Class FrcChoiceMenu<T>
java.lang.Object
frclib.driverio.FrcChoiceMenu<T>
This class implements a choice menu where a number of choices are presented to the user on the dashboard. The user
can make the selection.
-
Constructor Summary
ConstructorsConstructorDescriptionFrcChoiceMenu
(String menuTitle) Constructor: Creates an instance of the object. -
Method Summary
Modifier and TypeMethodDescriptionvoid
This method adds a choice to the menu.void
This method adds a choice to the menu.This method returns the current selected choice item.This method returns the text of the current choice.getTitle()
This method returns the title text of this menu.
-
Constructor Details
-
FrcChoiceMenu
Constructor: Creates an instance of the object.- Parameters:
menuTitle
- specifies the title of the menu.
-
-
Method Details
-
getTitle
This method returns the title text of this menu.- Returns:
- title text.
-
addChoice
This method adds a choice to the menu. The choices will be displayed in the order of them being added.- Parameters:
choiceText
- specifies the choice text that will be displayed on the dashboard.choiceObject
- specifies the object to be returned if the choice is selected.defChoice
- specifies true to set it the default choice, false otherwise.lastChoice
- specifies true if this is the last choice added to the choice menu, false otherwise.
-
addChoice
This method adds a choice to the menu. The choices will be displayed in the order of them being added.- Parameters:
choiceText
- specifies the choice text that will be displayed on the dashboard.choiceObject
- specifies the object to be returned if the choice is selected.
-
getCurrentChoiceObject
This method returns the current selected choice item. Every menu has a current choice even if the user hasn't picked a choice. In that case, the current choice is the default selection of the menu.- Returns:
- current selected choice object.
-
getCurrentChoiceText
This method returns the text of the current choice. Every menu has a current choice even if the menu hasn't been displayed and the user hasn't picked a choice. In that case, the current choice is the default selection of the menu which is the first choice in the menu. If the menu is empty, the current choice is null.- Returns:
- current selected choice text, null if menu is empty.
-