001// License: GPL. For details, see LICENSE file. 002package org.openstreetmap.josm.gui.preferences.server; 003 004import static org.openstreetmap.josm.tools.I18n.tr; 005 006import javax.swing.text.JTextComponent; 007 008import org.openstreetmap.josm.gui.widgets.DefaultTextComponentValidator; 009 010/** 011 * Validator for OSM username. 012 */ 013public class UserNameValidator extends DefaultTextComponentValidator { 014 015 /** 016 * Constructs a new {@code UserNameValidator}. 017 * @param tc the text component used to enter username 018 */ 019 public UserNameValidator(JTextComponent tc) { 020 super(tc, tr("Please enter your OSM user name"), tr("The user name cannot be empty. Please enter your OSM user name")); 021 } 022}