Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Outline with a Tree
Outline with a Tree [message #198300] Mon, 10 October 2005 07:31 Go to next message
Martin Rosenthal is currently offline Martin RosenthalFriend
Messages: 18
Registered: July 2009
Junior Member
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 13: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] Tue, 11 October 2005 01:17 Go to previous messageGo to next message
victor fiu is currently offline victor fiuFriend
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...
>
Re: Outline with a Tree [message #199661 is a reply to message #198351] Tue, 18 October 2005 06:45 Go to previous message
Martin Rosenthal is currently offline Martin RosenthalFriend
Messages: 18
Registered: July 2009
Junior Member
Thx,

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


Current Time: Tue Nov 12 16:28:53 GMT 2024

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

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

Back to the top