public class SwingDocumentState extends AbstractSwingState implements State, DocumentListener
mSilentmIsEnabled, mIsInitialized, mListenerList, mName, mReason| Constructor and Description | 
|---|
SwingDocumentState(JTextComponent pTextField)
Creates a new state, using the handed text field as its state source. 
 | 
SwingDocumentState(JTextComponent pTextField,
                  String pContent)
Creates a new state, using the handed text field as its state source. 
 | 
| Modifier and Type | Method and Description | 
|---|---|
void | 
changedUpdate(DocumentEvent pEvent)
Gives notification that an attribute or set of attributes changed. 
 | 
protected boolean | 
getInternalState()
Check the document state. 
 | 
void | 
insertUpdate(DocumentEvent pEvent)
Gives notification that there was an insert into the document. 
 | 
void | 
removeUpdate(DocumentEvent pEvent)
Gives notification that a portion of the document has been
 removed. 
 | 
void | 
setCompareContent(String pContent)
Sets the string we compare the document against. 
 | 
protected void | 
setReason()
Set the source of the state as the reason for a change. 
 | 
void | 
updateCompareFromDocument()
Updates the compare content from the current value of the document. 
 | 
checkStateChange, isSilent, setSilentaddChangeListener, checkDisposed, dispose, fireStateChanged, getChangeReason, getDependents, getName, isDisposed, isEnabled, isInitialized, removeChangeListener, setName, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddChangeListener, dispose, getChangeReason, getDependents, getName, isDisposed, isEnabled, isInitialized, removeChangeListener, setNamepublic SwingDocumentState(JTextComponent pTextField)
pTextField - text field we take the document frompublic SwingDocumentState(JTextComponent pTextField, String pContent)
pTextField - text field we take the document frompContent - string to compare topublic void setCompareContent(String pContent)
pContent - string we compare our document to, must not be nullpublic void updateCompareFromDocument()
protected boolean getInternalState()
getInternalState in class AbstractSwingStateprotected void setReason()
setReason in class AbstractSwingStatepublic void insertUpdate(DocumentEvent pEvent)
insertUpdate in interface DocumentListenerpEvent - the document eventpublic void removeUpdate(DocumentEvent pEvent)
removeUpdate in interface DocumentListenerpEvent - the document eventpublic void changedUpdate(DocumentEvent pEvent)
changedUpdate in interface DocumentListenerpEvent - the document eventCopyright © 2017 Jürgen Zeller (privat). All rights reserved.