01: /*******************************************************************************
02: * Copyright (c) 2000, 2006 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.ui.dialogs;
11:
12: /**
13: * For validating selections in some selection dialogs.
14: * <p>
15: * Clients should implement this interface to define specialized selection
16: * validators.
17: * </p>
18: */
19: public interface ISelectionValidator {
20: /**
21: * Returns a string indicating whether the given selection is valid. If the
22: * result is <code>null</code>, the selection is considered to be valid; if the result is
23: * non-empty, it contains the error message to be displayed to the user.
24: *
25: * @param selection the selection to be validated
26: * @return the error message, or <code>null</code> indicating
27: * that the value is valid
28: */
29: public String isValid(Object selection);
30: }
|