Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » Suppressing Model Objects (ch 19.2.1 of THE BOOK)(Suppressed model object properties do not refresh within parent properties view)
Suppressing Model Objects (ch 19.2.1 of THE BOOK) [message #735224] Tue, 11 October 2011 09:47 Go to next message
Otto  is currently offline Otto Friend
Messages: 3
Registered: August 2011
Junior Member
index.php/fa/4213/0/Hi,

I followed chapter 19.2.1 Suppressing Model Objects of the 'EMF 2nd Edition' book and all is nice and good but ...

First to show you excerpt from my model instance:

ValueSet
|-Tokens
|-TokenA
|-TokenB
.
.
|-TokenN

Token object instances TokenA to TokenN contain one child object called Reference which I want to have suppressed i.e. not displayed in the object hierarchy view. I have followed steps described in the above mentioned chapter and can see properties view for the child object merged together with the Token properties. The problem is that Reference properties are not refreshed when moving from TokenA ,say, to TokenB.

You can see the attached screenshot - where token T10 doesn't contain any reference value 'COMP'. The reference value 'COMP' is part of the token T1 and T1 was the first token I clicked on before making this snapshot.

Any idea someone?

Thanks,

Otto
Re: Suppressing Model Objects (ch 19.2.1 of THE BOOK) [message #735518 is a reply to message #735224] Wed, 12 October 2011 05:18 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33141
Registered: July 2009
Senior Member
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Otto,<br>
<br>
I would expect this code in the generated editor to refresh the
properties view whenever a command is executed:<br>
<br>
<small>&nbsp;&nbsp;&nbsp; // Add a listener to set the most recent command's
affected objects to be the selection of the viewer with focus.<br>
&nbsp;&nbsp;&nbsp; //<br>
&nbsp;&nbsp;&nbsp; commandStack.addCommandStackListener<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (new CommandStackListener()<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public void commandStackChanged(final EventObject event)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; getContainer().getDisplay().asyncExec<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (new Runnable()<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public void run()<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; firePropertyChange(IEditorPart.PROP_DIRTY);<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Try to select the affected objects.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Command mostRecentCommand =
((CommandStack)event.getSource()).getMostRecentCommand();<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (mostRecentCommand != null)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
setSelectionToViewer(mostRecentCommand.getAffectedObjects());<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (propertySheetPage != null &amp;&amp;
!propertySheetPage.getControl().isDisposed())<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; propertySheetPage.refresh();<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; });<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</small><br>
<br>
On 11/10/2011 11:47 AM, Otto wrote:
<blockquote cite="mid:j712l2$ta7$1@news.eclipse.org" type="cite">
<pre wrap="">Hi,

I followed chapter 19.2.1 Suppressing Model Objects of the 'EMF 2nd Edition' book and all is nice and good but ...

First to show you excerpt from my model instance:

ValueSet
|-Tokens
|-TokenA
|-TokenB
.
.
|-TokenN

Token object instances TokenA to TokenN contain one child object called Reference which I want to have suppressed i.e. not displayed in the object hierarchy view. I have followed steps described in the above mentioned chapter and can see properties view for the child object merged together with the Token properties. The problem is that Reference properties are not refreshed when moving from TokenA ,say, to TokenB.

You can see the attached screenshot - where token T10 doesn't contain any reference value 'COMP'. The reference value 'COMP' is part of the token T1 and T1 was the first token I clicked on before making this snapshot.

Any idea someone?

Thanks,

Otto
</pre>
</blockquote>
</body>
</html>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Suppressing Model Objects (ch 19.2.1 of THE BOOK) [message #735531 is a reply to message #735518] Wed, 12 October 2011 06:30 Go to previous message
Otto  is currently offline Otto Friend
Messages: 3
Registered: August 2011
Junior Member
Hi Ed,

Thanks for your reply. The generated code you mentioned in your reply is present in the generated editor in the 'initializeEditingDomain()' method.

There are two things which could possibly affect behavior of my editor and are different from example described in your book:

1. usage of tabbed property view based on 'AbstractPropertySection'; you can see it on my original snapshot.

2. parent of token objects (displayed as 'Tokens' node on the original snapshot) is non-model intermediary object created as described in the chapter 19.2.3.

I have done some more experimenting and changed underlying token object definition in the model from 'Singleton' to 'Stateful' and it behaves as I need it. I am not sure if this is right approach to solve the problem though.

What do you think?

Thanks,

Otto
Previous Topic:EDAPT
Next Topic:[EMF] Leading Slash in References to ID Attributes not allowed?
Goto Forum:
  


Current Time: Thu Apr 25 19:07:57 GMT 2024

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

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

Back to the top