Package jmri.jmrix

Class AbstractConnectionConfig

    • Method Detail

      • checkInitDone

        protected abstract void checkInitDone()
        Complete connection adapter initialization, adding desired options to the Connection Configuration pane. Required action: set init to true. Optional actions:
        • fill in connectionNameField
        • add ActionListeners to config fields eg. systemPrefixField to update adapter after change by the user
      • isDirty

        public boolean isDirty()
        Determine if configuration needs to be written to disk.

        This default implementation always returns true to maintain the existing behavior.

        Specified by:
        isDirty in interface ConnectionConfig
        Returns:
        true if configuration need to be saved, false otherwise
      • isRestartRequired

        public boolean isRestartRequired()
        Determine if application needs to be restarted for configuration changes to be applied.

        The default implementation always returns true to maintain the existing behavior.

        Specified by:
        isRestartRequired in interface ConnectionConfig
        Returns:
        true if application needs to restart, false otherwise
      • setInstance

        protected abstract void setInstance()
        Load the adapter with an appropriate object unless it's already been set.
      • loadDetails

        public abstract void loadDetails​(javax.swing.JPanel details)
        Load the Swing widgets needed to configure this connection into a specified JPanel. Used during the configuration process to fill out the preferences window with content specific to this Connection type. The JPanel contents need to handle their own gets/sets to the underlying Connection content.
        Specified by:
        loadDetails in interface ConnectionConfig
        Parameters:
        details - the specific Swing object to be configured and filled
      • register

        public void register()
        Register the ConnectionConfig with the running JMRI process.

        At a minimum, is responsible for:

        • Registering this object with the ConfigurationManager for persistance, typically at the "Preferences" level
        • Adding this object to the default (@link ConnectionConfigManager}
        Specified by:
        register in interface ConnectionConfig