Class OsmIdTextField.OsmIdValidator
- java.lang.Object
-
- org.openstreetmap.josm.gui.util.ChangeNotifier
-
- org.openstreetmap.josm.gui.widgets.AbstractTextComponentValidator
-
- org.openstreetmap.josm.gui.widgets.OsmIdTextField.OsmIdValidator
-
- All Implemented Interfaces:
java.awt.event.ActionListener,java.awt.event.FocusListener,java.beans.PropertyChangeListener,java.util.EventListener,javax.swing.event.DocumentListener
- Enclosing class:
- OsmIdTextField
public static class OsmIdTextField.OsmIdValidator extends AbstractTextComponentValidator
Validator for an OSM primitive ID entered in aJTextComponent.
-
-
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.util.List<PrimitiveId>idsprivate OsmPrimitiveTypetype-
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 OsmIdValidator(javax.swing.text.JTextComponent tc)Constructs a newOsmIdTextField.OsmIdValidator
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanisValid()Replies true if the current content of the decorated text component is valid; false otherwisebooleanreadOsmIds()Reads the OSM primitive id(s)voidvalidate()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
-
ids
private final java.util.List<PrimitiveId> ids
-
type
private OsmPrimitiveType type
-
-
Constructor Detail
-
OsmIdValidator
public OsmIdValidator(javax.swing.text.JTextComponent tc)
Constructs a newOsmIdTextField.OsmIdValidator- Parameters:
tc- The text component to validate
-
-
Method Detail
-
isValid
public boolean 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
public void validate()
Description copied from class:AbstractTextComponentValidatorImplement in subclasses to validate the content of the text component.- Specified by:
validatein classAbstractTextComponentValidator
-
readOsmIds
public boolean readOsmIds()
Reads the OSM primitive id(s)- Returns:
- true if valid OSM objects IDs have been read, false otherwise
-
-