Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

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
	}

}



 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire