Class DefaultTextComponentValidator
- java.lang.Object
-
- org.openstreetmap.josm.gui.util.ChangeNotifier
-
- org.openstreetmap.josm.gui.widgets.AbstractTextComponentValidator
-
- org.openstreetmap.josm.gui.widgets.DefaultTextComponentValidator
-
- All Implemented Interfaces:
java.awt.event.ActionListener
,java.awt.event.FocusListener
,java.beans.PropertyChangeListener
,java.util.EventListener
,javax.swing.event.DocumentListener
- Direct Known Subclasses:
ManualAuthorizationUI.AccessTokenKeyValidator
,UserNameValidator
public class DefaultTextComponentValidator extends AbstractTextComponentValidator
Default text component validator that only checks that an input field is not empty.- Since:
- 10073
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.openstreetmap.josm.gui.widgets.AbstractTextComponentValidator
AbstractTextComponentValidator.Status
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
invalidFeedback
private java.lang.String
validFeedback
-
Fields inherited from class org.openstreetmap.josm.gui.widgets.AbstractTextComponentValidator
ERROR_BACKGROUND, ERROR_BORDER, ERROR_COLOR, VALID_BORDER, VALID_COLOR, WARNING_BACKGROUND, WARNING_BORDER, WARNING_COLOR, WARNING_FOREGROUND
-
-
Constructor Summary
Constructors Constructor Description DefaultTextComponentValidator(javax.swing.text.JTextComponent tc, java.lang.String validFeedback, java.lang.String invalidFeedback)
Constructs a newDefaultTextComponentValidator
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isValid()
Replies true if the current content of the decorated text component is valid; false otherwisevoid
validate()
Implement in subclasses to validate the content of the text component.-
Methods inherited from class org.openstreetmap.josm.gui.widgets.AbstractTextComponentValidator
actionPerformed, changedUpdate, feedbackDisabled, feedbackInvalid, feedbackValid, feedbackWarning, focusGained, focusLost, getComponent, insertUpdate, propertyChange, removeUpdate
-
Methods inherited from class org.openstreetmap.josm.gui.util.ChangeNotifier
addChangeListener, fireStateChanged, removeChangeListener
-
-
-
-
Field Detail
-
validFeedback
private final java.lang.String validFeedback
-
invalidFeedback
private final java.lang.String invalidFeedback
-
-
Constructor Detail
-
DefaultTextComponentValidator
public DefaultTextComponentValidator(javax.swing.text.JTextComponent tc, java.lang.String validFeedback, java.lang.String invalidFeedback)
Constructs a newDefaultTextComponentValidator
.- Parameters:
tc
- the text component. Must not be null.validFeedback
- text displayed for valid feedbackinvalidFeedback
- text displayed for invalid feedback
-
-
Method Detail
-
isValid
public boolean isValid()
Description copied from class:AbstractTextComponentValidator
Replies true if the current content of the decorated text component is valid; false otherwise- Specified by:
isValid
in classAbstractTextComponentValidator
- Returns:
- true if the current content of the decorated text component is valid
-
validate
public void validate()
Description copied from class:AbstractTextComponentValidator
Implement in subclasses to validate the content of the text component.- Specified by:
validate
in classAbstractTextComponentValidator
-
-