|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.odftoolkit.simple.Component
org.odftoolkit.simple.form.FormControl
org.odftoolkit.simple.form.Field
public class Field
This class represents the form control of Field, provides methods to get/set the form properties and the style formatting of this control.
Field Summary |
---|
Fields inherited from class org.odftoolkit.simple.form.FormControl |
---|
drawingShape, formElement, mElement, mFormProperties |
Method Summary | |
---|---|
String |
getCurrentValue()
Get the current value of this control |
String |
getFormatString(OfficeValueTypeAttribute.Value typeValue)
Get the format string of the field. |
String |
getId()
Get the control id. |
static Field |
getInstanceOf(FormFormattedTextElement element)
Get an instance of field by an instance of FormFormattedTextElement, while searching the document content to make a bind with the DrawControl which already reference to this field. |
String |
getName()
Get the control name. |
static Iterator<FormControl> |
getSimpleIterator(Form container)
Get a simple iterator for Field. |
String |
getValue()
Get the default value of this control |
void |
setControlImplementation(String controlImpl)
Set the implementation of this control. |
void |
setCurrentValue(String value)
Set the current value of this control, it override the default value. |
protected void |
setFormatString(String formatStr,
OfficeValueTypeAttribute.Value type,
Locale locale)
Set the format string of the field. |
void |
setId(String id)
Set the control id. |
void |
setName(String name)
Set the control name. |
void |
setSpinButonVisible(boolean isVisible)
Set the visibility of the spin button |
void |
setValue(String value)
Set the default value of this control, it will be override by current value. |
Methods inherited from class org.odftoolkit.simple.form.FormControl |
---|
getDrawControl, getOdfElement, getRectangle, remove, setAnchorType, setFormProperty, setRectangle |
Methods inherited from class org.odftoolkit.simple.Component |
---|
getComponentByElement, getOwnerDocument, registerComponent, unregisterComponent |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static Field getInstanceOf(FormFormattedTextElement element)
element
- - an instance of FormFormattedTextElement
public String getId()
FormControl
getId
in class FormControl
public void setControlImplementation(String controlImpl)
FormControl
setControlImplementation
in class FormControl
controlImpl
- - the implementation description of this controlpublic void setId(String id)
FormControl
setId
in class FormControl
id
- -the control id.public String getName()
FormControl
getName
in class FormControl
public void setName(String name)
FormControl
setName
in class FormControl
name
- - the control name.public void setValue(String value)
value
- - default valuepublic String getValue()
public void setCurrentValue(String value)
currentValue
- - current valuepublic String getCurrentValue()
public void setSpinButonVisible(boolean isVisible)
isVisible
- - true means the spin button is visible; false means the spin
button is hiddenprotected void setFormatString(String formatStr, OfficeValueTypeAttribute.Value type, Locale locale)
This function only works for float, date, time and percentage, otherwise an
IllegalArgumentException
will be thrown.
For value type float and percentage, the formatStr
must follow the encoding
rule of
.
For value type date and time, the java.text.DecimalFormat
formatStr
must follow the encoding
rule of
.
java.text.SimpleDateFormat
If adaptive failed, an
ValueType Distinguish Symbol Distinguish Priority percentage % 1 time H, k, m, s, S 2 date y, M, w, W, D, d, F, E, K, h 3 float #, 0 4
UnsupportedOperationException
will be thrown.
formatStr
- the cell need be formatted as this specified format string.
IllegalArgumentException
- if formatStr
is null or the cell value type is supported.SimpleDateFormat
,
DecimalFormat
public String getFormatString(OfficeValueTypeAttribute.Value typeValue)
public static Iterator<FormControl> getSimpleIterator(Form container)
container
- - an instance of form where to traverse the date fields
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |