RSE Validator Sample Three

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 month.
 */
public class SampleBirthMonthValidator extends ValidatorIntegerRangeInput
{
	/**
	 * Constructor. Specifies the valid range, and unique error messages.
	 */
	public SampleBirthMonthValidator()
	{
		super(1, 12);
		super.setErrorMessages(SamplesPlugin.getPluginMessage("SPPD1004"), // empty
		                       SamplesPlugin.getPluginMessage("SPPD1005"), // non-numeric
                                       SamplesPlugin.getPluginMessage("SPPD1006")); // out of range
	}

}