Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Riena » Binding own structure to TreeTable
Binding own structure to TreeTable [message #584435] Mon, 04 January 2010 09:17 Go to next message
Matthias is currently offline Matthias
Messages: 52
Registered: September 2009
Member
Hi there,
i'm new to Riena, i did the first steps using the tutorials and really liked it so far.
At the moment i'm trying to build a treetable that contains my own model structure (an hierarchy with 5-6 levels). I want to bind the data to the view, so that changes are updated to the model simultaneously. The "bindToModel()" method needs a certain treeElementClass, but i have a whole structure of classes to bind.
It works when i implement ITreeNode to each class of my structure and use ITreeNode.class in the bindToModel() method. But i don't like this approach since at the moment when i set up the structure i don't care if it's getting displayed or not.
Is there a better approach for that, maybe using special content providers? Are the examples somewhere?

thanks, matthias
Re: Binding own structure to TreeTable [message #584454 is a reply to message #584435] Thu, 07 January 2010 12:25 Go to previous message
Christian Campo is currently offline Christian Campo
Messages: 590
Registered: July 2009
Senior Member
Am 04.01.10 10:17, schrieb matthias:
> Hi there,
> i'm new to Riena, i did the first steps using the tutorials and really
> liked it so far. At the moment i'm trying to build a treetable that
> contains my own model structure (an hierarchy with 5-6 levels). I want
> to bind the data to the view, so that changes are updated to the model
> simultaneously. The "bindToModel()" method needs a certain
> treeElementClass, but i have a whole structure of classes to bind.
> It works when i implement ITreeNode to each class of my structure and
> use ITreeNode.class in the bindToModel() method. But i don't like this
> approach since at the moment when i set up the structure i don't care if
> it's getting displayed or not. Is there a better approach for that,
> maybe using special content providers? Are the examples somewhere?
>
> thanks, matthias


Hi Matthias,

There are two ways I can see what you can do. Actually the bindToModel implementation does not require a ITreeNode in
its parameter list, it takes any object together with a list of properties for getting to the child node, the parent and
evaluating the visibilty etc. If you have this methods already in your own structure you could use just that.

i.e.

tree.bindToModel(treeRoot, MyStruct.class,"childred","parent","value",null,null) // the last two were enablement and
visibilty accessors that should work and create the desire effect shouldnt it ?

The second approach would be to create a TreeNode instance that wraps your own structure. You would then pass the
treeNode instance to bindToModel and subclass TreeNode to translate the methods into access to your own structure.

But I think the first approach should work for you much more better......

christian
Previous Topic:Riena Release 1.2.0.0
Next Topic:Riena on Windows 7
Goto Forum:
  


Current Time: Wed Oct 22 14:05:53 GMT 2014

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

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