}
}
@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);