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:
ActionListener,FocusListener,PropertyChangeListener,EventListener,DocumentListener
- Direct Known Subclasses:
ManualAuthorizationUI.AccessTokenKeyValidator,UserNameValidator
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
FieldsFields 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
ConstructorsConstructorDescriptionDefaultTextComponentValidator(JTextComponent tc, String validFeedback, String invalidFeedback) Constructs a newDefaultTextComponentValidator. -
Method Summary
Methods inherited from class org.openstreetmap.josm.gui.widgets.AbstractTextComponentValidator
actionPerformed, changedUpdate, feedbackDisabled, feedbackInvalid, feedbackValid, feedbackWarning, focusGained, focusLost, getComponent, insertUpdate, propertyChange, removeUpdateMethods inherited from class org.openstreetmap.josm.gui.util.ChangeNotifier
addChangeListener, fireStateChanged, removeChangeListener
-
Field Details
-
validFeedback
-
invalidFeedback
-
-
Constructor Details
-
DefaultTextComponentValidator
public DefaultTextComponentValidator(JTextComponent tc, String validFeedback, 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 Details
-
isValid
Description copied from class:AbstractTextComponentValidatorReplies true if the current content of the decorated text component is valid; false otherwise- Specified by:
isValidin classAbstractTextComponentValidator- Returns:
- true if the current content of the decorated text component is valid
-
validate
Description copied from class:AbstractTextComponentValidatorImplement in subclasses to validate the content of the text component.- Specified by:
validatein classAbstractTextComponentValidator
-