Package jmri.configurexml
Class StoreAndCompare
- java.lang.Object
-
- javax.swing.AbstractAction
-
- jmri.configurexml.StoreAndCompare
-
- All Implemented Interfaces:
java.awt.event.ActionListener
,java.io.Serializable
,java.lang.Cloneable
,java.util.EventListener
,javax.swing.Action
public class StoreAndCompare extends javax.swing.AbstractAction
Determine if there have been changes made to the PanelPro data. If so, then a prompt will be displayed to store the data before the JMRI shutdown process proceeds.If the JMRI application is DecoderPro, the checking does not occur. If the PanelPro tables contain only 3 time related beans and no panels, the checking does not occur.
The main check process uses the checkFile process which is used by the load and store tests. The current configuration is stored to a temporary file. This temp file is compared to the file that was loaded manually or via a start up action. If there are differences and the shutdown store check preference is enabled, a store request prompt is displayed. The prompt does not occur when running in headless mode.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description StoreAndCompare()
StoreAndCompare(java.lang.String s)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
actionPerformed(java.awt.event.ActionEvent e)
static boolean
checkFile(java.io.File inFile1, java.io.File inFile2)
static boolean
checkPermissionToStoreIfNeeded()
Check if data has changed and if so, if the user has permission to store.static boolean
dataHasChanged()
static void
requestStoreIfNeeded()
-
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
-
-
-
-
Constructor Detail
-
StoreAndCompare
public StoreAndCompare()
-
StoreAndCompare
public StoreAndCompare(java.lang.String s)
-
-
Method Detail
-
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent e)
-
checkPermissionToStoreIfNeeded
public static boolean checkPermissionToStoreIfNeeded()
Check if data has changed and if so, if the user has permission to store.- Returns:
- true if user wants to abort shutdown, false otherwise
-
requestStoreIfNeeded
public static void requestStoreIfNeeded()
-
dataHasChanged
public static boolean dataHasChanged()
-
checkFile
public static boolean checkFile(java.io.File inFile1, java.io.File inFile2) throws java.lang.Exception
- Throws:
java.lang.Exception
-
-