KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > pde > internal > ui > editor > IEditorValidator


1 /*******************************************************************************
2  * Copyright (c) 2005, 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.pde.internal.ui.editor;
12
13 /**
14  * IEditorValidator is used to validate fields in an editor
15  */

16 public interface IEditorValidator {
17
18     /**
19      * Indicates whether this validator is currently enabled.
20      * @return true if this validator is enabled.
21      */

22     public boolean isEnabled();
23     /**
24      * Sets the enabled state of this validator
25      * @param enable
26      */

27     public void setEnabled(boolean enable);
28     /**
29      * Validates the editor's field and updates the error
30      * stack if neccesary.
31      * @param revalidate
32      * @return true if this form object has a valid entry.
33      */

34     public boolean validate(boolean revalidate);
35     /**
36      * Validates the an object versus it's model.
37      * Message and Severity must be set/unset during this method.
38      * @return true if this form object has a valid entry.
39      */

40     public boolean inputValidates();
41     /**
42      * Returns the result of the last validation.
43      * @return the result of the last validation
44      */

45     public boolean markedInvalid();
46     /**
47      * Returns a message to the user indicating the problem
48      * with the validation
49      * @return the message
50      */

51     public String JavaDoc getMessage();
52     public void setMessage(String JavaDoc message);
53     /**
54      * Returns the severity (if any) of the form object's entry's
55      * validation result.
56      * @return severity
57      */

58     public int getSeverity();
59     public void setSeverity(int severity);
60     /**
61      * Returns the section in which the validator was instantiated
62      * @return section
63      */

64     public PDESection getSection();
65 }
66
Popular Tags