org.odftoolkit.simple.form
Class TimeField

java.lang.Object
  extended by org.odftoolkit.simple.Component
      extended by org.odftoolkit.simple.form.FormControl
          extended by org.odftoolkit.simple.form.Field
              extended by org.odftoolkit.simple.form.TimeField

public class TimeField
extends Field


Field Summary
 
Fields inherited from class org.odftoolkit.simple.form.FormControl
drawingShape, formElement, mElement, mFormProperties
 
Method Summary
 void formatTime(String formatStr, Locale locale)
          Set the format of this time field.
static TimeField getInstanceOf(FormFormattedTextElement element)
          Get an instance of time field by an instance of FormFormattedTextElement, while searching the document content to make a bind with the DrawControl which already reference to this time field.
 String getTimeFormat()
          Get the format code which is used to format the display value
 void setTimeFormat(String formatStr, Locale locale)
          Format the time value according to the appointed format and locale.
 
Methods inherited from class org.odftoolkit.simple.form.Field
getCurrentValue, getFormatString, getId, getName, getSimpleIterator, getValue, setControlImplementation, setCurrentValue, setFormatString, setId, setName, setSpinButonVisible, setValue
 
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

getInstanceOf

public static TimeField getInstanceOf(FormFormattedTextElement element)
Get an instance of time field by an instance of FormFormattedTextElement, while searching the document content to make a bind with the DrawControl which already reference to this time field.

Parameters:
element - - an instance of FormFormattedTextElement
Returns:
an instance of time field

setTimeFormat

public void setTimeFormat(String formatStr,
                          Locale locale)
Format the time value according to the appointed format and locale.

Parameters:
formatStr - - format code
locale - - locale information

formatTime

public void formatTime(String formatStr,
                       Locale locale)
Set the format of this time field. Time format pattern is the same as SimpleDateFormat.

Parameters:
formatStr - the format string of this date.
See Also:
SimpleDateFormat

getTimeFormat

public String getTimeFormat()
Get the format code which is used to format the display value

Returns:
the format code


Copyright © 2010-2017 The Apache Software Foundation. All Rights Reserved.