KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > pde > internal > ui > editor > validation > IControlValidator


1 /*******************************************************************************
2  * Copyright (c) 2006, 2007 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
12 package org.eclipse.pde.internal.ui.editor.validation;
13
14 import org.eclipse.swt.widgets.Control;
15
16 /**
17  * IControlValdiator
18  *
19  */

20 public interface IControlValidator {
21     
22     /**
23      * Enable / disable the validator.
24      * @param enabled
25      */

26     public void setEnabled(boolean enabled);
27     
28     /**
29      * Determine whether the validator is enabled / disabled
30      * @return
31      */

32     public boolean getEnabled();
33     
34     /**
35      * Validate the control (manual validation).
36      * @return
37      */

38     public boolean validate();
39     
40     /**
41      * Get the control that this validator validates.
42      * @return
43      */

44     public Control getControl();
45     
46     /**
47      * Determine whether the control contents are valid. No validation is
48      * done. Validity is determined by the last time the control was validated
49      * @return
50      */

51     public boolean isValid();
52     
53     /**
54      * Reset the validator. Clear error messages and reset state.
55      */

56     public void reset();
57     
58     /**
59      * Controls whether the message handler automatically updates messages in
60      * the form. Setting the refresh to true, triggers an immediate update
61      * @param refresh
62      */

63     public void setRefresh(boolean refresh);
64     
65 }
66
Popular Tags