Interface IUISelectionComp

    • Field Detail

      • SELECTION_TYPE_NONE

        static final int SELECTION_TYPE_NONE
        Selection type: NONE.
        See Also:
        Constant Field Values
      • SELECTION_TYPE_SINGLE

        static final int SELECTION_TYPE_SINGLE
        Selection type: SINGLE.

        This value is returned by radio buttons, check boxes, comboboxes, tab containers, and single-selection grids.

        See Also:
        Constant Field Values
      • SELECTION_TYPE_MULTIPLE

        static final int SELECTION_TYPE_MULTIPLE
        Selection type: MULTIPLE.

        This value is returned from e.g. the grid when in multiple, extended or toggle selection modes.

        See Also:
        Constant Field Values
    • Method Detail

      • getSelectionPropAtom

        Atom getSelectionPropAtom()
        Returns the selection property atom for verification of selection changes.

        This method is used by the framework in UIComp to fire selection events when the property value changes.

        Returns:
        The atom of the selection property, or null if a selection property is not used.
      • getSelectionListenerHandler

        GenericListener<IUISelectionListener> getSelectionListenerHandler​(boolean doCreate)
        Returns the generic selection listener.
        Parameters:
        doCreate - Create the listener handler if it doesn't exist, false not to.
        Returns:
        The selection listener handler, or null if not created.
      • addSelectionListener

        default boolean addSelectionListener​(IUISelectionListener listener)
        Adds a selection listener.
        Parameters:
        listener - The listener.
        Returns:
        true for success, false if the listener is already added.
        Throws:
        java.lang.NullPointerException - If listener is null.
      • removeSelectionListener

        default boolean removeSelectionListener​(IUISelectionListener listener)
        Removes a selection listener.
        Parameters:
        listener - The listener.
        Returns:
        true for success, false if the listener has not been added before.
        Throws:
        java.lang.NullPointerException - If listener is null.
      • getSelectionType

        int getSelectionType()
        Gets the selection type of the component.
        Returns:
        A value indicating the selection capability as the SELECTION_TYPE_* values define.
      • isSelected

        boolean isSelected()
        Returns the selection of state of the component.

        For a multiple-selection capable component, this indicates any selection, i.e. true is returned as soon as at least one element is selected, false for none.

        The checkbox for example has two "selected states": checked and third state: in this case, true is returned for the third state as well as the checked state.

        Returns:
        true if the component is selected, false otherwise.
      • isSelectionBooleanBased

        default boolean isSelectionBooleanBased()
        Returns if the selection component supports boolean based selection.
        Returns:
        true if the selection can be retrieved or set using indexed based selections.
      • isSelectionTriStateBased

        default boolean isSelectionTriStateBased()
        Returns if the selection component supports tri-state based selection for e.g. checkboxes.
        Returns:
        true if the selection can be retrieved or set using indexed based selections.
      • isSelectionIndexBased

        default boolean isSelectionIndexBased()
        Returns if the selection component supports index-based selection.
        Returns:
        true if the selection can be retrieved or set using indexed based selections.
      • isSelectionCellBased

        default boolean isSelectionCellBased()
        Returns if the selection component supports is cell based.
        Returns:
        true if the selection can be retrieved or set using cell based selections.
      • getSelection

        IUISelection getSelection()
        Gets the current selection of the component.
        Returns:
        The current selection of the component.
      • setSelection

        default java.lang.String setSelection​(IUISelection selection)
        Sets the selection.
        Parameters:
        selection - The selection.
        Returns:
        null if selection is set successfully, otherwise the reason why the selection failed to be set, e.g. "Unsupported selection base" if the selection is indexed for a checkbox that only supports tri-state based selections.
      • getOnUISelectionMethod

        java.lang.reflect.Method getOnUISelectionMethod()
        Returns the method to use for onUISelection notifications that is attached to this selection component. The method name is not important, but must have the annotation and signature:

        @OnUISelection(name = "some/property")
        public void onUISelection(UISelectionEvent event)

        Returns:
        The method, or null if none is registered.