Ontimize 5.2071EN

com.ontimize.gui.field.document
Class AdvancedDateDocument

java.lang.Object
  extended byjavax.swing.text.AbstractDocument
      extended byjavax.swing.text.PlainDocument
          extended bycom.ontimize.gui.field.document.DateDocument
              extended bycom.ontimize.gui.field.document.AdvancedDateDocument
All Implemented Interfaces:
javax.swing.text.Document, Internationalization, java.io.Serializable

public class AdvancedDateDocument
extends DateDocument

See Also:
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
protected  boolean advancedQueryMode
           
static java.lang.String BETWEEN
           
static java.lang.String EQUAL
           
static java.lang.String LESS
           
static java.lang.String LESS_EQUAL
           
static java.lang.String MORE
           
static java.lang.String MORE_EQUAL
           
static java.lang.String NOT
           
static java.lang.String OR
           
 
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
AdvancedDateDocument()
           
 
Method Summary
protected  java.lang.String getDocumentFirstSymbol()
           
protected  int getPatternOffset(int offset)
           
 SearchValue getQueryValue()
           
 void insertString(int offset, java.lang.String s, javax.swing.text.AttributeSet attributes)
          Date pattern is known:
- Non numeric characters are allowed.
protected  boolean isOROffset(int offset)
           
protected  boolean isORSymbolAllowed(int offset)
           
protected  boolean isStartSymbol(java.lang.String s)
           
protected  boolean isSymbolFirst()
          Checks if the first character is a condition symbol
 boolean isValid()
           
 void setAdvancedQueryMode(boolean advancedQueryMode)
           
 void setComponentLocale(java.util.Locale l)
           
 void setValue(SearchValue value)
           
 
Methods inherited from class com.ontimize.gui.field.document.DateDocument
buildPattern, format, getDate, getDatePattern, getFormat, getTextsToTranslate, getTimestampValue, getTimestampValue, insertStringWithoutCheck, isValid, setDatePattern, setResourceBundle, setValue
 
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, 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

OR

public static final java.lang.String OR
See Also:
Constant Field Values

BETWEEN

public static final java.lang.String BETWEEN
See Also:
Constant Field Values

NOT

public static final java.lang.String NOT
See Also:
Constant Field Values

EQUAL

public static final java.lang.String EQUAL
See Also:
Constant Field Values

LESS

public static final java.lang.String LESS
See Also:
Constant Field Values

MORE

public static final java.lang.String MORE
See Also:
Constant Field Values

LESS_EQUAL

public static final java.lang.String LESS_EQUAL
See Also:
Constant Field Values

MORE_EQUAL

public static final java.lang.String MORE_EQUAL
See Also:
Constant Field Values

advancedQueryMode

protected boolean advancedQueryMode
Constructor Detail

AdvancedDateDocument

public AdvancedDateDocument()
Method Detail

setAdvancedQueryMode

public void setAdvancedQueryMode(boolean advancedQueryMode)

setValue

public void setValue(SearchValue value)

isValid

public boolean isValid()
Overrides:
isValid in class DateDocument

getQueryValue

public SearchValue getQueryValue()

setComponentLocale

public void setComponentLocale(java.util.Locale l)
Specified by:
setComponentLocale in interface Internationalization
Overrides:
setComponentLocale in class DateDocument

insertString

public void insertString(int offset,
                         java.lang.String s,
                         javax.swing.text.AttributeSet attributes)
                  throws javax.swing.text.BadLocationException
Description copied from class: DateDocument
Date pattern is known:
- Non numeric characters are allowed.
- Year field has 4 characters (9999 maximum).
- Month and day fields have 2 characters. The maximum value for day is 31 and for month 12. An the minimum value for both is 1.
- When a value is introduced in field, this one is checked and text will be showed in red color until that the value is a correct date. Moreover, field value is also checked when field losts focus or ENTER key is pressed.
- Separator for dates is /. So a valid format date could be: 12/12/2008

Specified by:
insertString in interface javax.swing.text.Document
Overrides:
insertString in class DateDocument
Throws:
javax.swing.text.BadLocationException

isOROffset

protected boolean isOROffset(int offset)

getPatternOffset

protected int getPatternOffset(int offset)

isStartSymbol

protected boolean isStartSymbol(java.lang.String s)

isORSymbolAllowed

protected boolean isORSymbolAllowed(int offset)
                             throws javax.swing.text.BadLocationException
Throws:
javax.swing.text.BadLocationException

isSymbolFirst

protected boolean isSymbolFirst()
                         throws javax.swing.text.BadLocationException
Checks if the first character is a condition symbol

Returns:
true if the first character is a condition symbol
Throws:
javax.swing.text.BadLocationException

getDocumentFirstSymbol

protected java.lang.String getDocumentFirstSymbol()
                                           throws javax.swing.text.BadLocationException
Returns:
The symbol at the beginning of the document if it exists
Throws:
javax.swing.text.BadLocationException

Ontimize