Class ProgrammerConfigManager
- java.lang.Object
-
- jmri.beans.UnboundBean
-
- jmri.beans.Bean
-
- jmri.util.prefs.AbstractPreferencesManager
-
- jmri.jmrit.symbolicprog.ProgrammerConfigManager
-
- All Implemented Interfaces:
BeanInterface
,PropertyChangeFirer
,PropertyChangeProvider
,JmriServiceProviderInterface
,PreferencesManager
public class ProgrammerConfigManager extends AbstractPreferencesManager
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
CAN_CACHE_DEFAULT
static java.lang.String
DEFAULT_FILE
static java.lang.String
DO_CONFIRM_READ
static java.lang.String
SHOW_CV_NUMBERS
static java.lang.String
SHOW_EMPTY_PANES
-
Fields inherited from class jmri.beans.Bean
propertyChangeSupport
-
-
Constructor Summary
Constructors Constructor Description ProgrammerConfigManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getDefaultFile()
java.util.Set<java.lang.Class<?>>
getProvides()
Get the set of Classes that this PreferencesManager can be registered as a provider of in theInstanceManager
.java.util.Set<java.lang.Class<? extends PreferencesManager>>
getRequires()
Get the set of PreferencesManagers that must be initialized prior to initializing this PreferencesManager.void
initialize(Profile profile)
Initialize the PreferencesManager with preferences associated with the provided Profile.boolean
isCanCacheDefault()
boolean
isDoConfirmRead()
boolean
isShowCvNumbers()
boolean
isShowEmptyPanes()
void
savePreferences(Profile profile)
Save the preferences that this provider manages for the provided Profile.void
setCanCacheDefault(boolean canCacheDefault)
void
setDefaultFile(java.lang.String defaultFile)
void
setDoConfirmRead(boolean doConfirmRead)
void
setShowCvNumbers(boolean showCvNumbers)
void
setShowEmptyPanes(boolean showEmptyPanes)
-
Methods inherited from class jmri.util.prefs.AbstractPreferencesManager
addInitializationException, getInitializationExceptions, isInitialized, isInitializedWithExceptions, isInitializing, requireAllOther, requiresNoInitializedWithExceptions, requiresNoInitializedWithExceptions, setInitialized, setInitializing
-
Methods inherited from class jmri.beans.Bean
addPropertyChangeListener, addPropertyChangeListener, fireIndexedPropertyChange, fireIndexedPropertyChange, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getPropertyChangeListeners, getPropertyChangeListeners, isNotifyOnEDT, removePropertyChangeListener, removePropertyChangeListener
-
Methods inherited from class jmri.beans.UnboundBean
getIndexedProperty, getProperty, getPropertyNames, hasIndexedProperty, hasProperty, setIndexedProperty, setProperty
-
-
-
-
Field Detail
-
DEFAULT_FILE
public static final java.lang.String DEFAULT_FILE
- See Also:
- Constant Field Values
-
SHOW_EMPTY_PANES
public static final java.lang.String SHOW_EMPTY_PANES
- See Also:
- Constant Field Values
-
SHOW_CV_NUMBERS
public static final java.lang.String SHOW_CV_NUMBERS
- See Also:
- Constant Field Values
-
CAN_CACHE_DEFAULT
public static final java.lang.String CAN_CACHE_DEFAULT
- See Also:
- Constant Field Values
-
DO_CONFIRM_READ
public static final java.lang.String DO_CONFIRM_READ
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ProgrammerConfigManager
public ProgrammerConfigManager()
-
-
Method Detail
-
initialize
public void initialize(Profile profile) throws InitializationException
Description copied from interface:PreferencesManager
Initialize the PreferencesManager with preferences associated with the provided Profile.Implementing classes should throw an InitializationException with a user readable localized message, since it most likely be displayed to the user. Implementing classes will still want to ensure that
PreferencesManager.isInitialized(jmri.profile.Profile)
orPreferencesManager.isInitializedWithExceptions(jmri.profile.Profile)
return true if throwing an InitializationException to ensure that the provider is not repeatedly initialized.- Parameters:
profile
- the configuration profile used for this initialization; may be null to initialize for this user regardless of profile- Throws:
InitializationException
- if the user needs to be notified of an issue that prevents regular use of the application
-
getRequires
@Nonnull public java.util.Set<java.lang.Class<? extends PreferencesManager>> getRequires()
Description copied from class:AbstractPreferencesManager
Get the set of PreferencesManagers that must be initialized prior to initializing this PreferencesManager. It is generally preferable to require an Interface or an abstract Class instead of a concrete Class, since that allows all (or any) concrete implementations of the required class to be initialized to provide required services for the requiring PreferencesManager instance.Note that for any set of PreferencesManagers with the same requirements, or with a circular dependency between each other, the order in which the PreferencesManagers in that set are initialized should be considered non-deterministic.
This implementation includes a default dependency on the
ConnectionConfigManager
.- Specified by:
getRequires
in interfacePreferencesManager
- Overrides:
getRequires
in classAbstractPreferencesManager
- Returns:
- An set of classes; if there are no dependencies, return an empty set instead of null; overriding implementations may add to this set directly
-
getProvides
@Nonnull public java.util.Set<java.lang.Class<?>> getProvides()
Description copied from class:AbstractPreferencesManager
Get the set of Classes that this PreferencesManager can be registered as a provider of in theInstanceManager
.This implementation returns the class of the object against which this method is called.
- Specified by:
getProvides
in interfacePreferencesManager
- Overrides:
getProvides
in classAbstractPreferencesManager
- Returns:
- A set or list of classes. If this PreferencesManager provides an instance of no other Interfaces or abstract Classes than PreferencesManager, return an empty set instead of null.
-
savePreferences
public void savePreferences(Profile profile)
Description copied from interface:PreferencesManager
Save the preferences that this provider manages for the provided Profile.- Parameters:
profile
- the profile associated with the preferences to save; may be null to save preferences that apply to the current user regardless of profile
-
getDefaultFile
public java.lang.String getDefaultFile()
- Returns:
- the defaultFile
-
setDefaultFile
public void setDefaultFile(java.lang.String defaultFile)
- Parameters:
defaultFile
- the defaultFile to set
-
isShowEmptyPanes
public boolean isShowEmptyPanes()
- Returns:
- the showEmptyPanes
-
setShowEmptyPanes
public void setShowEmptyPanes(boolean showEmptyPanes)
- Parameters:
showEmptyPanes
- the showEmptyPanes to set
-
isShowCvNumbers
public boolean isShowCvNumbers()
- Returns:
- the showCvNumbers
-
setShowCvNumbers
public void setShowCvNumbers(boolean showCvNumbers)
- Parameters:
showCvNumbers
- the showCvNumbers to set
-
isCanCacheDefault
public boolean isCanCacheDefault()
- Returns:
- the canCacheDefault
-
setCanCacheDefault
public void setCanCacheDefault(boolean canCacheDefault)
- Parameters:
canCacheDefault
- new value
-
isDoConfirmRead
public boolean isDoConfirmRead()
- Returns:
- the doConfirmRead
-
setDoConfirmRead
public void setDoConfirmRead(boolean doConfirmRead)
- Parameters:
doConfirmRead
- new value
-
-