Package jmri.configurexml
Class LoadXmlConfigAction
java.lang.Object
javax.swing.AbstractAction
jmri.configurexml.LoadStoreBaseAction
jmri.configurexml.LoadXmlConfigAction
- All Implemented Interfaces:
ActionListener,Serializable,Cloneable,EventListener,Action
- Direct Known Subclasses:
LoadXmlUserAction
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:
-
Field Summary
Fields inherited from class javax.swing.AbstractAction
changeSupport, enabledFields inherited from interface javax.swing.Action
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidstatic FilegetFile(JFileChooser fileChooser) Deprecated, for removal: This API element is subject to removal in a future version.static FilegetFile(JFileChooser fileChooser, Component component) Get the File from an Open File JFileChooser.static FilegetFileCustom(JFileChooser fileChooser) Deprecated, for removal: This API element is subject to removal in a future version.static FilegetFileCustom(JFileChooser fileChooser, Component component) Get the File from a JFileChooser.protected booleanloadFile(JFileChooser fileChooser, Component component) Load a File from a given JFileChooser.Methods inherited from class jmri.configurexml.LoadStoreBaseAction
getAllFileChooser, getConfigFileChooser, getUserFileChooserMethods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
-
Constructor Details
-
LoadXmlConfigAction
public LoadXmlConfigAction() -
LoadXmlConfigAction
-
-
Method Details
-
actionPerformed
-
loadFile
Load a File from a given JFileChooser.- Parameters:
fileChooser-JFileChooserto 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 File getFile(@Nonnull 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 File getFile(@Nonnull JFileChooser fileChooser, @CheckForNull 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 File getFileCustom(@Nonnull 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 File getFileCustom(@Nonnull JFileChooser fileChooser, @CheckForNull 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.
-
getFile(JFileChooser fileChooser, Component component)