|
Re: Outline with a Tree [message #198308 is a reply to message #198300] |
Mon, 10 October 2005 13:56 |
Eclipse User |
|
|
|
Originally posted by: zx.us.ibm.com
> I hope you know what i mean...
>
Your "root" TreeEditPart should have three children in the
refreshChildren() call (text1,text2,text3). Text1 has 2 children in its
refreshChildren called... etc... get the point?
I'm not sure what you are trying to say :)
Cheers,
~ Chris
|
|
|
Re: Outline with a Tree [message #198351 is a reply to message #198300] |
Tue, 11 October 2005 01:17 |
victor fiu Messages: 37 Registered: July 2009 |
Member |
|
|
Yes, sure you can.
Basically, you needn't add items by yourself as treeview compoment in many
other tools. What you need is to setup
model, editpart, editpartfactory and view(getText is a simplest view). The
magic power of GEF will build the tree for you.
First you should make your model be a tree.
And then implement getModelChildren() function in corresponding editparts.
And editpartfactory must be implemented and correctly set.
When refreshVisuals, GEF will generate editpart for the model root.
if GEF finds that getModelChildren() for that editpart is overrided, then
GEF will call it and
geterate editparts for the models returned, if the new editparts also have
getModelChildren() defined,
then GEF will generate editparts for the returned children again, and so on
recursively.
I hope it help.
Miaohua Xu
"Martin Rosenthal" <fiesta81@gmx.de> wrote in message
news:71fe180e5ae5dfa9cb1103067ee0311d$1@www.eclipse.org...
> Hello,
>
> how can i get nodes like:
>
> #####################
> - text1
> - childText1_1
> - childText1_2
> + text2
> - text3
> - childText3_1
> + childText3_2
> #####################
>
> in my ContentOutlinePage-View?
>
> I have a TreeEditPart which has a refreshVisuals() method, which refreshes
> some TreeItems with setText().
> But there is no way to add a Tree with several items...
>
> I hope you know what i mean...
>
|
|
|
|
Powered by
FUDForum. Page generated in 0.03038 seconds