Package jmri.implementation
Class JmriConfigurationManager
java.lang.Object
jmri.implementation.JmriConfigurationManager
- All Implemented Interfaces:
ConfigureManager
- Direct Known Subclasses:
AppsConfigurationManager
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidderegister(Object o) protected voiddisplayErrorListDialog(Object list) Provide a method-specific way of locating a file to be loaded from a name.findInstance(Class<?> c, int index) Find the ith instance of an object of particular class that's been registered for storage.getInstanceList(Class<?> c) Returns a list of instances stored for a given class.Get the scope of validation of XML files when loading.protected voidprotected voidprotected booleanbooleanCreate the objects defined in a particular configuration filebooleanCreate the objects defined in a particular configuration filebooleanCreate the objects defined in a particular configuration filebooleanCreate the objects defined in a particular configuration filebooleanloadDeferred(File file) Create the objects defined in a particular configuration file that have been deferred until after basic GUI construction completedbooleanloadDeferred(URL file) Create the objects defined in a particular configuration file that have been deferred until after basic GUI construction completedbooleanmakeBackup(File file) Make a backup file.voidvoidregisterConfig(Object o, int x) voidvoidvoidvoidvoidvoidControl the scope of validation of XML files when loading.booleanstoreConfig(File file) Stores just configuration information.voidSave preferences.voidstorePrefs(File file) Save preferences.booleanStores user and config information.voidstoreUserPrefs(File file) Stores just user preferences information.
-
Constructor Details
-
JmriConfigurationManager
public JmriConfigurationManager()
-
-
Method Details
-
registerPref
- Specified by:
registerPrefin interfaceConfigureManager
-
removePrefItems
- Specified by:
removePrefItemsin interfaceConfigureManager
-
registerConfig
- Specified by:
registerConfigin interfaceConfigureManager
-
registerConfig
- Specified by:
registerConfigin interfaceConfigureManager
-
registerTool
- Specified by:
registerToolin interfaceConfigureManager
-
registerUser
- Specified by:
registerUserin interfaceConfigureManager
-
registerUserPrefs
- Specified by:
registerUserPrefsin interfaceConfigureManager
-
deregister
- Specified by:
deregisterin interfaceConfigureManager
-
findInstance
Description copied from interface:ConfigureManagerFind the ith instance of an object of particular class that's been registered for storage.Note that the index of an object can change when other objects are stored or removed. The index is for indexing over the objects stored at a moment, not for use as an identification number.
There may be synchronization issues associated with this, although they are expected to be rare in practice.
- Specified by:
findInstancein interfaceConfigureManager- Parameters:
c- Class of the desired objectsindex- a 1-based index of the object to return- Returns:
- an object of class c or null
-
getInstanceList
Description copied from interface:ConfigureManagerReturns a list of instances stored for a given class.- Specified by:
getInstanceListin interfaceConfigureManager- Parameters:
c- Class of the desired objects- Returns:
- an List of objects of class c or null
-
storePrefs
Save preferences. Preferences are saved using either theJmriConfigurationProviderorJmriPreferencesProvideras appropriate to the register preferences handler.- Specified by:
storePrefsin interfaceConfigureManager
-
storePrefs
Save preferences. This method callsstorePrefs().- Specified by:
storePrefsin interfaceConfigureManager- Parameters:
file- Ignored.
-
storeUserPrefs
Description copied from interface:ConfigureManagerStores just user preferences information.- Specified by:
storeUserPrefsin interfaceConfigureManager- Parameters:
file- the file to store user preferences into
-
storeConfig
Description copied from interface:ConfigureManagerStores just configuration information.- Specified by:
storeConfigin interfaceConfigureManager- Parameters:
file- Output file- Returns:
- true if successful; false otherwise
-
storeUser
Description copied from interface:ConfigureManagerStores user and config information.- Specified by:
storeUserin interfaceConfigureManager- Parameters:
file- Output file- Returns:
- true if succeeded
-
load
Description copied from interface:ConfigureManagerCreate the objects defined in a particular configuration file- Specified by:
loadin interfaceConfigureManager- Parameters:
file- Input file- Returns:
- true if succeeded
- Throws:
JmriException- if unable to load file due to internal error
-
load
Description copied from interface:ConfigureManagerCreate the objects defined in a particular configuration file- Specified by:
loadin interfaceConfigureManager- Parameters:
url- Input URL- Returns:
- true if succeeded
- Throws:
JmriException- if unable to load URL due to internal error
-
load
Description copied from interface:ConfigureManagerCreate the objects defined in a particular configuration file- Specified by:
loadin interfaceConfigureManager- Parameters:
file- Input fileregisterDeferred- true to register actions for deferred load- Returns:
- true if succeeded
- Throws:
JmriException- if problem during load
-
load
Description copied from interface:ConfigureManagerCreate the objects defined in a particular configuration file- Specified by:
loadin interfaceConfigureManager- Parameters:
url- Input URLregisterDeferred- true to register actions for deferred load- Returns:
- true if succeeded
- Throws:
JmriException- if problem during load
-
displayErrorListDialog
-
isEditDialogRestart
-
handleRestart
-
handleQuit
-
loadDeferred
Description copied from interface:ConfigureManagerCreate the objects defined in a particular configuration file that have been deferred until after basic GUI construction completed- Specified by:
loadDeferredin interfaceConfigureManager- Parameters:
file- Input file- Returns:
- true if succeeded
- See Also:
-
loadDeferred
Description copied from interface:ConfigureManagerCreate the objects defined in a particular configuration file that have been deferred until after basic GUI construction completed- Specified by:
loadDeferredin interfaceConfigureManager- Parameters:
file- Input URL- Returns:
- true if succeeded
- See Also:
-
find
Description copied from interface:ConfigureManagerProvide a method-specific way of locating a file to be loaded from a name.- Specified by:
findin interfaceConfigureManager- Parameters:
filename- Local filename, perhaps without path information- Returns:
- Corresponding
URL
-
makeBackup
Description copied from interface:ConfigureManagerMake a backup file.- Specified by:
makeBackupin interfaceConfigureManager- Parameters:
file- to be backed up- Returns:
- true if successful
-
getInitializationExceptions
-
setValidate
Description copied from interface:ConfigureManagerControl the scope of validation of XML files when loading.- Specified by:
setValidatein interfaceConfigureManager- Parameters:
v- the validation scope
-
getValidate
Description copied from interface:ConfigureManagerGet the scope of validation of XML files when loading.- Specified by:
getValidatein interfaceConfigureManager- Returns:
- the validation scope
-