Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » How to make editor aware of model changes?
How to make editor aware of model changes? [message #190735] Tue, 03 June 2008 16:07 Go to next message
Barbara Rosi-Schwartz is currently offline Barbara Rosi-SchwartzFriend
Messages: 448
Registered: July 2009
Senior Member
Hello.

I have added a custom contribution item to the workbench toolbar when
one of my diagram editors is opened.

This item is meant to modify an attribute of my domain model when a
specific node is selected in the diagram.

In order to achieve this I have made my contribution item extend
PropertyChangeContributionItem and I have then created my own edit
policy, which extends PropertyHandlerEditPolicy and which returns a
Command of type SetPropertyCommand when its getCommand() method is
invoked.

Even though my domain model is modified as expected, the editor is not
marked as dirty and any listeners that I add to the domain model to
notify of model changes are not awakened.

What am I missing?

TIA,
B.

--
                                  Barbara Rosi-Schwartz
                   Etish Limited [http://www.etish.org]
Blog: http://www.brs4etish.blogspot.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   ^...^
 /  o,o  \       The proud parents of Useme
 |) ::: (|       The Open Requirements Management Tool
====w=w====      [https://useme.dev.java.net]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Re: How to make editor aware of model changes? [message #190799 is a reply to message #190735] Tue, 03 June 2008 17:51 Go to previous message
Barbara Rosi-Schwartz is currently offline Barbara Rosi-SchwartzFriend
Messages: 448
Registered: July 2009
Senior Member
On 2008-06-03 17:07:41 +0100, Barbara Rosi-Schwartz
<Barbara.Rosi-Schwartz@Etish.org> said:

> Hello.
>
> I have added a custom contribution item to the workbench toolbar when
> one of my diagram editors is opened.
>
> This item is meant to modify an attribute of my domain model when a
> specific node is selected in the diagram.
>
> In order to achieve this I have made my contribution item extend
> PropertyChangeContributionItem and I have then created my own edit
> policy, which extends PropertyHandlerEditPolicy and which returns a
> Command of type SetPropertyCommand when its getCommand() method is
> invoked.
>
> Even though my domain model is modified as expected, the editor is not
> marked as dirty and any listeners that I add to the domain model to
> notify of model changes are not awakened.
>
> What am I missing?
>
> TIA,
> B.

More details.

Upon careful debugging, I find that all goes well in my sequence of
messages until I reach a call to ViewUtil.setPropertyValue(). In this
method, nothing is actually done because the featureClass that is
passed in, which is my domain class that needs updating, is not
recognised as either a style or a layout of the view (node), nor is it
an instance of the view itself.

So how to add the property I am trying to change as something that the
view knows about? Or alternatively how to persuade the system to
perform the update anyway and to mark the editor as dirty?

TIA,
B.

--
                                  Barbara Rosi-Schwartz
                   Etish Limited [http://www.etish.org]
Blog: http://www.brs4etish.blogspot.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   ^...^
 /  o,o  \       The proud parents of Useme
 |) ::: (|       The Open Requirements Management Tool
====w=w====      [https://useme.dev.java.net]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Previous Topic:Pasting something from clipboard to diagram
Next Topic:Where can I find the Graphdefine of the unequal polygon in the diagram?
Goto Forum:
  


Current Time: Tue Apr 23 08:24:15 GMT 2024

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

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

Back to the top