org.japura.gui.model
Class DateDocument
java.lang.Object
javax.swing.text.AbstractDocument
javax.swing.text.PlainDocument
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 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 |
| 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 |
| 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 |
DateDocument
public DateDocument()
DateDocument
public DateDocument(java.util.Locale locale,
DateSeparator separator)
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)