Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » complex label provider for multi-level tree viewer(How to deal with deeply nested properties of a master detail in a tree label provider?)
complex label provider for multi-level tree viewer [message #728732] Fri, 23 September 2011 19:44
Matthieu Rethers is currently offline Matthieu RethersFriend
Messages: 1
Registered: September 2011
Junior Member
Hi Everyone,

First let look at the structure:

class Artifact {

RecordSet uncategorized;
RecordSet all;
List<RecordSet> categorized;


class RecordSet {

String name;
List<Record> records;


Pretty simple. Now I want a tree viewer that would represent my artifact as such:

+ all (150)
+++ uncategorized (100)
+++ categorized
++++ category 1 (10)
++++ category 2 (40)

I get this structure to display just fine so far.

Now the label provider... The tree viewer is backed up by an Artifact instance that changes according to the editor that is opened. As I'm adding records to the RecordSets, I want to change the count on the above labels. So the logic would be to use some kind of master detail observable and an ObservableMapLabelProvider. This is where it gets complicated. How do I tell the label provider to listen to changes in my nested categories as well as in my uncategorized and all RecordSet? Also ideally I'd like categorized label to show total across children categories.

I have the feeling that it all boils down to how I define the content provider and then use a observeEach on the known elements but I'm clueless at this point.

I'm having a really hard time finding documentation on non-trivial databindings and would really appreciate some helps here.

Previous Topic:How to get TableViewer to select cell, not row
Next Topic:Bidi not working completely for my RCP app
Goto Forum:

Current Time: Thu Jan 20 06:08:29 GMT 2022

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

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

Back to the top