4,10 → 4,10 |
* Coded by: Group 5, software practice summer 2003 |
* University of Bielefeld, Germany |
* |
* @version $Revision: 1.57 $ |
* @version $Revision: 1.55 $ |
* |
* Last modification: $Date: 2003/07/28 13:20:45 $ |
* $Id: UpdateView.java,v 1.57 2003/07/28 13:20:45 smcsporr Exp $ |
* Last modification: $Date: 2003/07/26 10:49:32 $ |
* $Id: UpdateView.java,v 1.55 2003/07/26 10:49:32 smcsporr Exp $ |
*/ |
|
package src.gui; |
39,7 → 39,6 |
import src.control.DocumentManagerInterface; |
import src.document.ViewFilter; |
import src.parser.AdapterDomToTreeModel; |
import src.parser.Validator; |
import src.plugins.PluginManagerInterface; |
|
/** |
47,7 → 46,7 |
* |
* @author Christian Stollenwerk |
* |
* @version $Revision: 1.57 $ Last modification: $Date: 2003/07/28 13:20:45 $ |
* @version $Revision: 1.55 $ Last modification: $Date: 2003/07/26 10:49:32 $ |
*/ |
public class UpdateView implements ActionListener, UpdateViewInterface, |
OurEventListener, TreeModelListener, TreeExpansionListener, TreeSelectionListener { |
67,12 → 66,6 |
private LinkedList treeVisibleList; |
private boolean makeTreeView = false; |
|
/** A validator is needed to check, if the current document confirms to it's grammar. */ |
private Validator validator = new Validator(logInterface, gui.getStatusInterface()); |
|
/** |
* Empty constructor. |
*/ |
public UpdateView() { |
} |
|
386,34 → 379,23 |
|
} |
|
/** |
* <code>validate</code> checks, if a document confirms to it's grammar. |
* |
* A document doesn't confirm to it's grammar, if an error or fatal error |
* occurs during validation. The <code>Validator</code> class supplies |
* functionality to process a document, if a grammar has been specified. |
* |
* @see src.parser.Validator |
*/ |
// TODO comments |
private void validate() { |
/* Check if the document is valid. */ |
src.parser.Validator validator = new src.parser.Validator(logInterface, gui.getStatusInterface()); |
|
/* Update the document with the content of the plugin */ |
pluginManagerInterface.forcePluginReport(); |
|
/* Check, if a grammar has been specified. */ |
if ((documentManagerInterface.getActualDocument().getDocumentElement().hasAttribute("xsi:schemaLocation")) || |
(documentManagerInterface.getActualDocument().getDoctype() != null)) { |
|
/* Check, if the current document is valid. */ |
if (validator.validateDocument(documentManagerInterface.getActualDocument(), |
documentManagerInterface.getActualDocumentFile())) { |
logInterface.log(LogInterface.TYPE_INFO, "The document is valid"); |
logInterface.log(LogInterface.TYPE_INFO, "The document is valid"); |
} |
|
/* Not valid -> Print an error message. */ |
else { |
logInterface.log(LogInterface.TYPE_ERROR, |
"The document does not fit to the specified grammar"); |
logInterface.log(LogInterface.TYPE_ERROR, "The document does not fit to the specified grammar"); |
} |
|
/* No grammar -> Print an error message. */ |