Class PromptFancySelectItem
java.lang.Object
de.xima.fc.prompt.service.support.gui.view_model.PromptFancySelectItem
- All Implemented Interfaces:
Serializable
Generic view model for the
<p:selectOneMenu /> components, representing one selectable option. Used to
display select options in a more fanciful way, with an optional description and icon.- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionPromptFancySelectItem(Object value, String label) Constructor that creates a select item with the given value and label.PromptFancySelectItem(Object value, String label, IGuiIcon icon) Constructor that creates a select item with the given value, label, and icon.PromptFancySelectItem(Object value, String label, String description) Constructor that creates a select item with the given value, label and description.PromptFancySelectItem(Object value, String label, String description, IGuiIcon icon) Constructor that creates a select item with the given value, label, description, and icon. -
Method Summary
Modifier and TypeMethodDescriptionGets the optional description of the select item.getIcon()Gets the optional icon of the select item, which is show next to the label.getLabel()Gets the label of the select item, a short name shown to the user.getValue()Gets the value of the select item.<T> TgetValueAs(Class<T> type) Gets the value of the select item, cast to the given type if possible.voidsetDescription(String description) Sets the optional description of the select item.voidSets the optional icon of the select item, which is show next to the label.voidSets the label of the select item, a short name shown to the user.voidSets the value of the select item.toString()
-
Constructor Details
-
PromptFancySelectItem
-
PromptFancySelectItem
-
PromptFancySelectItem
Constructor that creates a select item with the given value, label, and icon.- Parameters:
value- The value of the select item.label- The label of the select item.icon- The icon of the select item, which is show next to the label.
-
PromptFancySelectItem
Constructor that creates a select item with the given value, label, description, and icon.- Parameters:
value- The value of the select item.label- The label of the select item.description- The description of the select item.icon- The icon of the select item, which is show next to the label.
-
-
Method Details
-
getDescription
Gets the optional description of the select item.- Returns:
- The description of the select item.
-
setDescription
Sets the optional description of the select item.- Parameters:
description- The description of the select item.
-
getIcon
Gets the optional icon of the select item, which is show next to the label.- Returns:
- The icon of the select item, or null if none is set.
-
setIcon
Sets the optional icon of the select item, which is show next to the label.- Parameters:
icon- The icon of the select item.
-
getLabel
Gets the label of the select item, a short name shown to the user.- Returns:
- The label of the select item.
-
setLabel
Sets the label of the select item, a short name shown to the user.- Parameters:
label- The label of the select item.
-
getValue
-
setValue
Sets the value of the select item.- Parameters:
value- The value of the select item.
-
getValueAs
Gets the value of the select item, cast to the given type if possible. Returns null if the value is not of the given type.- Type Parameters:
T- The type to cast the value to.- Parameters:
type- The type to cast the value to.- Returns:
- The value of the select item.
-
toString
-