Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » How to warn the GMF Diagram Editor that something has changed..
How to warn the GMF Diagram Editor that something has changed.. [message #68953] Wed, 25 October 2006 06:12 Go to next message
Eclipse UserFriend
Originally posted by: gabmecu.fiv.upv.es

Hi again! I'm facing another problem now. From a property tab sheet I'm
creating/deleting/editing some EMF elements that do not have a graphical
representation. Once the changes are made I want to save the diagram but
as the diagram has not been changed I am not allowed to save. You must
make a change in the diagram to be able to save it.

Does anyone know how to make a notification to the diagram warning it
that something has been changed?

Thanks in advance
Gabriel Merin
Re: How to warn the GMF Diagram Editor that something has changed.. [message #68995 is a reply to message #68953] Wed, 25 October 2006 06:52 Go to previous messageGo to next message
Eclipse UserFriend
Hello Gabriel,

Take a look on generated ???DocumentProvider.CustomModificationListener -
this code is responsible for making editor dirty. Looks like some of the
necessary notifications are not handled there.

-----------------
Alex Shatalin
Re: How to warn the GMF Diagram Editor that something has changed.. [message #69395 is a reply to message #68995] Wed, 25 October 2006 11:27 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: gabmecu.fiv.upv.es

Hi Alex. I've seen that generated code. But I have no clue of what to do
with it. Do I have to change that code? Do I have to create my own
CustomModificationListener to listen to non-graphical modifications? I
didn't expect to have this problem so I'm completely lost.

Is it normal that the DiagramEditor doesn't get dirty when
adding/deleting EMF elements that do not have a graphical
representation? (even when I'm achieving this through an EditingDomain)

Thanks in advance. I would appreciate any additional hint.

Gabriel Merin

Alex Shatalin wrote:
> Hello Gabriel,
>
> Take a look on generated ???DocumentProvider.CustomModificationListener
> - this code is responsible for making editor dirty. Looks like some of
> the necessary notifications are not handled there.
>
> -----------------
> Alex Shatalin
>
>
Re: How to warn the GMF Diagram Editor that something has changed.. [message #69414 is a reply to message #69395] Wed, 25 October 2006 12:04 Go to previous messageGo to next message
Eclipse UserFriend
Hello Gabriel,

> Hi Alex. I've seen that generated code. But I have no clue of what to
> do with it. Do I have to change that code? Do I have to create my own
I think you should debug this code and modify it to handle EMF notifications
in this situation correctly. LAter you can submitt a request into bugzilla
and we will modify templates to generate code in accordance.

-----------------
Alex Shatalin
Re: (SOLVED) How to warn the GMF Diagram Editor that something has changed.. [message #69454 is a reply to message #69414] Wed, 25 October 2006 12:24 Go to previous message
Eclipse UserFriend
Originally posted by: gabmecu.fiv.upv.es

Hi Alex. I found the solution in reply of one of you answers:
http://dev.eclipse.org/newslists/news.eclipse.modeling.gmf/m sg00329.html

NotificationFilter setFilter =
NotificationFilter.createEventTypeFilter(Notification.SET);

NotificationFilter addFilter =
NotificationFilter.createEventTypeFilter(Notification.ADD);

NotificationFilter addManyFilter =
NotificationFilter.createEventTypeFilter(Notification.ADD_MA NY);

NotificationFilter removeFilter =
NotificationFilter.createEventTypeFilter(Notification.REMOVE );

NotificationFilter removeManyFilter =
NotificationFilter.createEventTypeFilter(Notification.REMOVE _MANY);

NotificationFilter diagramResourceModifiedFilter =
setFilter.or(addFilter.or(addManyFilter.or(removeFilter.or(r emoveManyFilter))));

So problem solved!!

Gabriel Merin

Alex Shatalin wrote:
> Hello Gabriel,
>
>> Hi Alex. I've seen that generated code. But I have no clue of what to
>> do with it. Do I have to change that code? Do I have to create my own
> I think you should debug this code and modify it to handle EMF
> notifications in this situation correctly. LAter you can submitt a
> request into bugzilla and we will modify templates to generate code in
> accordance.
>
> -----------------
> Alex Shatalin
>
>
Previous Topic:Re: set return type of Operation
Next Topic:How to draw an ellipse inside another one
Goto Forum:
  


Current Time: Fri May 30 02:23:47 EDT 2025

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

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

Back to the top