Class AbstractDatabaseConnectionPanel

    • Field Detail

      • m_TextURL

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

        protected BaseTextField m_TextUser
        the edit field for the database user.
      • m_ComboBoxLoggingLevel

        protected BaseComboBox<LoggingLevel> m_ComboBoxLoggingLevel
        the combobox for the logging level.
      • m_CheckBoxConnectOnStartUp

        protected BaseCheckBox m_CheckBoxConnectOnStartUp
        the checkbox for connecting on startup.
      • m_CheckBoxAutoCommit

        protected BaseCheckBox m_CheckBoxAutoCommit
        the checkbox for auto-commit.
      • m_ButtonNew

        protected BaseButton m_ButtonNew
        the button for creating a new connection.
      • m_ButtonRemove

        protected BaseButton m_ButtonRemove
        the button removing the database connection.
      • m_ButtonMakeDefault

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

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

        protected JLabel m_LabelStatus
        the label for status messages.
      • m_PanelParameters

        protected ParameterPanel m_PanelParameters
        for the parameters.
    • Constructor Detail

      • AbstractDatabaseConnectionPanel

        public AbstractDatabaseConnectionPanel()
    • Method Detail

      • initialize

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

        protected abstract AbstractDatabaseConnection getDefaultDatabaseConnection()
        Returns the default database connection to use.
        Returns:
        the database connection
      • getAllConnectionParameters

        protected List<ConnectionParameters> getAllConnectionParameters()
        Returns all the connection parameters as sorted list.
        Returns:
        the sorted list
      • initGUI

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

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

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

        protected void connectionParametersToFields​(ConnectionParameters conn)
        Updates the fields with the parameters.
        Parameters:
        conn - the parameters to display
      • getActiveConnectionFor

        protected AbstractDatabaseConnection getActiveConnectionFor​(ConnectionParameters params)
        Returns the connection that is represented by the connection parameters.
        Parameters:
        params - the parameters to get the connection for (if any)
        Returns:
        the connection, null if none active
      • displayConnection

        protected void displayConnection​(ConnectionParameters params)
        Displays the connection parameters.
        Parameters:
        params - the database connection to display
      • displayConnection

        protected void displayConnection​(AbstractDatabaseConnection conn)
        Displays the connection.
        Parameters:
        conn - the database connection to display
      • performConnect

        protected abstract void performConnect()
        Performs the connect.
      • performDisconnect

        protected abstract void performDisconnect()
        Performs the disconnect.
      • newConnection

        protected void newConnection()
        Allows adding a new connection.
      • removeConnection

        protected void removeConnection()
        Removes the current parameters as available connection.
      • makeDefault

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

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

        protected ConnectionParameters getCurrentParameters()
        Returns the current parameters as connection object.
        Returns:
        the current setup
      • update

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

        public int compareTo​(AbstractDatabaseConnectionPanel 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<AbstractDatabaseConnectionPanel>
        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.
      • disconnectConnections

        public boolean disconnectConnections()
        Clears the connections.
        Returns:
        true if able to clear connections