Package jmri.managers

Class ManagerDefaultSelector

    • Method Detail

      • getDefault

        public java.lang.String getDefault​(java.lang.Class<?> managerClass)
        Return the userName of the system that provides the default instance for a specific class.
        Parameters:
        managerClass - the specific type, for example, TurnoutManager, for which a default system is desired
        Returns:
        userName of the system, or null if none set
      • setDefault

        public void setDefault​(java.lang.Class<?> managerClass,
                               java.lang.String userName)
        Record the userName of the system that provides the default instance for a specific class.

        To ensure compatibility of different preference versions, only classes that are current registered are preserved. This way, reading in an old file will just have irrelevant items ignored.

        Parameters:
        managerClass - the specific type, for example, TurnoutManager, for which a default system is desired
        userName - of the system, or null if none set
      • 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
      • isAllInternalDefaultsValid

        public boolean isAllInternalDefaultsValid()
        Check if having all defaults assigned to internal connections should be considered is valid in the presence of an external System Connection.
        Returns:
        true if having all internal defaults should be valid; false otherwise
      • setAllInternalDefaultsValid

        public void setAllInternalDefaultsValid​(boolean isAllInternalDefaultsValid)
        Set if having all defaults assigned to internal connections should be considered is valid in the presence of an external System Connection.
        Parameters:
        isAllInternalDefaultsValid - true if having all internal defaults should be valid; false otherwise