org.olat.core.gui.formelements
Class StaticMultipleSelectionElement

java.lang.Object
  extended by org.olat.core.gui.formelements.AbstractFormElement
      extended by org.olat.core.gui.formelements.StaticMultipleSelectionElement
All Implemented Interfaces:
FormElement, MultipleSelectionElement, SelectionElement

public class StaticMultipleSelectionElement
extends AbstractFormElement
implements MultipleSelectionElement

Author:
Felix Jost

Constructor Summary
StaticMultipleSelectionElement(java.lang.String labelKey, java.lang.String[] keys, java.lang.String[] values, boolean enableCheckAll)
           
 
Method Summary
 boolean enableCheckAll()
          Whether to provide comfort function where the user can enable/disable all elements with a single click.
 java.lang.String getKey(int which)
           
 java.util.Set getSelectedKeys()
           
 int getSize()
           
 java.lang.String getValue(int which)
           
 boolean isAtLeastSelected(int howmany, java.lang.String errorKey)
           
 boolean isDirty()
           
 boolean isSelected(int which)
           
 void select(java.lang.String key, boolean select)
           
 void setValues(java.lang.String[] values)
          input: keys of selected checkboxes
 
Methods inherited from class org.olat.core.gui.formelements.AbstractFormElement
clearError, getError, getExample, getLabelKey, getName, getVisualMarked, isError, isMandatory, isReadOnly, setError, setErrorKey, setErrorKeyWithParams, setExample, setLabelKey, setMandatory, setName, setReadOnly, setVisualMarked
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.olat.core.gui.formelements.FormElement
clearError, getError, getExample, getLabelKey, getName, getVisualMarked, isError, isMandatory, isReadOnly, setError, setErrorKey, setErrorKeyWithParams, setLabelKey, setMandatory, setName, setReadOnly, setVisualMarked
 

Constructor Detail

StaticMultipleSelectionElement

public StaticMultipleSelectionElement(java.lang.String labelKey,
                                      java.lang.String[] keys,
                                      java.lang.String[] values,
                                      boolean enableCheckAll)
Parameters:
labelKey -
keys -
values -
enableCheckAll -
Method Detail

getKey

public java.lang.String getKey(int which)
Specified by:
getKey in interface SelectionElement
Returns:
String
See Also:
SelectionElement.getKey(int)

getValue

public java.lang.String getValue(int which)
Specified by:
getValue in interface SelectionElement
Returns:
String
See Also:
SelectionElement.getValue(int)

getSize

public int getSize()
Specified by:
getSize in interface SelectionElement
Returns:
integer
See Also:
SelectionElement.getSize()

isSelected

public boolean isSelected(int which)
Specified by:
isSelected in interface SelectionElement
Returns:
boolean
See Also:
SelectionElement.isSelected(int)

setValues

public void setValues(java.lang.String[] values)
input: keys of selected checkboxes

Specified by:
setValues in interface FormElement
See Also:
FormElement.setValues(java.lang.String[])

getSelectedKeys

public java.util.Set getSelectedKeys()
Specified by:
getSelectedKeys in interface MultipleSelectionElement
Returns:
a Set of Strings
See Also:
MultipleSelectionElement.getSelectedKeys()

isAtLeastSelected

public boolean isAtLeastSelected(int howmany,
                                 java.lang.String errorKey)
Specified by:
isAtLeastSelected in interface MultipleSelectionElement
Returns:
See Also:
MultipleSelectionElement.isAtLeastSelected(int, java.lang.String)

select

public void select(java.lang.String key,
                   boolean select)
Specified by:
select in interface SelectionElement
See Also:
SelectionElement.select(java.lang.String, boolean)

isDirty

public boolean isDirty()
Specified by:
isDirty in interface FormElement
Returns:
See Also:
FormElement.isDirty()

enableCheckAll

public boolean enableCheckAll()
Description copied from interface: MultipleSelectionElement
Whether to provide comfort function where the user can enable/disable all elements with a single click.

Specified by:
enableCheckAll in interface MultipleSelectionElement
Returns:
See Also:
MultipleSelectionElement.enableCheckAll()