|
Ontimize 5.2072EN | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.swing.text.AbstractDocument
javax.swing.text.PlainDocument
com.ontimize.gui.field.document.DateDocument
com.ontimize.gui.field.document.HourDateDocument
Document for managing hour and dates in same field. It is useful for table editors that map columns with timestamp values.
{@link DateCellEditor},
Serialized Form| Nested Class Summary |
| Nested classes inherited from class com.ontimize.gui.field.document.DateDocument |
DateDocument.DateFormatCache, DateDocument.DateFormatCacheKey |
| Nested classes inherited from class javax.swing.text.AbstractDocument |
javax.swing.text.AbstractDocument.AbstractElement, javax.swing.text.AbstractDocument.AttributeContext, javax.swing.text.AbstractDocument.BranchElement, javax.swing.text.AbstractDocument.Content, javax.swing.text.AbstractDocument.DefaultDocumentEvent, javax.swing.text.AbstractDocument.ElementEdit, javax.swing.text.AbstractDocument.LeafElement |
| Field Summary | |
static char |
charDateHourSeparator
|
protected java.util.Date |
currentDocumentDate
Date that stores the document for each moment. |
protected static java.text.SimpleDateFormat |
dfHourDate
Instance of date formatter |
static java.lang.String |
HH_mm
Default pattern for hours HH:mm |
protected boolean |
hourFirst
Hour will be showed at first. |
protected boolean |
onlyHour
It assigns a pattern to the document without date, only with hour. |
protected java.lang.String |
patternHour
String with hour pattern |
protected java.lang.String |
patternHourDate
String with hour and date patterns separated by charDateHourSeparator. |
protected java.lang.String |
sDateHourSeparator
|
| Fields inherited from class com.ontimize.gui.field.document.DateDocument |
currentDate, currentTimestamp, dateFormat, datePattern, DEBUG, defaultLocale, dfConstructor, insertedDate, locale |
| Fields inherited from class javax.swing.text.PlainDocument |
lineLimitAttribute, tabSizeAttribute |
| Fields inherited from class javax.swing.text.AbstractDocument |
BAD_LOCATION, BidiElementName, ContentElementName, ElementNameAttribute, listenerList, ParagraphElementName, SectionElementName |
| Fields inherited from interface com.ontimize.gui.i18n.Internationalization |
DEBUG_LANGUAGE |
| Fields inherited from interface javax.swing.text.Document |
StreamDescriptionProperty, TitleProperty |
| Constructor Summary | |
HourDateDocument()
Constructor that creates a date document with hour and date, when hour is showed at first. |
|
HourDateDocument(boolean onlyHour,
boolean hourFirst)
|
|
| Method Summary | |
protected void |
buildHourDatePattern()
Concatenates both patterns. |
protected void |
buildHourPattern()
Builds hour pattern. |
protected void |
buildPattern()
Builds pattern for date and hour. |
java.lang.String |
getText(int offset,
int length)
|
java.sql.Timestamp |
getTimestampValue()
|
void |
insertString(int offset,
java.lang.String sValue,
javax.swing.text.AttributeSet attributes)
Date pattern is known: - Non numeric characters are allowed. |
boolean |
isValid()
Pattern is valid when parsing returns a correct date. |
boolean |
isValidHour(java.lang.String sHour)
Checks whether hour is valid. |
void |
setPattern(java.lang.String patternHourDate)
Applies specified pattern to date formatter. |
void |
setValue(java.util.Date value)
|
| Methods inherited from class com.ontimize.gui.field.document.DateDocument |
format, getDate, getDatePattern, getFormat, getTextsToTranslate, getTimestampValue, insertStringWithoutCheck, isValid, setComponentLocale, setDatePattern, setResourceBundle |
| Methods inherited from class javax.swing.text.PlainDocument |
createDefaultRoot, getDefaultRootElement, getParagraphElement, insertUpdate, removeUpdate |
| Methods inherited from class javax.swing.text.AbstractDocument |
addDocumentListener, addUndoableEditListener, createBranchElement, createLeafElement, createPosition, dump, fireChangedUpdate, fireInsertUpdate, fireRemoveUpdate, fireUndoableEditUpdate, getAsynchronousLoadPriority, getAttributeContext, getBidiRootElement, getContent, getCurrentWriter, getDocumentFilter, getDocumentListeners, getDocumentProperties, getEndPosition, getLength, getListeners, getProperty, getRootElements, getStartPosition, getText, getUndoableEditListeners, postRemoveUpdate, putProperty, readLock, readUnlock, remove, removeDocumentListener, removeUndoableEditListener, render, replace, setAsynchronousLoadPriority, setDocumentFilter, setDocumentProperties, writeLock, writeUnlock |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final java.lang.String HH_mm
public static final char charDateHourSeparator
protected java.lang.String sDateHourSeparator
protected java.lang.String patternHour
protected java.lang.String patternHourDate
charDateHourSeparator. Order of these patterns will be assigned
according to variable hourFirst. By default, hour is showed at first.
protected java.util.Date currentDocumentDate
protected static java.text.SimpleDateFormat dfHourDate
protected boolean onlyHour
protected boolean hourFirst
| Constructor Detail |
public HourDateDocument()
public HourDateDocument(boolean onlyHour,
boolean hourFirst)
| Method Detail |
public void insertString(int offset,
java.lang.String sValue,
javax.swing.text.AttributeSet attributes)
throws javax.swing.text.BadLocationException
DateDocument
insertString in interface javax.swing.text.DocumentinsertString in class DateDocumentjavax.swing.text.BadLocationExceptionprotected void buildPattern()
buildPattern in class DateDocumentprotected void buildHourDatePattern()
public void setPattern(java.lang.String patternHourDate)
patternHourDate - The pattern to be applied.protected void buildHourPattern()
public boolean isValid()
isValid in class DateDocumentpublic boolean isValidHour(java.lang.String sHour)
sHour - String with hour
public java.lang.String getText(int offset,
int length)
throws javax.swing.text.BadLocationException
javax.swing.text.BadLocationExceptionpublic void setValue(java.util.Date value)
setValue in class DateDocumentpublic java.sql.Timestamp getTimestampValue()
getTimestampValue in class DateDocument
|
Ontimize | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||