Skip to content
Snippets Groups Projects
Commit d9860f12 authored by Cheng Zhang's avatar Cheng Zhang
Browse files

refactor code

refs 1494
parent 504f5ce4
No related branches found
No related tags found
No related merge requests found
......@@ -224,7 +224,7 @@ public final class DataBindingUtils {
*/
public static Binding[] performComboBinding(DataBindingContext dbc, Control control,
IObservableValue modelValue, IConverter modelToSelectionConverter,
IConverter selectionToModelConverter) {
IConverter selectionToModelConverter, IValidator validator) {
Binding[] bindings = new Binding[1];
......@@ -235,8 +235,8 @@ public final class DataBindingUtils {
// use POLICY_UPDATE to actually perform the update
UpdateValueStrategy selectionToModelStrategy =
new UpdateValueStrategy(true, UpdateValueStrategy.POLICY_UPDATE)
.setConverter(selectionToModelConverter);
new UpdateValueStrategy(true, UpdateValueStrategy.POLICY_UPDATE).setConverter(
selectionToModelConverter).setAfterGetValidator(validator);
// add the "normal" binding to actually update the model
bindings[0] =
......@@ -257,24 +257,18 @@ public final class DataBindingUtils {
*
* @param dbc
* the data binding context to be used
* @param editor
* the SWT control
* @param text
* the SWT control
* @param cellValue
* the model element value to be observed
* @param modalToCellConverter
* the converter from the element to the control's text
* @param cellToModelConverter
* the converter from the control's text to the element
* @param textValidator
* the validator for the control's text
* @return the array of constructed bindings
*/
public static Binding[] performCellTextBinding(DataBindingContext dbc, Control control,
IObservableValue cellValue, IConverter modalToCellConverter,
IConverter cellToModelConverter, IValidator textValidator) {
IConverter cellToModelConverter, IValidator validator) {
Binding[] bindings = new Binding[2];
......@@ -285,8 +279,8 @@ public final class DataBindingUtils {
// use POLICY_UPDATE to actually perform the update
UpdateValueStrategy cellToModelStrategyWithUpdate =
new UpdateValueStrategy(true, UpdateValueStrategy.POLICY_UPDATE)
.setConverter(cellToModelConverter);
new UpdateValueStrategy(true, UpdateValueStrategy.POLICY_UPDATE).setConverter(
cellToModelConverter).setAfterGetValidator(validator);
// add the "normal" binding to actually update the model
bindings[0] =
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment