Package com.dci.intellij.dbn.connection.config

Examples of com.dci.intellij.dbn.connection.config.ConnectionDetailSettings


                }
            }
        }

        String connectionName = connectionHandler.getName();
        ConnectionDetailSettings detailSettings = connectionHandler.getSettings().getDetailSettings();
        if (poolConnections.size() >= detailSettings.getMaxConnectionPoolSize()) {
            try {
                Thread.currentThread().sleep(TimeUtil.ONE_SECOND);
                return allocateConnection();
            } catch (InterruptedException e) {
                throw new SQLException("Could not allocate connection for '" + connectionName + "'. ");
View Full Code Here


    public static Connection connect(ConnectionHandler connectionHandler) throws SQLException {
        ConnectionStatus connectionStatus = connectionHandler.getConnectionStatus();
        ConnectionSettings connectionSettings = connectionHandler.getSettings();
        ConnectionDatabaseSettings databaseSettings = connectionSettings.getDatabaseSettings();
        ConnectionDetailSettings detailSettings = connectionSettings.getDetailSettings();
        return connect(databaseSettings, detailSettings.getProperties(), detailSettings.isAutoCommit(), connectionStatus);
    }
View Full Code Here

        TabInfo connectionTabInfo = new TabInfo(databaseSettings.createComponent());
        connectionTabInfo.setText("Connection");
        configTabbedPane.addTab(connectionTabInfo);

        ConnectionDetailSettings detailSettings = connectionSettings.getDetailSettings();
        TabInfo detailsTabInfo = new TabInfo(detailSettings.createComponent());
        detailsTabInfo.setText("Details");
        configTabbedPane.addTab(detailsTabInfo);

        ConnectionFilterSettings filterSettings = connectionSettings.getFilterSettings();
        TabInfo filtersTabInfo = new TabInfo(filterSettings.createComponent());
        filtersTabInfo.setText("Filters");
        configTabbedPane.addTab(filtersTabInfo);

        String connectionId = connectionSettings.getId();
        ConnectionDetailSettingsForm detailSettingsForm = detailSettings.getSettingsEditor();
        ConnectionFilterSettingsForm filterSettingsForm = filterSettings.getSettingsEditor();
        GenericDatabaseSettingsForm databaseSettingsForm = databaseSettings.getSettingsEditor();

        filterSettingsForm.setConnectionId(connectionId);
        databaseSettingsForm.setConnectionId(connectionId);
View Full Code Here

        }
    }

    @Override
    public void applyChanges() throws ConfigurationException {
        ConnectionDetailSettings configuration = getConfiguration();

        Map<String, String> newProperties = propertiesEditorForm.getProperties();
        Charset newCharset = (Charset) encodingComboBox.getSelectedItem();
        boolean newAutoCommit = autoCommitCheckBox.isSelected();
        boolean newDdlFileBinding = ddlFileBindingCheckBox.isSelected();
        EnvironmentType newEnvironmentType = (EnvironmentType) environmentTypesComboBox.getSelectedItem();
        String newEnvironmentTypeId = newEnvironmentType.getId();

        boolean settingsChanged =
                !configuration.getProperties().equals(newProperties) ||
                !configuration.getCharset().equals(newCharset) ||
                configuration.isAutoCommit() != newAutoCommit ||
                configuration.isDdlFileBinding() != newDdlFileBinding;

        boolean environmentChanged =
                !configuration.getEnvironmentType().getId().equals(newEnvironmentTypeId);


        configuration.setEnvironmentTypeId(newEnvironmentTypeId);
        configuration.setProperties(newProperties);
        configuration.setCharset(newCharset);
        configuration.setAutoCommit(newAutoCommit);
        configuration.setDdlFileBinding(newDdlFileBinding);
        int idleTimeToDisconnect = ConfigurationEditorUtil.validateIntegerInputValue(idleTimeTextField, "Idle Time to Disconnect (minutes)", 0, 60, "");
        int maxPoolSize = ConfigurationEditorUtil.validateIntegerInputValue(maxPoolSizeTextField, "Max Connection Pool Size", 3, 20, "");
        configuration.setIdleTimeToDisconnect(idleTimeToDisconnect);

        Project project = getConfiguration().getProject();
        if (environmentChanged) {
            EnvironmentChangeListener listener = EventManager.notify(project, EnvironmentChangeListener.TOPIC);
            listener.environmentConfigChanged(newEnvironmentTypeId);
View Full Code Here

    }

    @Override
    public void resetChanges() {
        ConnectionDetailSettings configuration = getConfiguration();
        encodingComboBox.setSelectedItem(configuration.getCharset());
        propertiesEditorForm.setProperties(configuration.getProperties());
        autoCommitCheckBox.setSelected(configuration.isAutoCommit());
        ddlFileBindingCheckBox.setSelected(configuration.isDdlFileBinding());
        environmentTypesComboBox.setSelectedItem(configuration.getEnvironmentType());
        idleTimeTextField.setText(Integer.toString(configuration.getIdleTimeToDisconnect()));
        maxPoolSizeTextField.setText(Integer.toString(configuration.getMaxConnectionPoolSize()));
    }
View Full Code Here

        }
    }

    public ConnectionInfo showConnectionInfo(ConnectionSettings connectionSettings) {
        ConnectionDatabaseSettings databaseSettings = connectionSettings.getDatabaseSettings();
        ConnectionDetailSettings detailSettings = connectionSettings.getDetailSettings();
        return showConnectionInfo(databaseSettings, detailSettings);
    }
View Full Code Here

TOP

Related Classes of com.dci.intellij.dbn.connection.config.ConnectionDetailSettings

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.