Class SelectItemChoice<T>

  • Type Parameters:
    T - Type of the value contained in this choice item.
    All Implemented Interfaces:
    de.xima.cmn.validation.spec.IChoiceEntry<T>, de.xima.cmn.validation.spec.IChoiceItem<T>, Serializable

    public final class SelectItemChoice<T>
    extends javax.faces.model.SelectItem
    implements de.xima.cmn.validation.spec.IChoiceItem<T>, Serializable
    A IChoiceItem that is also a SelectItem and can be used in JSF UIs.
    Since:
    7.0.0
    Author:
    XIMA MEDIA GmbH
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      SelectItemChoice​(T value)
      Creates a new choice item with the given data with no description that is enabled and where the label is plain text.
      SelectItemChoice​(T value, String label)
      Creates a new choice item with the given data with no description that is enabled and where the label is plain text.
      SelectItemChoice​(T value, String label, String description)
      Creates a new choice item with the given data that is enabled and where the label is plain text.
      SelectItemChoice​(T value, String label, String description, boolean disabled)
      Creates a new choice item with the given data with a label that is plain text.
      SelectItemChoice​(T value, String label, String description, boolean disabled, boolean escape)
      Creates a new choice item with the given data.
      SelectItemChoice​(T value, String label, String description, boolean disabled, boolean escape, boolean noSelectOption)
      Creates a new choice item with the given data.
    • Constructor Detail

      • SelectItemChoice

        public SelectItemChoice​(T value)
        Creates a new choice item with the given data with no description that is enabled and where the label is plain text. The label is extracted from the value via Object.toString().
        Parameters:
        value - The value represented by this choice item.
      • SelectItemChoice

        public SelectItemChoice​(T value,
                                String label)
        Creates a new choice item with the given data with no description that is enabled and where the label is plain text.
        Parameters:
        value - The value represented by this choice item.
        label - A textual label for the entry.
      • SelectItemChoice

        public SelectItemChoice​(T value,
                                String label,
                                String description)
        Creates a new choice item with the given data that is enabled and where the label is plain text.
        Parameters:
        value - The value represented by this choice item.
        label - A textual label for the entry.
        description - An optional description of the entry.
      • SelectItemChoice

        public SelectItemChoice​(T value,
                                String label,
                                String description,
                                boolean disabled)
        Creates a new choice item with the given data with a label that is plain text.
        Parameters:
        value - The value represented by this choice item.
        label - A textual label for the entry.
        description - An optional description of the entry.
        disabled - Whether the item is disabled.
      • SelectItemChoice

        public SelectItemChoice​(T value,
                                String label,
                                String description,
                                boolean disabled,
                                boolean escape)
        Creates a new choice item with the given data.
        Parameters:
        value - The value represented by this choice item.
        label - A textual label for the entry.
        description - An optional description of the entry.
        disabled - Whether the item is disabled.
        escape - true if the label is plain text, false if the label contains (HTML) markup. selected. The value of a no select option is usually either null or the empty string.
      • SelectItemChoice

        public SelectItemChoice​(T value,
                                String label,
                                String description,
                                boolean disabled,
                                boolean escape,
                                boolean noSelectOption)
        Creates a new choice item with the given data.
        Parameters:
        value - The value represented by this choice item.
        label - A textual label for the entry.
        description - An optional description of the entry.
        disabled - Whether the item is disabled.
        escape - true if the label is plain text, false if the label contains (HTML) markup.
        noSelectOption - true if this choice item is the no select option that is used when no value is selected. The value of a no select option is usually either null or the empty string.
    • Method Detail

      • getValue

        public T getValue()
        Specified by:
        getValue in interface de.xima.cmn.validation.spec.IChoiceItem<T>
        Overrides:
        getValue in class javax.faces.model.SelectItem