|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.makumba.commons.formatters.FieldFormatter
org.makumba.forms.html.FieldEditor
org.makumba.forms.html.choiceEditor
org.makumba.forms.html.booleanEditor
public class booleanEditor
Boolean choice editor, capable of rendering either as a complex choice (tickbox, dropdown) or simple choice
(checkbox). Renders as checkbox by default.
TODO we should be able to choose what to display & select by default (Yes or No) and what is the text to display.
Field Summary | |
---|---|
(package private) static String[] |
__params
|
(package private) static String[][] |
__paramValues
|
Fields inherited from class org.makumba.forms.html.choiceEditor |
---|
_params, _paramValues, 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 | |
---|---|
protected |
booleanEditor()
Don't use this, use getInstance() |
Method Summary | |
---|---|
String |
format(RecordFormatter rf,
int fieldIndex,
Object o,
Dictionary<String,Object> formatParams)
Format the object to pure text. |
String |
formatOptionTitle(RecordFormatter rf,
int fieldIndex,
Object options,
int i)
Gets the title/label of option 'i'. |
String |
formatOptionValue(RecordFormatter rf,
int fieldIndex,
Object val)
Formats an option value. |
String |
formatOptionValue(RecordFormatter rf,
int fieldIndex,
Object opts,
int i,
Object val)
Formats an option value, in the sequence of options. |
String |
formatValue(RecordFormatter rf,
int fieldIndex,
Object o,
Dictionary<String,Object> formatParams)
Formats the value to appear in an input statement. |
String[] |
getAcceptedParams()
|
String[][] |
getAcceptedValue()
|
int |
getDefaultSize(RecordFormatter rf,
int fieldIndex)
Gets the default size of the select HTML box. |
static FieldFormatter |
getInstance()
|
Object |
getOptions(RecordFormatter rf,
int fieldIndex,
Dictionary<String,Object> formatParams)
Get the available options. |
int |
getOptionsLength(RecordFormatter rf,
int fieldIndex,
Object opts)
Gets the number of available options. |
Object |
getOptionValue(RecordFormatter rf,
int fieldIndex,
Object options,
int i)
Gets the value of option 'i'. |
boolean |
isMultiple(RecordFormatter rf,
int fieldIndex)
Returns blank string, or " multiple " if multiple selections possible. |
Object |
readFrom(RecordFormatter rf,
int fieldIndex,
HttpParameters par,
String suffix)
Reads, converts and validates the value present in the HttpParameters , for the FieldEditor
indicated by the given index. |
Methods inherited from class org.makumba.forms.html.choiceEditor |
---|
getValueOrDefault, setNullOption, shouldRemoveNullValue |
Methods inherited from class org.makumba.forms.html.FieldEditor |
---|
checkParam, formatHidden, formatHiddenValue, formatShow, getExtraFormatting, getInputID, getInputName, getInputName, getSuffix, onStartup, 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 |
---|
static String[] __params
static String[][] __paramValues
Constructor Detail |
---|
protected booleanEditor()
Method Detail |
---|
public static FieldFormatter getInstance()
public String[] getAcceptedParams()
getAcceptedParams
in class choiceEditor
public String[][] getAcceptedValue()
getAcceptedValue
in class choiceEditor
public String formatValue(RecordFormatter rf, int fieldIndex, Object o, Dictionary<String,Object> formatParams)
formatValue
in class FieldEditor
public Object readFrom(RecordFormatter rf, int fieldIndex, HttpParameters par, String suffix)
FieldEditor
HttpParameters
, for the FieldEditor
indicated by the given index.
readFrom
in class FieldEditor
public String formatOptionTitle(RecordFormatter rf, int fieldIndex, Object options, int i)
choiceEditor
formatOptionTitle
in class choiceEditor
public String format(RecordFormatter rf, int fieldIndex, Object o, Dictionary<String,Object> formatParams)
FieldFormatter
format
in class choiceEditor
rf
- TODOfieldIndex
- TODOpublic String formatOptionValue(RecordFormatter rf, int fieldIndex, Object opts, int i, Object val)
choiceEditor
formatOptionValue
in class choiceEditor
public String formatOptionValue(RecordFormatter rf, int fieldIndex, Object val)
choiceEditor
formatOptionValue
in class choiceEditor
public int getDefaultSize(RecordFormatter rf, int fieldIndex)
choiceEditor
getDefaultSize
in class choiceEditor
public Object getOptionValue(RecordFormatter rf, int fieldIndex, Object options, int i)
choiceEditor
getOptionValue
in class choiceEditor
public Object getOptions(RecordFormatter rf, int fieldIndex, Dictionary<String,Object> formatParams)
choiceEditor
getOptions
in class choiceEditor
public int getOptionsLength(RecordFormatter rf, int fieldIndex, Object opts)
choiceEditor
getOptionsLength
in class choiceEditor
public boolean isMultiple(RecordFormatter rf, int fieldIndex)
choiceEditor
isMultiple
in class choiceEditor
|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |