class LoadXMLAction
extends javax.swing.AbstractAction
| Modifier and Type | Field and Description |
|---|---|
private static Logger |
LOG
use to log messages
|
private javax.swing.JFileChooser |
mChooser
the file chooser - configured to allow only the selection of a
single file.
|
private XMLFileHandler |
mHandler
the content handler
|
private javax.swing.JFrame |
mParent
the parent frame
|
private org.xml.sax.XMLReader |
mParser
parser to read XML files
|
| Constructor and Description |
|---|
LoadXMLAction(javax.swing.JFrame aParent,
MyTableModel aModel)
Creates a new
LoadXMLAction instance. |
| Modifier and Type | Method and Description |
|---|---|
void |
actionPerformed(java.awt.event.ActionEvent aIgnore)
Prompts the user for a file to load events from.
|
private int |
loadFile(java.lang.String aFile)
Loads the contents of file into the model
|
private static final Logger LOG
private final javax.swing.JFrame mParent
private final javax.swing.JFileChooser mChooser
private final org.xml.sax.XMLReader mParser
private final XMLFileHandler mHandler
LoadXMLAction(javax.swing.JFrame aParent,
MyTableModel aModel)
throws org.xml.sax.SAXException,
javax.xml.parsers.ParserConfigurationException
LoadXMLAction instance.aParent - the parent frameaModel - the model to add events toorg.xml.sax.SAXException - if an error occursjavax.xml.parsers.ParserConfigurationException - if an error occurspublic void actionPerformed(java.awt.event.ActionEvent aIgnore)
aIgnore - an ActionEvent valueprivate int loadFile(java.lang.String aFile)
throws org.xml.sax.SAXException,
java.io.IOException
aFile - the file to extract events fromorg.xml.sax.SAXException - if an error occursjava.io.IOException - if an error occurs