org.japura.gui.model
Class DateDocument

java.lang.Object
  extended by javax.swing.text.AbstractDocument
      extended by javax.swing.text.PlainDocument
          extended by org.japura.gui.model.DateDocument
All Implemented Interfaces:
java.io.Serializable, javax.swing.text.Document

public class DateDocument
extends javax.swing.text.PlainDocument

Copyright (C) 2011 Carlos Eduardo Leite de Andrade

This library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this program. If not, see www.gnu.org/licenses/

For more information, contact: www.japura.org

Author:
Carlos Eduardo Leite de Andrade
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces 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
 
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 javax.swing.text.Document
StreamDescriptionProperty, TitleProperty
 
Constructor Summary
DateDocument()
           
DateDocument(java.util.Locale locale, DateSeparator separator)
           
 
Method Summary
 void addDateListener(DateListener listener)
           
 void clear()
           
protected  void fireListeners(java.util.Date oldDate, java.util.Date newDate)
           
 java.util.Date getDate()
           
 java.lang.Integer getDay()
           
 java.util.Locale getLocale()
           
 DateMask getMask()
           
 java.lang.Integer getMonth()
           
 DateSeparator getSeparator()
           
 java.lang.Integer getYear()
           
 void insertString(int offs, java.lang.String str, javax.swing.text.AttributeSet a)
           
 boolean isAutoCompleteEnabled()
           
 boolean isValid()
           
 void remove(int offs, int len)
           
 void removeDateListener(DateListener listener)
           
 void setAutoCompleteEnabled(boolean enabled)
           
 void setDate(int day, int month, int year)
           
 void setDate(long time)
           
 void setToCurrentDate()
           
 
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, 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
 

Constructor Detail

DateDocument

public DateDocument()

DateDocument

public DateDocument(java.util.Locale locale,
                    DateSeparator separator)
Method Detail

getLocale

public java.util.Locale getLocale()

getSeparator

public DateSeparator getSeparator()

isAutoCompleteEnabled

public boolean isAutoCompleteEnabled()

setAutoCompleteEnabled

public void setAutoCompleteEnabled(boolean enabled)

isValid

public boolean isValid()

getDay

public java.lang.Integer getDay()

getMonth

public java.lang.Integer getMonth()

getYear

public java.lang.Integer getYear()

getDate

public java.util.Date getDate()

setDate

public void setDate(int day,
                    int month,
                    int year)

clear

public void clear()

setDate

public void setDate(long time)

setToCurrentDate

public void setToCurrentDate()

getMask

public DateMask getMask()

remove

public void remove(int offs,
                   int len)
            throws javax.swing.text.BadLocationException
Specified by:
remove in interface javax.swing.text.Document
Overrides:
remove in class javax.swing.text.AbstractDocument
Throws:
javax.swing.text.BadLocationException

insertString

public void insertString(int offs,
                         java.lang.String str,
                         javax.swing.text.AttributeSet a)
                  throws javax.swing.text.BadLocationException
Specified by:
insertString in interface javax.swing.text.Document
Overrides:
insertString in class javax.swing.text.PlainDocument
Throws:
javax.swing.text.BadLocationException

fireListeners

protected void fireListeners(java.util.Date oldDate,
                             java.util.Date newDate)

addDateListener

public void addDateListener(DateListener listener)

removeDateListener

public void removeDateListener(DateListener listener)