RSE Validator Sample Four

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.core.ui.validators.ValidatorIntegerRangeInput;
import org.eclipse.rse.samples.*;

/**
 * An example of a customized validator, that prompts for a birth day.
 */
public class SampleBirthDayValidator extends ValidatorIntegerRangeInput
{
	/**
	 * Constructor. Specifies the valid range, and unique error messages.
	 */
	public SampleBirthDayValidator()
	{
		super(1, 31);
		super.setErrorMessages(SamplesPlugin.getPluginMessage("SPPD1007"), // empty
		                       SamplesPlugin.getPluginMessage("SPPD1008"), // non-numeric
                                       SamplesPlugin.getPluginMessage("SPPD1009")); // out of range
	}

}