Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » Editor doesn't recognizes model changes.
Editor doesn't recognizes model changes. [message #13072] Wed, 09 August 2006 10:38 Go to next message
Eclipse UserFriend
Hi,
First of all my apologies if I'm posting in the wrong section.
I'm using an advanced property section to edit a feature of a diagram part. This feature contains a list of strings.
In my property section I'm using an AddCommand,SetCommand and RemoveCommand from EMF.Edit to manipulate the elements in this list.
This works, but the editor doesn't recognize the changes (the save action is not enabled).
I added an CommandStackListener to examine if the command stack changed when executing the command, and it changed.
But when I checked the isDirty(), of xxxxDiagramEditor, it was false.
I use the following code to execute the AddCommand:

EditingDomain editingDomain = ((BpmnDiagramEditor) getPart()).getEditingDomain();
Command cmd = AddCommand.create(editingDomain, eObject, BpmnPackage.eINSTANCE.getGraphicalElement_Categories(), category);
editingDomain.getCommandStack().execute(cmd);

I have other property sections where I change string and enumeration properties and this problem doesn't occur.
Thank you.

Joao
Re: Editor doesn't recognizes model changes. [message #19637 is a reply to message #13072] Tue, 15 August 2006 12:19 Go to previous messageGo to next message
Eclipse UserFriend
Hello Joao,

Generated XXXDocumentProvider is responsible for marking editor as changed.
Hope, you'll be able to found the problem by debuggin it.

-----------------
Alex Shatalin
Re: Editor doesn't recognizes model changes. [message #23645 is a reply to message #19637] Fri, 18 August 2006 13:46 Go to previous message
Eclipse UserFriend
Alex Shatalin wrote:

> Hello Joao,
>
> Generated XXXDocumentProvider is responsible for marking editor as
> changed. Hope, you'll be able to found the problem by debuggin it.
>
> -----------------
> Alex Shatalin

Hello Alex,
Thank you for your tip. It really helped. The problem was in the generated CustomModificationListener. It was only listening to SET notifications.
Combining multiple filters I managed to solve my problem.
Thank you one more time.

My best regards,
Joao


,----[ CustomModificationListener ]
| ...
| 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))));
| ...
`----
Previous Topic:Problem about the GMF Tutorial(mindmap diagram can not be created)
Next Topic:how to enable "Delete from model" function for shortcut
Goto Forum:
  


Current Time: Tue Jun 03 03:28:21 EDT 2025

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

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

Back to the top