Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » grouping containments for tree ui - unnecessary?
grouping containments for tree ui - unnecessary? [message #479432] Tue, 11 August 2009 02:12 Go to next message
Jeff S. is currently offline Jeff S.Friend
Messages: 29
Registered: July 2009
Junior Member
I have an EClass A that has a containment reference to EClass B (which
always contains 256 items).

In the tree view, when I expand A, I see 256 items underneath A.

What I would like to do, is have a "grouping" containment, but I thought
I read in the EMF book (when explaining the simple PO model), that this
was unneeded (or frowned upon perhaps).

Anyways, is there a good/simple way to achieve this in the UI, or would
it be best for me to create EClass C which will have a containment
reference (of 256 items) to ECLass B. Then I can have class A contain C
which contains 256 B.

This is strictly a UI issue I'm trying to overcome. I don't really like
the idea of having to go (pseudocode):
getAItem().getCItem().getBItems() when I'd really just like:
getAItem().getBItems()
I *would* however like the tree UI to group B Items together, so I have
to expand a node under A before seeing all the B items...

Sorry if this is incoherent (or too basic of a question). I'd just like
to get some feedback before I go adding "grouping containments" all
over the place...

-Jeff
Re: grouping containments for tree ui - unnecessary? [message #479470 is a reply to message #479432] Tue, 11 August 2009 09:07 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33133
Registered: July 2009
Senior Member
Jeff,

Comments below.

Jeff S. wrote:
> I have an EClass A that has a containment reference to EClass B (which
> always contains 256 items).
>
> In the tree view, when I expand A, I see 256 items underneath A.
>
> What I would like to do, is have a "grouping" containment, but I
> thought I read in the EMF book (when explaining the simple PO model),
> that this was unneeded (or frowned upon perhaps).
You should be able to accomplish the grouping in the UI without changing
the physical model.
>
> Anyways, is there a good/simple way to achieve this in the UI, or
> would it be best for me to create EClass C which will have a
> containment reference (of 256 items) to ECLass B. Then I can have
> class A contain C which contains 256 B.
That's certainly a simple way, but polluting the model to make the UI
pretty isn't good.
>
> This is strictly a UI issue I'm trying to overcome. I don't really
> like the idea of having to go (pseudocode):
> getAItem().getCItem().getBItems() when I'd really just like:
> getAItem().getBItems()
> I *would* however like the tree UI to group B Items together, so I
> have to expand a node under A before seeing all the B items...
>
> Sorry if this is incoherent (or too basic of a question). I'd just
> like to get some feedback before I go adding "grouping containments"
> all over the place...
The book (19.2.3) explains how to do this in just the UI.
>
> -Jeff


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: grouping containments for tree ui - unnecessary? [message #479610 is a reply to message #479470] Tue, 11 August 2009 17:14 Go to previous message
Jeff S. is currently offline Jeff S.Friend
Messages: 29
Registered: July 2009
Junior Member
Ed-

Thanks alot! I figured there was a better way to achieve my desired
behavior (by customizing the EMF.Edit classes).

BTW- I just finished ch.13 (so haven't made it to ch.19 yet). I've
decided to read chapter by chapter rather than skipping around (although
I have skipped ahead a few times to quickly read a section here and there).


Ed Merks wrote:
> Jeff,
>
> Comments below.
>
> Jeff S. wrote:
>> I have an EClass A that has a containment reference to EClass B (which
>> always contains 256 items).
>>
>> In the tree view, when I expand A, I see 256 items underneath A.
>>
>> What I would like to do, is have a "grouping" containment, but I
>> thought I read in the EMF book (when explaining the simple PO model),
>> that this was unneeded (or frowned upon perhaps).
> You should be able to accomplish the grouping in the UI without changing
> the physical model.
>>
>> Anyways, is there a good/simple way to achieve this in the UI, or
>> would it be best for me to create EClass C which will have a
>> containment reference (of 256 items) to ECLass B. Then I can have
>> class A contain C which contains 256 B.
> That's certainly a simple way, but polluting the model to make the UI
> pretty isn't good.
>>
>> This is strictly a UI issue I'm trying to overcome. I don't really
>> like the idea of having to go (pseudocode):
>> getAItem().getCItem().getBItems() when I'd really just like:
>> getAItem().getBItems()
>> I *would* however like the tree UI to group B Items together, so I
>> have to expand a node under A before seeing all the B items...
>>
>> Sorry if this is incoherent (or too basic of a question). I'd just
>> like to get some feedback before I go adding "grouping containments"
>> all over the place...
> The book (19.2.3) explains how to do this in just the UI.
>>
>> -Jeff
Previous Topic:Let the root EPackage create the EFactory for every class
Next Topic:EMF + CouchDB
Goto Forum:
  


Current Time: Tue Apr 16 15:50:56 GMT 2024

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

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

Back to the top