org.makumba.forms.html
Class choiceEditor

java.lang.Object
  extended by org.makumba.commons.formatters.FieldFormatter
      extended by org.makumba.forms.html.FieldEditor
          extended by org.makumba.forms.html.choiceEditor
Direct Known Subclasses:
booleanEditor, charEnumEditor, ptrEditor

public abstract class choiceEditor
extends FieldEditor


Field Summary
(package private) static String[] _params
           
(package private) static String[][] _paramValues
           
protected  String nullOption
           
 
Fields inherited from class org.makumba.forms.html.FieldEditor
ERROR_NO_BOOLEAN, ERROR_NO_INT, ERROR_NO_REAL, extraFormattingParam, formName, params, paramValues, suffixName
 
Constructor Summary
choiceEditor()
           
 
Method Summary
 String format(RecordFormatter rf, int fieldIndex, Object o, Dictionary<String,Object> formatParams)
          Format the object to pure text.
abstract  String formatOptionTitle(RecordFormatter rf, int fieldIndex, Object options, int i)
          Gets the title/label of option 'i'.
abstract  String formatOptionValue(RecordFormatter rf, int fieldIndex, Object val)
          Formats an option value.
abstract  String formatOptionValue(RecordFormatter rf, int fieldIndex, Object opts, int i, Object val)
          Formats an option value, in the sequence of options.
 String[] getAcceptedParams()
           
 String[][] getAcceptedValue()
           
abstract  int getDefaultSize(RecordFormatter rf, int fieldIndex)
          Gets the default size of the select HTML box.
abstract  Object getOptions(RecordFormatter rf, int fieldIndex, Dictionary<String,Object> formatParams)
          Get the available options.
abstract  int getOptionsLength(RecordFormatter rf, int fieldIndex, Object opts)
          Gets the number of available options.
abstract  Object getOptionValue(RecordFormatter rf, int fieldIndex, Object options, int i)
          Gets the value of option 'i'.
 Object getValueOrDefault(RecordFormatter rf, int fieldIndex, Object o, Dictionary<String,Object> formatParams)
          Return value if not null, or finds the default option and returns it as a Vector.
abstract  boolean isMultiple(RecordFormatter rf, int fieldIndex)
          Returns blank string, or " multiple " if multiple selections possible.
 void setNullOption(Object nullOption)
          Sets the value of the null option from the mak:input tag.
 boolean shouldRemoveNullValue(RecordFormatter rf, int fieldIndex)
          Null values are ignored
 
Methods inherited from class org.makumba.forms.html.FieldEditor
checkParam, formatHidden, formatHiddenValue, formatShow, formatValue, getExtraFormatting, getInputID, getInputName, getInputName, getInstance, getSuffix, onStartup, readFrom, readFrom, setExtraFormatting, setFormName, setSuffix, toInt, toReal
 
Methods inherited from class org.makumba.commons.formatters.FieldFormatter
checkParams, equals, formatNotNull, formatNull, getDefaultValueFormat, getEmptyValueFormat, getExpr, getIntParam, getIntParamString, initExpr, resetValueFormat
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_params

static String[] _params

_paramValues

static String[][] _paramValues

nullOption

protected String nullOption
Constructor Detail

choiceEditor

public choiceEditor()
Method Detail

getAcceptedParams

public String[] getAcceptedParams()
Overrides:
getAcceptedParams in class FieldEditor

getAcceptedValue

public String[][] getAcceptedValue()
Overrides:
getAcceptedValue in class FieldEditor

getOptions

public abstract Object getOptions(RecordFormatter rf,
                                  int fieldIndex,
                                  Dictionary<String,Object> formatParams)
Get the available options.


getOptionsLength

public abstract int getOptionsLength(RecordFormatter rf,
                                     int fieldIndex,
                                     Object opts)
Gets the number of available options.


getOptionValue

public abstract Object getOptionValue(RecordFormatter rf,
                                      int fieldIndex,
                                      Object options,
                                      int i)
Gets the value of option 'i'.


formatOptionTitle

public abstract String formatOptionTitle(RecordFormatter rf,
                                         int fieldIndex,
                                         Object options,
                                         int i)
Gets the title/label of option 'i'.


formatOptionValue

public abstract String formatOptionValue(RecordFormatter rf,
                                         int fieldIndex,
                                         Object opts,
                                         int i,
                                         Object val)
Formats an option value, in the sequence of options.


formatOptionValue

public abstract String formatOptionValue(RecordFormatter rf,
                                         int fieldIndex,
                                         Object val)
Formats an option value.


isMultiple

public abstract boolean isMultiple(RecordFormatter rf,
                                   int fieldIndex)
Returns blank string, or " multiple " if multiple selections possible.


getDefaultSize

public abstract int getDefaultSize(RecordFormatter rf,
                                   int fieldIndex)
Gets the default size of the select HTML box.


shouldRemoveNullValue

public boolean shouldRemoveNullValue(RecordFormatter rf,
                                     int fieldIndex)
Null values are ignored


format

public String format(RecordFormatter rf,
                     int fieldIndex,
                     Object o,
                     Dictionary<String,Object> formatParams)
Description copied from class: FieldFormatter
Format the object to pure text. If text-format is blank, try the "empty" replacer value.

Overrides:
format in class FieldEditor
Parameters:
rf - TODO
fieldIndex - TODO

getValueOrDefault

public Object getValueOrDefault(RecordFormatter rf,
                                int fieldIndex,
                                Object o,
                                Dictionary<String,Object> formatParams)
Return value if not null, or finds the default option and returns it as a Vector.


setNullOption

public void setNullOption(Object nullOption)
Sets the value of the null option from the mak:input tag.