Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » JFace » How do I update a column label provider when using ObservableValueEditingSupport? [SOLVED]
How do I update a column label provider when using ObservableValueEditingSupport? [SOLVED] [message #1755167] Tue, 28 February 2017 16:42
Jens Rabe is currently offline Jens RabeFriend
Messages: 81
Registered: September 2013
Member
I have a TableViewer where the input is an ObservableList I create with EMFEditProperties.

The TableViewer also has a TableViewerColumn which uses ObservableValueEditingSupport.

This works, I can edit the content in the column and the value gets correctly propagated to my EObjects in my list.

However, currently I use a simple CellLabelProvider which does NOT get updated. Is there a corresponding LabelProvider I can use, or how do I update the LabelProvider by myself?

EDIT: I didn't see the forest for the trees, as so often Embarrassed

It's very simple:

final ObservableListContentProvider cp = new ObservableListContentProvider();
tableViewer.setContentProvider(cp);
final IObservableMap map = EMFProperties.value(MyPackage.eINSTANCE.getFoo_Bar()).observeDetail(cp.getKnownElements());
viewerColumn.setLabelProvider(new ObservableMapCellLabelProvider(map));

[Updated on: Tue, 28 February 2017 16:50]

Report message to a moderator

Previous Topic:Why is ObservableListTreeContentProvider not meant to be subclassed?
Next Topic:[ComboViewer]Cannot get the add image for one item when using ComboViewer
Goto Forum:
  


Current Time: Fri Apr 19 07:36:04 GMT 2024

Powered by FUDForum. Page generated in 0.01704 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top