0

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.

user2405469
  • 1,953
  • 2
  • 22
  • 43

1 Answers1

0

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

user2405469
  • 1,953
  • 2
  • 22
  • 43