org.olat.core.gui.components.choice
Class Choice

java.lang.Object
  extended by org.olat.core.gui.components.Component
      extended by org.olat.core.gui.components.choice.Choice

public class Choice
extends Component

A Choice is

Author:
Felix Jost

Field Summary
static java.lang.String CANCEL_IDENTIFICATION
          Comment for CANCEL_IDENTIFICATION
static Event EVNT_FORM_CANCELLED
          Comment for EVENT_FORM_CANCELLED
static Event EVNT_VALIDATION_OK
          Comment for EVENT_VALIDATION_OK
 
Constructor Summary
Choice(java.lang.String name)
           
Choice(java.lang.String name, Translator translator)
           
 
Method Summary
 java.util.List getAddedRows()
           
 java.lang.String getCancelKey()
           
 java.lang.String getExtendedDebugInfo()
           
 ComponentRenderer getHTMLRendererSingleton()
           
 java.util.List getRemovedRows()
           
 java.util.List getSelectedRows()
           
 java.lang.String getSubmitKey()
           
 TableDataModel getTableDataModel()
           
 boolean isDisplayOnly()
           
 void setCancelKey(java.lang.String string)
           
 void setDisplayOnly(boolean b)
           
 void setSubmitKey(java.lang.String string)
           
 void setTableDataModel(TableDataModel model)
          the tabledatamodel to represent the choice data.
 void validate(UserRequest ureq, ValidationResult vr)
          called just before the rendering of the -whole tree- takes place, so e.g.
 
Methods inherited from class org.olat.core.gui.components.Component
addListener, debuginfoGetListeners, dispatchRequest, getAndClearLatestFiredEvent, getComponentName, getDispatchID, getLatestDispatchedController, getListenerInfo, getParent, getSpanAsDomReplaceable, getTimestamp, getTranslator, isDirty, isDirtyForUser, isDomReplaceable, isEnabled, isVisible, setDirty, setDomReplaceable, setEnabled, setSpanAsDomReplaceable, setVisible, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

EVNT_VALIDATION_OK

public static final Event EVNT_VALIDATION_OK
Comment for EVENT_VALIDATION_OK


EVNT_FORM_CANCELLED

public static final Event EVNT_FORM_CANCELLED
Comment for EVENT_FORM_CANCELLED


CANCEL_IDENTIFICATION

public static final java.lang.String CANCEL_IDENTIFICATION
Comment for CANCEL_IDENTIFICATION

See Also:
Constant Field Values
Constructor Detail

Choice

public Choice(java.lang.String name)
Parameters:
name - of the component

Choice

public Choice(java.lang.String name,
              Translator translator)
Parameters:
name - of the component
Method Detail

getCancelKey

public java.lang.String getCancelKey()
Returns:
String

getSubmitKey

public java.lang.String getSubmitKey()
Returns:
String

setCancelKey

public void setCancelKey(java.lang.String string)
Parameters:
string -

setSubmitKey

public void setSubmitKey(java.lang.String string)
Parameters:
string -

getExtendedDebugInfo

public java.lang.String getExtendedDebugInfo()
Overrides:
getExtendedDebugInfo in class Component
Returns:
the extended debuginfo
See Also:
Component.getExtendedDebugInfo()

isDisplayOnly

public boolean isDisplayOnly()
Returns:
boolean

setDisplayOnly

public void setDisplayOnly(boolean b)
Parameters:
b -

getSelectedRows

public java.util.List getSelectedRows()
Returns:
the List of the selected rows indexes (List of Integers).

getTableDataModel

public TableDataModel getTableDataModel()
Returns:
TableDataModel

setTableDataModel

public void setTableDataModel(TableDataModel model)
the tabledatamodel to represent the choice data. one row belongs to one checkbox/choice; the columns are merely for graphical reasons.
Important: the first column must return a Boolean object to indicate whether the according row is currently selected or not

Parameters:
model -

getAddedRows

public java.util.List getAddedRows()
Returns:
Returns the addedRows (a List of Integers, one Integer stands for the position in the model of the element added).

getRemovedRows

public java.util.List getRemovedRows()
Returns:
Returns the removedRows.

getHTMLRendererSingleton

public ComponentRenderer getHTMLRendererSingleton()
Specified by:
getHTMLRendererSingleton in class Component

validate

public void validate(UserRequest ureq,
                     ValidationResult vr)
Description copied from class: Component
called just before the rendering of the -whole tree- takes place, so e.g. lazy fetching can be implemented, or issueing a request for a new moduleUri (e.g. for CPComponent, so that the browser loads images correctly). only called when the component is visible

Overrides:
validate in class Component
See Also:
Component.validate(org.olat.core.gui.UserRequest, org.olat.core.gui.render.ValidationResult)