Package jmri.jmrit.decoderdefn
Class InstallDecoderURLAction
- java.lang.Object
-
- javax.swing.AbstractAction
-
- jmri.util.swing.JmriAbstractAction
-
- jmri.jmrit.decoderdefn.InstallDecoderURLAction
-
- All Implemented Interfaces:
java.awt.event.ActionListener
,java.io.Serializable
,java.lang.Cloneable
,java.util.EventListener
,javax.swing.Action
- Direct Known Subclasses:
InstallDecoderFileAction
public class InstallDecoderURLAction extends JmriAbstractAction
Install decoder definition from URL- See Also:
XmlFile
, Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description (package private) javax.swing.JPanel
_who
-
Fields inherited from class jmri.util.swing.JmriAbstractAction
context, hint, wi
-
-
Constructor Summary
Constructors Constructor Description InstallDecoderURLAction(java.lang.String s)
InstallDecoderURLAction(java.lang.String s, javax.swing.Icon i, WindowInterface wi)
InstallDecoderURLAction(java.lang.String s, javax.swing.JPanel who)
InstallDecoderURLAction(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)
(package private) boolean
checkFile(java.net.URL url, javax.swing.JPanel who)
(package private) void
copyAndInstall(java.net.URL from, javax.swing.JPanel who)
(package private) boolean
copyfile(java.net.URL from, java.io.File toFile, javax.swing.JPanel who)
JmriPanel
makePanel()
(package private) java.net.URL
pickURL(javax.swing.JPanel who)
(package private) org.jdom2.Element
readFile(java.net.URL url)
Read and verify an XML file.-
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
-
-
-
-
Field Detail
-
_who
javax.swing.JPanel _who
-
-
Constructor Detail
-
InstallDecoderURLAction
public InstallDecoderURLAction(java.lang.String s, WindowInterface wi)
-
InstallDecoderURLAction
public InstallDecoderURLAction(java.lang.String s, javax.swing.Icon i, WindowInterface wi)
-
InstallDecoderURLAction
public InstallDecoderURLAction(java.lang.String s)
-
InstallDecoderURLAction
public InstallDecoderURLAction(java.lang.String s, javax.swing.JPanel who)
-
-
Method Detail
-
pickURL
java.net.URL pickURL(javax.swing.JPanel who)
-
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent e)
- Specified by:
actionPerformed
in interfacejava.awt.event.ActionListener
- Overrides:
actionPerformed
in classJmriAbstractAction
-
copyAndInstall
void copyAndInstall(java.net.URL from, javax.swing.JPanel who)
-
copyfile
boolean copyfile(java.net.URL from, java.io.File toFile, javax.swing.JPanel who)
-
checkFile
boolean checkFile(java.net.URL url, javax.swing.JPanel who)
-
readFile
org.jdom2.Element readFile(java.net.URL url) throws org.jdom2.JDOMException, java.io.IOException
Read and verify an XML file.- Parameters:
url
- the URL of the file- Returns:
- the root element in the file
- Throws:
org.jdom2.JDOMException
- if the file cannot be parsedjava.io.IOException
- if the file cannot be read
-
makePanel
public JmriPanel makePanel()
- Specified by:
makePanel
in classJmriAbstractAction
-
-