Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZeb Ford-Reitz2011-07-22 08:41:09 +0000
committerZeb Ford-Reitz2011-07-22 08:41:09 +0000
commit9a69fcd5ab80bfdc7076e5e4c1ae112f76c1030a (patch)
tree34a218b7bc846a62fdda9f8b2e0ec543c57fe175 /org.eclipse.jubula.client.autagent
parentad085670feeefe10d6daa93e06f1d9d7746dc531 (diff)
downloadorg.eclipse.jubula.core-9a69fcd5ab80bfdc7076e5e4c1ae112f76c1030a.tar.gz
org.eclipse.jubula.core-9a69fcd5ab80bfdc7076e5e4c1ae112f76c1030a.tar.xz
org.eclipse.jubula.core-9a69fcd5ab80bfdc7076e5e4c1ae112f76c1030a.zip
352824: Reset defaults in embedded agent preference page does not work
The databinding targets (in this case, a single text field) were not being updated automatically because the model value had never actually changed from the default. The value had not changed because validation was never successful. I have corrected this by explicitly updating the databinding targets after setting the databinding models to their default values.
Diffstat (limited to 'org.eclipse.jubula.client.autagent')
-rw-r--r--org.eclipse.jubula.client.autagent/src/org/eclipse/jubula/client/autagent/preferences/ui/EmbeddedAutAgentPreferencePage.java14
1 files changed, 11 insertions, 3 deletions
diff --git a/org.eclipse.jubula.client.autagent/src/org/eclipse/jubula/client/autagent/preferences/ui/EmbeddedAutAgentPreferencePage.java b/org.eclipse.jubula.client.autagent/src/org/eclipse/jubula/client/autagent/preferences/ui/EmbeddedAutAgentPreferencePage.java
index 89eeafbf8..f6598f46e 100644
--- a/org.eclipse.jubula.client.autagent/src/org/eclipse/jubula/client/autagent/preferences/ui/EmbeddedAutAgentPreferencePage.java
+++ b/org.eclipse.jubula.client.autagent/src/org/eclipse/jubula/client/autagent/preferences/ui/EmbeddedAutAgentPreferencePage.java
@@ -45,6 +45,9 @@ public class EmbeddedAutAgentPreferencePage extends PreferencePage
/** the port number for the embedded AUT Agent */
private WritableValue m_portNumber;
+ /** the databinding context for this page */
+ private DataBindingContext m_dbc;
+
/**
*
* {@inheritDoc}
@@ -61,7 +64,7 @@ public class EmbeddedAutAgentPreferencePage extends PreferencePage
GridLayoutFactory.fillDefaults().numColumns(2).applyTo(composite);
- DataBindingContext dbc = new DataBindingContext();
+ m_dbc = new DataBindingContext();
UIComponentHelper.createLabel(composite,
I18n.getString("DatabaseConnection.HostBased.Port"), SWT.NONE); //$NON-NLS-1$
@@ -78,12 +81,12 @@ public class EmbeddedAutAgentPreferencePage extends PreferencePage
.setConverter(new SimpleStringToIntegerConverter())
.setAfterGetValidator(new StringToPortValidator(
I18n.getString("DatabaseConnection.HostBased.Port"))); //$NON-NLS-1$
- dbc.bindValue(SWTObservables.observeText(portText, SWT.Modify),
+ m_dbc.bindValue(SWTObservables.observeText(portText, SWT.Modify),
m_portNumber, portTargetToModelUpdateStrategy,
new UpdateValueStrategy().setConverter(
new SimpleIntegerToStringConverter()));
- PreferencePageSupport.create(this, dbc);
+ PreferencePageSupport.create(this, m_dbc);
return composite;
}
@@ -97,10 +100,15 @@ public class EmbeddedAutAgentPreferencePage extends PreferencePage
@Override
protected void performDefaults() {
+ // set model objects to default values
getPreferenceStore().setToDefault(
PreferenceInitializer.PREF_EMBEDDED_AGENT_PORT);
m_portNumber.setValue(getPreferenceStore().getInt(
PreferenceInitializer.PREF_EMBEDDED_AGENT_PORT));
+
+ // update targets based on new model values
+ m_dbc.updateTargets();
+
super.performDefaults();
}

Back to the top