Properties for my EMF model in GEF [message #194711] |
Mon, 05 September 2005 11:21 |
Yong cheng 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 |
Eclipse User |
|
|
|
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 |
Eclipse User |
|
|
|
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
>
>
|
|
|
|
Powered by
FUDForum. Page generated in 0.03557 seconds