Interface IUIRadioComponent

All Superinterfaces:
IComponent, ICustomDataProvider, IGProp<GProp<?>[]>, IMessageBox, IPropCnr, IUIBooleanSelectionComp, IUIComp, IUIIndexedSelectionComp, IUISelectionComp, IUISingleIndexedSelectionComp, IVSComponentListener, IVSComponentState, IVSFieldListener
All Known Implementing Classes:
EUIRadioButton, EUIRadioMenuItem, UIRadioButton, UIRadioMenuItem

public interface IUIRadioComponent extends IUIBooleanSelectionComp, IUISingleIndexedSelectionComp
Interface implemented by components that can be grouped together using a group name, e.g. radio buttons and radio button menu items.
Author:
Christopher Mindus
  • Field Details

    • PN_GROUP_NAME

      static final String PN_GROUP_NAME
      Property name: radio component group StringProp.
      See Also:
    • PN_SELECTED

      static final String PN_SELECTED
      Property name: selected BoolProp.
      See Also:
    • SELECTED_ATOM

      static final Atom SELECTED_ATOM
      Property atom: selected BoolProp.
    • PN_SELECTED_NO_MATCH

      static final String PN_SELECTED_NO_MATCH
      Property name: selection for no match BoolProp.
      See Also:
    • PN_SELECTED_VALUE

      static final String PN_SELECTED_VALUE
      Property name: selected value.
      See Also:
  • Method Details

    • getGroupName

      default String getGroupName()
      Gets the group name of the component.
      Returns:
      The group name or null for none.
    • isSelected

      default boolean isSelected()
      Returns the selection state.
      Specified by:
      isSelected in interface IUIBooleanSelectionComp
      Specified by:
      isSelected in interface IUISelectionComp
      Returns:
      true if the component is selected, false if unselected.
    • isUnselected

      default boolean isUnselected()
      Returns if the selection is not set.
      Specified by:
      isUnselected in interface IUIBooleanSelectionComp
      Returns:
      true if unselected, false if selected.
    • isON

      default boolean isON()
      Returns if the selection is "on".
      Specified by:
      isON in interface IUIBooleanSelectionComp
      Returns:
      true if on, false if off.
    • isOFF

      default boolean isOFF()
      Returns if the selection is "off".
      Specified by:
      isOFF in interface IUIBooleanSelectionComp
      Returns:
      true if off, false if on.
    • getSelectedIndex

      default int getSelectedIndex()
      Gets the first selected index. For radio buttons and menu items, this means the index in the radio group. The ordering of the group is NOT related to the tab order, but rather the ordering they are found from container to children and so on.
      Specified by:
      getSelectedIndex in interface IUISingleIndexedSelectionComp
      Returns:
      The first index in the current selection, or -1 for none.
    • getSelectedIndicies

      default int[] getSelectedIndicies()
      Gets the selected indicies. For radio buttons and menu items, this means the index in the radio group. The ordering of the group is NOT related to the tab order, but rather the ordering they are found from container to children and so on.
      Specified by:
      getSelectedIndicies in interface IUIIndexedSelectionComp
      Specified by:
      getSelectedIndicies in interface IUISingleIndexedSelectionComp
      Returns:
      A new array of the selected indices (that may be modified to your liking), or a static zero in length array for no selection. The array is either of length 1 for one selection, or zero for none.
    • setSelection

      default String setSelection(int index)
      Sets the selection as a single selected item at specified index.
      Specified by:
      setSelection in interface IUIIndexedSelectionComp
      Parameters:
      index - The single item to select at index, -1 to clear the selection.
      Returns:
      null for success, otherwise an error message why the selection failed.
    • clearSelection

      default String clearSelection()
      Clear the selection.
      Specified by:
      clearSelection in interface IUIIndexedSelectionComp
      Returns:
      null for OK.
    • isSelectedByDefault

      default boolean isSelectedByDefault()
      Checks if this radio component is selected by default in the group when selection doesn't match. Only one radio component in a group can return true with this method.
      Returns:
      true if selected by default, false otherwise.
    • setSelection

      default boolean setSelection(boolean on)
      Sets the selection state.
      Specified by:
      setSelection in interface IUIBooleanSelectionComp
      Parameters:
      on - The selection state.
      Returns:
      true if state is changed, false for no change.
    • getRadioSelectionComponents

      default UIComp[] getRadioSelectionComponents()
      Gets the components being part of the selection group. Each component returned implements the this IUIRadioComponent interface.
      Returns:
      An array of the selection components.
    • getSelectedRadioComponent

      default UIComp getSelectedRadioComponent()
      Gets the currently selected radio component in the group.
      Returns:
      The selected radio component, null for none. The component implements this IUIRadioComponent interface.
    • getSelectionType

      default int getSelectionType()
      Gets the selection type of the component.
      Specified by:
      getSelectionType in interface IUISelectionComp
      Returns:
      A value indicating the selection capability as the SELECTION_TYPE_* values define.
    • getSelection

      default RadioSelection getSelection()
      Gets the current selection of the component.
      Specified by:
      getSelection in interface IUISelectionComp
      Returns:
      The current selection of the component.