converting properties in a list using EMF databinding does not convert values

103 views Asked by At

I am trying to convert some values from integers to strings using a converter.

observerViewerValue = ViewerProperties.input().observe(tableViewer);
UpdateValueStrategy strategy = new UpdateValueStrategy();
strategy.setConverter(new ItemConverter());
IObservableValue observeItemValue = props[0].observe(peopleList);
bindingContext.bindValue(observerViewerValue, observeItemValue, strategy, strategy);

tableViewer.setInput(peopleList);

it doesn't like the fact that it has been given a list, I tried iterating through and doing:

IObservableValue observeItemValue = props[0].observe(peopleList.get(i));

where i is the index, no exceptions are thrown but the values aren't converted. props[0] just contains the property that will be watched.

1

There are 1 answers

0
user2405469 On

I ended up overriding the ObservableMapLabelProvider and adding the converter in the getColumnText method, it did the trick...