blob: 23fdb97f25581e78c0181c5e08c46b3e46b74755 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">
<meta name="copyright" content="Copyright (c) IBM Corporation and others 2002, 2006. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page." >
<LINK REL="STYLESHEET" HREF="../../../book.css" TYPE="text/css">
<title>RSE Validator Sample Four</title>
</head>
<body bgcolor="#ffffff">
<h1>RSE Validator Sample Four</h1>
<p>This is an example of a validator written by extending an existing RSE-supplied validator, and
simply supplying unique messages.
<pre>
package org.eclipse.rse.samples.ui.frameworks.dialogs;
import org.eclipse.rse.core.ui.validators.ValidatorIntegerRangeInput;
import org.eclipse.rse.samples.*;
/**
* <I>An example of a customized validator, that prompts for a birth day.</I>
*/
public class <B>SampleBirthDayValidator</B> extends ValidatorIntegerRangeInput
{
/**
* <I>Constructor. Specifies the valid range, and unique error messages</I>.
*/
public SampleBirthDayValidator()
{
super(1, 31);
super.setErrorMessages(SamplesPlugin.<A
href="../messages/uiMessageAPI.html#getPluginMessage">getPluginMessage</A>(&quot;<A
href="../messages/sampleMessageFile.html#SPPD1007">SPPD1007</A>&quot;), // <I>empty</I>
SamplesPlugin.getPluginMessage(&quot;<A
href="../messages/sampleMessageFile.html#SPPD1008">SPPD1008</A>&quot;), // <I>non-numeric</I>
SamplesPlugin.getPluginMessage(&quot;<A
href="../messages/sampleMessageFile.html#SPPD1009">SPPD1009</A>&quot;)); // <I>out of range</I>
}
}</pre>
<P><BR></P>
</body>
</html>