Package jmri.configurexml
Class LoadXmlConfigAction
- java.lang.Object
-
- javax.swing.AbstractAction
-
- jmri.configurexml.LoadStoreBaseAction
-
- jmri.configurexml.LoadXmlConfigAction
-
- All Implemented Interfaces:
java.awt.event.ActionListener
,java.io.Serializable
,java.lang.Cloneable
,java.util.EventListener
,javax.swing.Action
- Direct Known Subclasses:
LoadXmlUserAction
public class LoadXmlConfigAction extends LoadStoreBaseAction
Load configuration information from an XML file.The file context for this is the "config" file chooser.
This will load whatever information types are present in the file. See
ConfigureManager
for information on the various types of information stored in configuration files.- See Also:
XmlFile
, Serialized Form
-
-
Constructor Summary
Constructors Constructor Description LoadXmlConfigAction()
LoadXmlConfigAction(java.lang.String s)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
actionPerformed(java.awt.event.ActionEvent e)
static java.io.File
getFile(javax.swing.JFileChooser fileChooser)
Deprecated, for removal: This API element is subject to removal in a future version.static java.io.File
getFile(javax.swing.JFileChooser fileChooser, java.awt.Component component)
Get the File from an Open File JFileChooser.static java.io.File
getFileCustom(javax.swing.JFileChooser fileChooser)
Deprecated, for removal: This API element is subject to removal in a future version.static java.io.File
getFileCustom(javax.swing.JFileChooser fileChooser, java.awt.Component component)
Get the File from a JFileChooser.protected boolean
loadFile(javax.swing.JFileChooser fileChooser, java.awt.Component component)
Load a File from a given JFileChooser.-
Methods inherited from class jmri.configurexml.LoadStoreBaseAction
getAllFileChooser, getConfigFileChooser, getUserFileChooser
-
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
-
-
-
-
Constructor Detail
-
LoadXmlConfigAction
public LoadXmlConfigAction()
-
LoadXmlConfigAction
public LoadXmlConfigAction(java.lang.String s)
-
-
Method Detail
-
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent e)
-
loadFile
protected boolean loadFile(@Nonnull javax.swing.JFileChooser fileChooser, @CheckForNull java.awt.Component component)
Load a File from a given JFileChooser.- Parameters:
fileChooser
-JFileChooser
to use for file selectioncomponent
- a Component which has called the File Chooser.- Returns:
- true if successful
-
getFile
@CheckForNull @Deprecated(since="5.7.8", forRemoval=true) public static java.io.File getFile(@Nonnull javax.swing.JFileChooser fileChooser)
Deprecated, for removal: This API element is subject to removal in a future version.Get the File from a given JFileChooser.- Parameters:
fileChooser
- the JFileChooser for the file.- Returns:
- the selected File.
-
getFile
@CheckForNull public static java.io.File getFile(@Nonnull javax.swing.JFileChooser fileChooser, @CheckForNull java.awt.Component component)
Get the File from an Open File JFileChooser. If a Component is provided, this helps the JFileChooser to not get stuck behind an Always On Top Window.- Parameters:
fileChooser
- the FileChooser to get from.component
- a Component within a JFrame / Window / Popup Menu, or the JFrame or Window itself.- Returns:
- the File, may be null if none selected.
-
getFileCustom
@CheckForNull @Deprecated(since="5.7.8", forRemoval=true) public static java.io.File getFileCustom(@Nonnull javax.swing.JFileChooser fileChooser)
Deprecated, for removal: This API element is subject to removal in a future version.- Parameters:
fileChooser
- the FileChooser to get from.- Returns:
- the selected File.
-
getFileCustom
@CheckForNull public static java.io.File getFileCustom(@Nonnull javax.swing.JFileChooser fileChooser, @CheckForNull java.awt.Component component)
Get the File from a JFileChooser. If a Component is provided, this helps the JFileChooser to not get stuck behind an Always On Top Window.- Parameters:
fileChooser
- the FileChooser to get from.component
- a Component within a JFrame / Window / Popup Menu, or the JFrame or Window itself.- Returns:
- the File, may be null if none selected.
-
-