Package jmri.jmrit
Class XmlFileValidateAction
- java.lang.Object
-
- javax.swing.AbstractAction
-
- jmri.util.swing.JmriAbstractAction
-
- jmri.jmrit.XmlFileValidateAction
-
- All Implemented Interfaces:
java.awt.event.ActionListener
,java.io.Serializable
,java.lang.Cloneable
,java.util.EventListener
,javax.swing.Action
- Direct Known Subclasses:
XmlFileValidateRunner
public class XmlFileValidateAction extends JmriAbstractAction
Make sure an XML file is readable, and validates OK against its schema and DTD.Can also be run from the command line as apps.jmrit.XmlFileValidationAction (e.g. ./runtest.csh apps/jmrit/XmlFileValidateAction foo.xml) in which case if there's a filename argument, it checks that directly, otherwise it pops a file selection dialog. (The dialog form has to be manually canceled when done)
- See Also:
XmlFile
,XmlFileCheckAction
, Serialized Form
-
-
Field Summary
-
Fields inherited from class jmri.util.swing.JmriAbstractAction
context, hint, wi
-
-
Constructor Summary
Constructors Constructor Description XmlFileValidateAction()
XmlFileValidateAction(java.lang.String s, java.awt.Component who)
XmlFileValidateAction(java.lang.String s, WindowInterface wi)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
actionPerformed(java.awt.event.ActionEvent e)
JmriPanel
makePanel()
protected void
processFile(java.io.File file)
(package private) void
readFile(java.io.File file)
Read and verify a file is schema valid XML.protected void
showFailResults(java.awt.Component who, java.lang.String fileName, java.lang.String text)
protected void
showOkResults(java.awt.Component who, java.lang.String text)
-
Methods inherited from class jmri.util.swing.JmriAbstractAction
dispose, setContext, setHint, setName, setParameter, setParameter, setWindowInterface, toString
-
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
-
-
-
-
Constructor Detail
-
XmlFileValidateAction
public XmlFileValidateAction(java.lang.String s, java.awt.Component who)
-
XmlFileValidateAction
public XmlFileValidateAction(java.lang.String s, WindowInterface wi)
-
XmlFileValidateAction
public XmlFileValidateAction()
-
-
Method Detail
-
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent e)
- Specified by:
actionPerformed
in interfacejava.awt.event.ActionListener
- Overrides:
actionPerformed
in classJmriAbstractAction
-
processFile
protected void processFile(java.io.File file)
-
showOkResults
protected void showOkResults(java.awt.Component who, java.lang.String text)
-
showFailResults
protected void showFailResults(java.awt.Component who, java.lang.String fileName, java.lang.String text)
-
readFile
void readFile(java.io.File file) throws org.jdom2.JDOMException, java.io.IOException
Read and verify a file is schema valid XML.- Parameters:
file
- the file to read- Throws:
org.jdom2.JDOMException
- if file is not schema valid XMLjava.io.IOException
- if unable to read file
-
makePanel
public JmriPanel makePanel()
- Specified by:
makePanel
in classJmriAbstractAction
-
-