com.sdm.quasar.client.swing.states
Class DocumentTextAcceptedBooleanState
java.lang.Object
com.sdm.quasar.client.core.states.AbstractState
com.sdm.quasar.client.core.states.AbstractBooleanState
com.sdm.quasar.client.swing.states.DocumentTextAcceptedBooleanState
- All Implemented Interfaces:
- BooleanState, Disposable, javax.swing.event.DocumentListener, java.util.EventListener, State
- public class DocumentTextAcceptedBooleanState
- extends AbstractBooleanState
- implements BooleanState, javax.swing.event.DocumentListener
The BooleanState is true if the text of the Document
is accepted by a given Acceptor.
For convenience an acceptor with pattern matching is used to compare the text of
the document with a pattern.
- Author:
- Martin Haft
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.sdm.quasar.client.core.common.Disposable |
dispose |
DocumentTextAcceptedBooleanState
public DocumentTextAcceptedBooleanState(javax.swing.text.Document document,
java.lang.String pattern)
- Constructs the
BooleanState
representing the matching of the document text with the given pattern.
- Parameters:
document - the Document whose text is compared wit the given patternpattern - the pattern the documetns text is compared with
DocumentTextAcceptedBooleanState
public DocumentTextAcceptedBooleanState(javax.swing.text.Document document,
Acceptor acceptor)
- Constructs the
BooleanState
representing the acceptance of the document text with an Acceptor.
- Parameters:
document - the Document whose text is compared wit the given patternacceptor - An Acceptor that checks if the text of the document is accepted.
DocumentTextAcceptedBooleanState
public DocumentTextAcceptedBooleanState(javax.swing.text.Document document,
java.lang.String pattern,
java.lang.String name)
- Constructs the
BooleanState
representing the matching of the document text with the given pattern.
- Parameters:
document - the Document whose text is compared wit the given patternpattern - the pattern the documetns text is compared withname - name of the state
DocumentTextAcceptedBooleanState
public DocumentTextAcceptedBooleanState(javax.swing.text.Document document,
Acceptor acceptor,
java.lang.String name)
- Constructs the
BooleanState
representing the acceptance of the document text with an Acceptor.
- Parameters:
document - the Document whose text is compared wit the given patternacceptor - An Acceptor that checks if the text of the document is accepted.name - name of the state
insertUpdate
public void insertUpdate(javax.swing.event.DocumentEvent e)
- Specified by:
insertUpdate in interface javax.swing.event.DocumentListener
removeUpdate
public void removeUpdate(javax.swing.event.DocumentEvent e)
- Specified by:
removeUpdate in interface javax.swing.event.DocumentListener
changedUpdate
public void changedUpdate(javax.swing.event.DocumentEvent e)
- Specified by:
changedUpdate in interface javax.swing.event.DocumentListener
checkAcceptance
protected boolean checkAcceptance()
- Checks if the text of the document is accepted by the
Acceptor of this state.
- Returns:
- true if the text of the documet is accepted