Klasse SelectValues<T extends Comparable<T>>

java.lang.Object
org.obrel.core.RelatedObject
org.obrel.core.SerializableRelatedObject
Alle implementierten Schnittstellen:
de.esoco.lib.manage.Initializable, Serializable, org.obrel.core.Relatable

public class SelectValues<T extends Comparable<T>> extends InteractionFragment
A fragment that allows to select a set of values of a certain comparable type.
Siehe auch:
  • Konstruktordetails

    • SelectValues

      public SelectValues(String identifier, Class<T> valueDatatype, Collection<T> availableValues, boolean sortValues)
      Creates a new instance. The Identifier should be a singular description in camel case and unique in the context of the current process step. In the case of enum values it is recommended to use the simple name of the enum class as the identifier. If the sort parameter is TRUE the list values will be sorted on the client side after resource expansion if their datatype implements the Comparable interface.
      Parameter:
      identifier - A process step-unique identifier of this instance
      valueDatatype - The datatype of the values
      availableValues - The available values to select from
      sortValues - TRUE to sort the list values
    • SelectValues

      public SelectValues(String identifier, Class<T> valueDatatype, Collection<T> availableValues, Collection<T> preferredValues)
      Creates a new instance that sorts the list values and inserts a list of preferred values at the beginning of each list.The values will be sorted according to their natural order (i.e. their Comparable implementation). They will also be sorted on the server side before resource expansion, therefore using this variant only makes sense with values that are not resources.
      Parameter:
      identifier - A process step-unique identifier of this instance
      valueDatatype - The datatype of the values
      availableValues - The available values to select from
      preferredValues - An optional list of preferred values that should be listed first (empty for none)
  • Methodendetails

    • enableEdit

      public void enableEdit(boolean enable)
      Overridden to show only the selected values if editing is disabled.
      Setzt außer Kraft:
      enableEdit in Klasse InteractionFragment
      Parameter:
      enable - TRUE to enable editing, FALSE to disable
      Siehe auch:
    • getInputParameters

      public List<org.obrel.core.RelationType<?>> getInputParameters()
      Returns the collection of input parameters of this fragment. These must be a subset of InteractionFragment.getInteractionParameters(). The default implementation returns a mutable collection that can been modified directly by a subclass. Or it can be overridden by subclasses to return their own input parameter collection.
      Setzt außer Kraft:
      getInputParameters in Klasse InteractionFragment
      Gibt zurück:
      The list of this fragment's input parameters
    • getInteractionParameters

      public List<org.obrel.core.RelationType<?>> getInteractionParameters()
      Returns the list of interaction parameters for this fragment. The default implementation returns a mutable list that can been modified directly by a subclass. Or it can be overridden by subclasses to return their own interaction parameter list.
      Setzt außer Kraft:
      getInteractionParameters in Klasse InteractionFragment
      Gibt zurück:
      The list of this fragment's interaction parameters
    • getSelectedValues

      public Collection<T> getSelectedValues()
      Returns the values that have been selected in this fragment.
      Gibt zurück:
      A collection containing the selected values
    • handleInteraction

      public void handleInteraction(org.obrel.core.RelationType<?> interactionParam) throws Exception
      Must be implemented by subclasses to handle interactions for this fragment. The default implementation does nothing.
      Setzt außer Kraft:
      handleInteraction in Klasse InteractionFragment
      Parameter:
      interactionParam - The interaction parameter
      Löst aus:
      Exception - Any kind of exception may be thrown in case of errors
    • init

      public void init() throws Exception
      Must be implemented to initialize the interaction parameters of this fragment.
      Angegeben von:
      init in Schnittstelle de.esoco.lib.manage.Initializable
      Angegeben von:
      init in Klasse InteractionFragment
      Löst aus:
      Exception - Any kind of exception may be thrown in case of errors
    • initFragmentParameter

      public void initFragmentParameter(org.obrel.core.RelationType<List<org.obrel.core.RelationType<?>>> param)
      Initializes a parameter for this fragment. This sets a generic style name so that all fragments of this type can be styled similarly. This method should typically be invoked from the init() method of the parent fragment.
      Parameter:
      param - The parameter that will hold this fragment
    • setAvailableValues

      public void setAvailableValues(Collection<T> values)
      Sets the values that are available for selection.
      Parameter:
      values - The selectable values (can be NULL for none)
    • setSelectedValues

      public void setSelectedValues(Collection<T> values)
      Sets the currently selected values.
      Parameter:
      values - The selected values (may be NULL for none)
    • setSelectionListener

      public void setSelectionListener(SelectValues.SelectValueListener listener)
      Sets a listener that will be notified if the selection in this instance changes.
      Parameter:
      listener - The listener
    • setVisibleRows

      public void setVisibleRows(int rows)
      Sets the number of rows that are visible in the value lists.
      Parameter:
      rows - The number of visible rows
    • initProcessStep

      protected void initProcessStep(Interaction processStep)
      Beschreibung aus Klasse kopiert: InteractionFragment
      Will be invoked after the process step of this fragment has been set. Can be implemented by subclasses to initialize process step-specific parameters. The default implementation does nothing.
      Setzt außer Kraft:
      initProcessStep in Klasse InteractionFragment
      Parameter:
      processStep - The process step of this fragment
      Siehe auch: