Package jmri.configurexml
Class StoreAndCompare
java.lang.Object
javax.swing.AbstractAction
jmri.configurexml.StoreAndCompare
- All Implemented Interfaces:
ActionListener,Serializable,Cloneable,EventListener,Action
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:
-
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 booleanstatic booleanCheck if data has changed and if so, if the user has permission to store.static booleanstatic booleanMethods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
-
Constructor Details
-
StoreAndCompare
public StoreAndCompare() -
StoreAndCompare
-
-
Method Details
-
actionPerformed
-
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
-
dataHasChanged
-
checkFile
- Throws:
Exception
-