Class WShuffler

    • Constructor Detail

      • WShuffler

        public WShuffler()
        Creates an empty WShuffler.
      • WShuffler

        public WShuffler​(List<?> options)
        Creates a WShuffler with the specified options.
        Parameters:
        options - the shuffler options.
    • Method Detail

      • setOptions

        public void setOptions​(List<?> options)
        Sets the shuffler options.
        Parameters:
        options - the shuffler options
      • getOptions

        public List<?> getOptions()
        Retrieves the shuffler options.
        Returns:
        the shuffler options
      • getValue

        public List<?> getValue()
        Provide the value of the component returned by DataBound.getData() in the correct format.

        If required, this method can convert the data into the correct type and also do any validation before the value is used.

        Specified by:
        getValue in interface Input
        Overrides:
        getValue in class AbstractInput
        Returns:
        the value of the component returned by DataBound.getData() in the correct format.
      • setRows

        public void setRows​(int rows)
        Sets the maximum number of rows that are visible in the list at any one time.
        Parameters:
        rows - the number of rows to display.
      • getRows

        public int getRows()
        Returns:
        the number of rows to display in the list.
      • doHandleRequest

        protected boolean doHandleRequest​(Request request)
        Specific handle request processing for an input component is provided here.

        Input components are required to determine if the component has changed in the request, set the component data to the new value (if changed) and return the changed flag.

        Specified by:
        doHandleRequest in class AbstractInput
        Parameters:
        request - the request being responded to.
        Returns:
        true if the input component has changed, otherwise return false
      • getRequestValue

        public List<?> getRequestValue​(Request request)
        Provide the value of the component on the Request.

        If the component is not on the request, the components current value will be provided.

        Specified by:
        getRequestValue in interface Input
        Parameters:
        request - the request being responded to.
        Returns:
        the value of this component on the Request, or its current state if it is not on the request.
      • isPresent

        protected boolean isPresent​(Request request)
        Determine if this component is on the Request.
        Overrides:
        isPresent in class AbstractInput
        Parameters:
        request - the request being responded to.
        Returns:
        true if this component is on the Request, otherwise return false.
      • getComponentModel

        protected WShuffler.ShufflerModel getComponentModel()
        Returns the effective component model for this component. Subclass may override this method to narrow the return type to their specific model type.
        Overrides:
        getComponentModel in class AbstractInput
        Returns:
        the effective component model
      • getOrCreateComponentModel

        protected WShuffler.ShufflerModel getOrCreateComponentModel()
        Retrieves the model for this component so that it can be modified. If this method is called during request processing, and a session specific model does not yet exist, then a new model is created. Subclasses may override this method to narrow the return type to their specific model type.
        Overrides:
        getOrCreateComponentModel in class AbstractInput
        Returns:
        the model for this component