Skip to main content



      Home
Home » Eclipse Projects » GEF » Outline with a Tree
Outline with a Tree [message #198300] Mon, 10 October 2005 03:31 Go to next message
Eclipse UserFriend
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 #198308 is a reply to message #198300] Mon, 10 October 2005 09:56 Go to previous messageGo to next message
Eclipse UserFriend
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] Mon, 10 October 2005 21:17 Go to previous messageGo to next message
Eclipse UserFriend
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...
>
Re: Outline with a Tree [message #199661 is a reply to message #198351] Tue, 18 October 2005 02:45 Go to previous message
Eclipse UserFriend
Thx,

it works.
Previous Topic:fillGradient on a Figure
Next Topic:Drag and Drop from Package Explorer to an Editor
Goto Forum:
  


Current Time: Sun May 11 08:24:42 EDT 2025

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

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

Back to the top