Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Properties for my EMF model in GEF
Properties for my EMF model in GEF [message #194711] Mon, 05 September 2005 11:21 Go to next message
Yong cheng is currently offline Yong chengFriend
Messages: 46
Registered: July 2009
Member
Hi,

I'm using EMF and GEF for my application. And I adapted the way of
EDiagram (from the article "Using GEF with EMF") to build the properties
for my EMF model. But now I have one problem.

I have relative complex model, but not all of them should be shown in
diagram. So the elements, which have no graphical display, can only be
accessed and changed via properties.

For example, A contains B as child, B contains C as child.
A is displayed in diagram as a rectangle. And I implemented a dialog to
edit B and C as properties for A.

The problem is: after I edited C, the PropertyChanged will not be fired,
as C doesn't belong to the properties of A but B.) If I try to save it
after editing, the save action will be ignored by the editor, because it
thought there is nothing to save.

In my opinion there are two ways to solve it:
1. separate them into inserted properties for element A.
2. fire PropertyChanged manually

But I have no idea how to realize it. Has anyone an idea?

Thanks a lot.

Lucia
Re: Properties for my EMF model in GEF [message #194719 is a reply to message #194711] Mon, 05 September 2005 12:24 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: sunil_kamath.nohotspammail.com

"Lucia" <cheng_lucia@yahoo.com> wrote in message
news:8bb1791eac562022ed2b89d08f45fd67$1@www.eclipse.org...
> Hi,
>
> I'm using EMF and GEF for my application. And I adapted the way of
> EDiagram (from the article "Using GEF with EMF") to build the properties
> for my EMF model. But now I have one problem.
> I have relative complex model, but not all of them should be shown in
> diagram. So the elements, which have no graphical display, can only be
> accessed and changed via properties.
> For example, A contains B as child, B contains C as child. A is displayed
> in diagram as a rectangle. And I implemented a dialog to edit B and C as
> properties for A.
> The problem is: after I edited C, the PropertyChanged will not be fired,
> as C doesn't belong to the properties of A but B.) If I try to save it
> after editing, the save action will be ignored by the editor, because it
> thought there is nothing to save.
>
> In my opinion there are two ways to solve it: 1. separate them into
> inserted properties for element A. 2. fire PropertyChanged manually
>
> But I have no idea how to realize it. Has anyone an idea?
>
Chain your property changes.
When C changes, it notifies B, which in turn notifies A.
---
Sunil
Re: Properties for my EMF model in GEF [message #194823 is a reply to message #194711] Tue, 06 September 2005 14:06 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.unknown.com

You could just always save. But a better solution would be to wrap all your
property changes in commands that are executed on the GEF command stack.
All our examples do this (including the EMF-based EDiagram example available
from CVS).

"Lucia" <cheng_lucia@yahoo.com> wrote in message
news:8bb1791eac562022ed2b89d08f45fd67$1@www.eclipse.org...
> Hi,
>
> I'm using EMF and GEF for my application. And I adapted the way of
> EDiagram (from the article "Using GEF with EMF") to build the properties
> for my EMF model. But now I have one problem.
>
> I have relative complex model, but not all of them should be shown in
> diagram. So the elements, which have no graphical display, can only be
> accessed and changed via properties.
>
> For example, A contains B as child, B contains C as child.
> A is displayed in diagram as a rectangle. And I implemented a dialog to
> edit B and C as properties for A.
>
> The problem is: after I edited C, the PropertyChanged will not be fired,
> as C doesn't belong to the properties of A but B.) If I try to save it
> after editing, the save action will be ignored by the editor, because it
> thought there is nothing to save.
>
> In my opinion there are two ways to solve it:
> 1. separate them into inserted properties for element A.
> 2. fire PropertyChanged manually
>
> But I have no idea how to realize it. Has anyone an idea?
>
> Thanks a lot.
>
> Lucia
>
>
Re: Properties for my EMF model in GEF [message #195613 is a reply to message #194823] Mon, 12 September 2005 11:19 Go to previous message
Yong cheng is currently offline Yong chengFriend
Messages: 46
Registered: July 2009
Member
Hi, Pratik,

actually I could not save my model.

A has a list of B as children. And I don't want to display B as any figure
in the diagram. So I added a dialog in the property page of A to edit B.
(B has no edit part.)

Now if I add or delete a B instance, I could save. But If I changed the
value of one of the B instances, I could not save. And I don't know how
can I build a chain notification.

Thank you in advance for any suggestion.

Lucia
Previous Topic:Draw2d Label/MultilineLabel as more complex tooltip
Next Topic:Sliders in/for GEF that feel like javax.swing.JSlider
Goto Forum:
  


Current Time: Tue Apr 16 20:59:32 GMT 2024

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

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

Back to the top