Outline with a Tree [message #198300] |
Mon, 10 October 2005 03:31  |
Eclipse User |
|
|
|
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...
|
|
|
|
Re: Outline with a Tree [message #198351 is a reply to message #198300] |
Mon, 10 October 2005 21:17   |
Eclipse User |
|
|
|
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.03115 seconds