RSE Validator Sample Two

This is an example of a validator written by extending an existing RSE-supplied validator, and simply supplying unique messages.


package org.eclipse.rse.samples.ui.frameworks.dialogs;
import org.eclipse.rse.ui.validators.ValidatorIntegerRangeInput;
import org.eclipse.rse.samples.*;

/**
 * An example of a customized validator, that prompts for a birth year.
 */
public class SampleBirthYearValidator extends ValidatorIntegerRangeInput
{
	/**
	 * Constructor. Specifies the valid range, and unique error messages.
	 */
	public SampleBirthYearValidator()
	{
		super(1900, 2003);
		super.setErrorMessages(SamplesPlugin.getPluginMessage("SPPD1001"),  // empty
		                       SamplesPlugin.getPluginMessage("SPPD1002"),  // non-numeric
                                       SamplesPlugin.getPluginMessage("SPPD1003")); // out of range
	}

}