public class HourDocument extends PlainDocument implements Internationalization
AbstractDocument.AbstractElement, AbstractDocument.AttributeContext, AbstractDocument.BranchElement, AbstractDocument.Content, AbstractDocument.DefaultDocumentEvent, AbstractDocument.ElementEdit, AbstractDocument.LeafElement| Modifier and Type | Field and Description |
|---|---|
static String |
a_hh_mm_ss |
static String |
a_kk_mm_ss |
protected SimpleDateFormat |
dateFormat |
static String |
HH_mm_ss |
static String |
hh_mm_ss_a |
protected Date |
hour |
protected Timestamp |
hourTimestamp |
static String |
KK_mm_ss |
static String |
kk_mm_ss_a |
protected Locale |
locale |
protected String |
patternHour |
static char |
SEPARATOR |
static String |
SEPARATOR_STR |
lineLimitAttribute, tabSizeAttributeBAD_LOCATION, BidiElementName, ContentElementName, ElementNameAttribute, listenerList, ParagraphElementName, SectionElementNameDEBUG_LANGUAGEStreamDescriptionProperty, TitleProperty| Constructor and Description |
|---|
HourDocument() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
buildPattern()
Characters used in date format: k,K,h,H,m,s, a (format am-pm) Hour
patterns could be:
- HH:mm:ss - HH:mm:ss - hh:mm:ss a - kk:mm:ss a - a hh:mm:ss - a kk:mm:ss - KK:mm:ss |
void |
format() |
SimpleDateFormat |
getFormat() |
Date |
getHour() |
String |
getSampleHour() |
Vector |
getTextsToTranslate()
Returns all the texts in the element suitable for being translated.
|
void |
insertString(int offset,
String stringValue,
AttributeSet attributes) |
protected void |
insertStringWithoutCheck(int offset,
String stringValue,
AttributeSet attributes) |
boolean |
isValid() |
void |
setComponentLocale(Locale l) |
void |
setResourceBundle(ResourceBundle res)
Sets the language resource bundle.
|
createDefaultRoot, getDefaultRootElement, getParagraphElement, insertUpdate, removeUpdateaddDocumentListener, addUndoableEditListener, createBranchElement, createLeafElement, createPosition, dump, fireChangedUpdate, fireInsertUpdate, fireRemoveUpdate, fireUndoableEditUpdate, getAsynchronousLoadPriority, getAttributeContext, getBidiRootElement, getContent, getCurrentWriter, getDocumentFilter, getDocumentListeners, getDocumentProperties, getEndPosition, getLength, getListeners, getProperty, getRootElements, getStartPosition, getText, getText, getUndoableEditListeners, postRemoveUpdate, putProperty, readLock, readUnlock, remove, removeDocumentListener, removeUndoableEditListener, render, replace, setAsynchronousLoadPriority, setDocumentFilter, setDocumentProperties, writeLock, writeUnlockpublic static final String KK_mm_ss
public static final String kk_mm_ss_a
public static final String a_kk_mm_ss
public static final String HH_mm_ss
public static final String hh_mm_ss_a
public static final String a_hh_mm_ss
public static final char SEPARATOR
public static final String SEPARATOR_STR
protected Locale locale
protected SimpleDateFormat dateFormat
protected String patternHour
protected Date hour
protected Timestamp hourTimestamp
public Date getHour()
protected void buildPattern()
public void setResourceBundle(ResourceBundle res)
InternationalizationsetResourceBundle in interface Internationalizationres - the new language bundle.public Vector getTextsToTranslate()
InternationalizationgetTextsToTranslate in interface Internationalizationpublic void setComponentLocale(Locale l)
setComponentLocale in interface Internationalizationpublic void insertString(int offset,
String stringValue,
AttributeSet attributes)
throws BadLocationException
insertString in interface DocumentinsertString in class PlainDocumentBadLocationExceptionpublic SimpleDateFormat getFormat()
public void format()
public boolean isValid()
public String getSampleHour()
protected void insertStringWithoutCheck(int offset,
String stringValue,
AttributeSet attributes)
throws BadLocationException
BadLocationExceptionCopyright © 2016 Imatia Innovation S.L.. All rights reserved.