Skip to content

Commit

Permalink
TEIIDDES-2183 translator name now properly restored/set when Back and…
Browse files Browse the repository at this point in the history
… Next are used in the wizard.
  • Loading branch information
blafond committed May 30, 2014
1 parent 54fdaf6 commit 701989a
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
Expand Up @@ -9,6 +9,7 @@

import java.util.ArrayList;
import java.util.List;

import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
Expand Down Expand Up @@ -204,7 +205,14 @@ private void setThisPageComplete( String message, int severity) {
*/
@Override
public void selectionChanged(String selectedSourceName) {
importManager.setDataSourceName(this.dataSourcePanel.getSelectedDataSourceName());
// If DS changed, need to null out translator name. It'll be discovered in SelectTranslatorPage.setVisible()

boolean dsChanged = importManager.getDataSourceName() != null ? !importManager.getDataSourceName().equals(this.dataSourcePanel.getSelectedDataSourceName()) : true;
if( dsChanged ) {
importManager.setTranslatorName(null);
}

importManager.setDataSourceName(this.dataSourcePanel.getSelectedDataSourceName());
importManager.setDataSourceJndiName(this.dataSourcePanel.getSelectedDataSourceJndiName());
importManager.setDataSourceDriverName(this.dataSourcePanel.getSelectedDataSourceDriver());
importManager.setDataSourceProperties(this.propertiesPanel.getDataSourceProperties());
Expand Down
Expand Up @@ -285,6 +285,10 @@ public int compare( Viewer viewer,
* @return the translator name
*/
private String getInitialTranslatorSelection() {
if( importManager.getTranslatorName() != null ) {
return importManager.getTranslatorName();
}

String driverName = importManager.getDataSourceDriverName();
if(translatorNames.isEmpty() || CoreStringUtil.isEmpty(driverName)) {
return null;
Expand Down
Expand Up @@ -180,7 +180,13 @@ public void setTranslatorName(String translatorName) {
// If different translator is selected, reset deployment status
if(areDifferent(this.translatorName,translatorName)) {
this.vdbDeploymentStatus = null;
this.translatorOverride = createTranslatorOverride(translatorName, new Properties()); }
if( translatorName != null ) {
this.translatorOverride = createTranslatorOverride(translatorName, new Properties());
} else {
// TO make sure the wrong override property isn't cached when translatorName set to NULL
this.translatorOverride = null;
}
}
this.translatorName = translatorName;
}

Expand Down

0 comments on commit 701989a

Please sign in to comment.