public class Field extends FormControl
drawingShape, formElement, mElement, mFormProperties| Modifier and Type | Method and Description |
|---|---|
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.
|
getDrawControl, getOdfElement, getRectangle, remove, setAnchorType, setFormProperty, setRectanglegetComponentByElement, getOwnerDocument, registerComponent, unregisterComponentpublic static Field getInstanceOf(FormFormattedTextElement element)
element - - an instance of FormFormattedTextElementpublic String getId()
FormControlgetId in class FormControlpublic void setControlImplementation(String controlImpl)
FormControlsetControlImplementation in class FormControlcontrolImpl - - the implementation description of this controlpublic void setId(String id)
FormControlsetId in class FormControlid - -the control id.public String getName()
FormControlgetName in class FormControlpublic void setName(String name)
FormControlsetName in class FormControlname - - 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.DecimalFormatformatStr 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,
DecimalFormatpublic String getFormatString(OfficeValueTypeAttribute.Value typeValue)
public static Iterator<FormControl> getSimpleIterator(Form container)
container - - an instance of form where to traverse the date fieldsCopyright © 2010–2018 Apache Software Foundation; Copyright © 2018–2020 The Document Foundation. All rights reserved.