1 /******************************************************************************* 2 * Copyright (c) 2000, 2006 IBM Corporation and others. 3 * All rights reserved. This program and the accompanying materials 4 * are made available under the terms of the Eclipse Public License v1.0 5 * which accompanies this distribution, and is available at 6 * http://www.eclipse.org/legal/epl-v10.html 7 * 8 * Contributors: 9 * IBM Corporation - initial API and implementation 10 *******************************************************************************/ 11 package org.eclipse.jface.dialogs; 12 13 /** 14 * The IInputValidator is the interface for simple validators. 15 * @see org.eclipse.jface.dialogs.InputDialog 16 */ 17 public interface IInputValidator { 18 /** 19 * Validates the given string. Returns an error message to display 20 * if the new text is invalid. Returns <code>null</code> if there 21 * is no error. Note that the empty string is not treated the same 22 * as <code>null</code>; it indicates an error state but with no message 23 * to display. 24 * 25 * @param newText the text to check for validity 26 * 27 * @return an error message or <code>null</code> if no error 28 */ 29 public String isValid(String newText); 30 } 31