Class MongoDbConnectionPanel

    • Field Detail

      • m_ComboBoxConnections

        protected adams.gui.core.BaseComboBox m_ComboBoxConnections
        the combobox with the available connections.
      • m_TextURL

        protected adams.gui.core.BaseTextField m_TextURL
        the edit field for the database URL.
      • m_TextUser

        protected adams.gui.core.BaseTextField m_TextUser
        the edit field for the database user.
      • m_TextPassword

        protected JPasswordField m_TextPassword
        the edit field for the database password.
      • m_CheckBoxShowPassword

        protected adams.gui.core.BaseCheckBox m_CheckBoxShowPassword
        the checkbox for showing the password.
      • m_TextAuthDB

        protected adams.gui.core.BaseTextField m_TextAuthDB
        the edit field for the authentication DB.
      • m_ComboBoxLoggingLevel

        protected adams.gui.core.BaseComboBox m_ComboBoxLoggingLevel
        the combobox for the logging level.
      • m_CheckBoxConnectOnStartUp

        protected adams.gui.core.BaseCheckBox m_CheckBoxConnectOnStartUp
        the checkbox for connecting on startup.
      • m_ButtonMakeDefault

        protected adams.gui.core.BaseButton m_ButtonMakeDefault
        the button for making a connection the default one.
      • m_ButtonConnect

        protected adams.gui.core.BaseButton m_ButtonConnect
        the button connecting/disconnecting the database.
      • m_LabelStatus

        protected JLabel m_LabelStatus
        the label for status messages.
      • m_PanelParameters

        protected adams.gui.core.ParameterPanel m_PanelParameters
        for the parameters.
    • Constructor Detail

      • MongoDbConnectionPanel

        public MongoDbConnectionPanel()
    • Method Detail

      • initialize

        protected void initialize()
        For initializing members.
        Overrides:
        initialize in class adams.gui.core.BasePanel
      • getDefaultDatabaseConnection

        protected MongoDbConnection getDefaultDatabaseConnection()
        Returns the default database connection to use.
        Returns:
        the database connection
      • initGUI

        protected void initGUI()
        Initializes the GUI.
        Overrides:
        initGUI in class adams.gui.core.BasePanel
      • finishInit

        protected void finishInit()
        Finishes the initialization.
        Overrides:
        finishInit in class adams.gui.core.BasePanel
      • getTitle

        protected String getTitle()
        The title of the connection panel.
        Returns:
        the title
      • displayParameters

        protected void displayParameters​(MongoDbConnectionParameters conn)
        Displays the parameters.
        Parameters:
        conn - the parameters to display
      • displayParameters

        protected void displayParameters​(MongoDbConnection conn)
        Displays the parameters.
        Parameters:
        conn - the database connection to display
      • doReconnect

        protected void doReconnect()
        Performs the reconnection.
      • makeDefault

        protected void makeDefault()
        Makes the current parameters the default.
      • newConnectionParameters

        protected MongoDbConnectionParameters newConnectionParameters()
        Returns a new instance of a ConnectionParameters object.
        Returns:
        the empty parameters object
      • getCurrentParameters

        protected MongoDbConnectionParameters getCurrentParameters()
        Returns the current parameters as connection object.
        Returns:
        the current setup
      • getDatabaseConnection

        public MongoDbConnection getDatabaseConnection()
        Returns the currently used database connection object, can be null.
        Returns:
        the current object
      • update

        public void update()
        updates the enabled state content etc. of all the GUI elements, based on the DatabaseConnection object of the scripting engine.
      • setEnabledState

        protected void setEnabledState​(boolean b)
        Sets the enabled state of the parameters.
        Parameters:
        b - if true then the parameters will be enabled
      • setEnabled

        public void setEnabled​(boolean b)
        Sets the enabled state of the panel.
        Overrides:
        setEnabled in class JComponent
        Parameters:
        b - if true then the panel will be enabled
      • showStatus

        public void showStatus​(String msg)
        Displays a message.
        Specified by:
        showStatus in interface adams.core.StatusMessageHandler
        Parameters:
        msg - the message to display
      • compareTo

        public int compareTo​(MongoDbConnectionPanel o)
        Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object. Merely uses the title of the panels for comparison.
        Specified by:
        compareTo in interface Comparable<MongoDbConnectionPanel>
        Parameters:
        o - the object to be compared.
        Returns:
        a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
        Throws:
        ClassCastException - if the specified object's type prevents it from being compared to this object.
      • equals

        public boolean equals​(Object o)
        Checks whether this object is equal to the specified one.
        Overrides:
        equals in class Object
        Parameters:
        o - the object to compare with
        Returns:
        true if the same (title)
      • addChangeListener

        public void addChangeListener​(ChangeListener l)
        Adds the listener for changes in the connection.
        Parameters:
        l - the listener to add
      • removeChangeListener

        public void removeChangeListener​(ChangeListener l)
        Removes the listener for changes in the connection.
        Parameters:
        l - the listener to remove
      • notifyChangeListeners

        protected void notifyChangeListeners()
        Notifies all listeners about a change in the connection.
      • getPanels

        public static String[] getPanels()
        Returns a list with classnames of panels.
        Returns:
        the panel classnames