tag:blogger.com,1999:blog-466239133593536392023-06-20T14:37:09.739+02:00Model Driven Engineering in a NutshellMikahttp://www.blogger.com/profile/00462836780238171043noreply@blogger.comBlogger9125tag:blogger.com,1999:blog-46623913359353639.post-75465389479813902702011-03-23T21:32:00.002+01:002011-03-24T09:17:45.339+01:00EMFPath @ Eclipse Con 2011I just finished presenting my talk about EMFPath @ Eclipse Con 2011. Here are the slides I used to introduce Guava and EMFPath.<br />
<br />
<div style="text-align: center;"><object height="355" id="__sse7363205" width="425"> <param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=emfpath-110323151320-phpapp01&stripped_title=emfpath&userName=mikaelbarbero" /><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><embed name="__sse7363205" src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=emfpath-110323151320-phpapp01&stripped_title=emfpath&userName=mikaelbarbero" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"> </embed> </object><br />
</div>Mikahttp://www.blogger.com/profile/00462836780238171043noreply@blogger.com0tag:blogger.com,1999:blog-46623913359353639.post-33330033453155786672010-11-02T16:45:00.002+01:002010-11-04T09:35:27.732+01:00Creating Android Application with Eclipse Modeling @ ESE 2010Live from <a href="http://www.eclipsecon.org/summiteurope2010">Eclipse Summit Europe 2010</a>.<br />
<br />
This morning I gave a <a href="http://www.eclipsecon.org/summiteurope2010/sessions/?page=sessions&id=1833">tutorial</a> with <a href="http://sbegaudeau.tumblr.com/">Stéphane Bégaudeau</a> (my colleague from <a href="http://www.obeo.fr/">Obeo</a>) and people from <a href="http://www.itemis.de/">Itemis</a> (<a href="http://koehnlein.blogspot.com/">Jan Koehlnein</a>, <a href="http://holgerschill.blogspot.com/">Holger Schill</a> and Dennis Hübner). The purpose was to demonstrate how to use <a href="http://www.eclipse.org/modeling">Eclipse Modeling</a> technologies to create an <a href="http://www.eclipse.org/Xtext">Xtext</a> textual DSL and <a href="http://www.eclipse.org/acceleo">Acceleo</a> generators to model and generate the code of <a href="http://developer.android.com/">Android</a> applications.<br />
<br />
Here are the slides from the Acceleo generator part :<br />
<br />
<div id="__ss_5608945" style="width: 425px;"><div style="text-align: center;"><object height="355" id="__sse5608945" width="425"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=acceleoese2010slideshare-101029092143-phpapp02&rel=0&stripped_title=generating-an-android-app-with-acceleo-eclipse-summit-europe-2010-5608945&userName=mikaelbarbero" /><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><embed name="__sse5608945" src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=acceleoese2010slideshare-101029092143-phpapp02&rel=0&stripped_title=generating-an-android-app-with-acceleo-eclipse-summit-europe-2010-5608945&userName=mikaelbarbero" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"></embed></object></div></div>Mikahttp://www.blogger.com/profile/00462836780238171043noreply@blogger.com1tag:blogger.com,1999:blog-46623913359353639.post-85301007010032544162010-09-24T13:54:00.001+02:002010-09-24T16:11:20.850+02:00How to embed Xtext editors within Eclipse Forms editors?With the growing usage of Xtext, people would like to integrate the Xtext editor within other editors. It is useful when a part of a edited model is best described textually and you want to benefit of all almost-free Xtext editor features.<br />
<br />
In this goal, I recently created a sample RCP application to demonstrate how to do such a thing. This sample RCP application is hosted within the <a href="http://code.google.com/a/eclipselabs.org/p/xtext-forms-integration/"><b>xtext-forms-integration</b></a> project on EclipseLabs. This contribution has been made possible thanks to <a href="http://www.proxiad.com/">ProxiAD</a>, <a href="http://www.obeo.fr/">Obeo</a> and <a href="http://www.itemis.de/">Itemis AG</a> companies.<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="http://a.imageshack.us/img836/6839/capturercpapplication1.png"><img border="0" height="224" src="http://a.imageshack.us/img836/6839/capturercpapplication1.png" width="320" /></a></div><br />
The framework part of this project is rather small and thus very re-usable. Have a look on the code to make your own opinion. In the mid term, we think it may be interresting to have these classes in the xtext.ui plugin to help people integrating Xtext editors.<br />
<br />
Special thanks to <a href="http://blog.proxiad.com/author/cvidal/">Cédric Vidal (blog in french)</a>, <a href="http://zarnekow.blogspot.com/">Sebastian Zarnekow</a>, <a href="http://nirmalsasidharan.wordpress.com/">Nirmal Sasidharan</a> and <a href="http://5ise.quanxinquanyi.de/">Andreas Graf</a> for their help and participation.Mikahttp://www.blogger.com/profile/00462836780238171043noreply@blogger.com5tag:blogger.com,1999:blog-46623913359353639.post-60070334612412284642010-09-15T12:10:00.000+02:002010-09-15T12:10:50.763+02:00First binary release of EMFPathThe binaries of the <a href="http://code.google.com/a/eclipselabs.org/p/emfpath/">EMFPath</a> project are finally available. The release is tagged 0.3.0. It is an early release and the API is still subject to change. Do not hesitate to report bugs or features requests on the <a href="http://code.google.com/a/eclipselabs.org/p/emfpath/issues/list">tracker page</a>.<br />
<br />
The release is available in two shapes:<br />
<ul><li><a href="http://code.google.com/a/eclipselabs.org/p/emfpath/downloads/detail?name=emfpath-r0.3.0.zip">ZIP archive the runtime Jar, the source Jar and the JavaDoc</a></li>
<li><a href="http://svn.codespot.com/a/eclipselabs.org/emfpath/trunk/repository/">OSGi bundles available from an Eclispe P2 repository (a.k.a. update site)</a></li>
</ul><br />
EMFPath depends on <a href="http://code.google.com/p/guava-libraries/">Google Guava</a> r05. People who want to use EMFPath from Eclipse may also want to use the Guava OSGi bundles available from the <a href="http://code.google.com/a/eclipselabs.org/p/guava-bundle/">guava-bundle project</a>. This project provides a <a href="http://svn.codespot.com/a/eclipselabs.org/guava-bundle/trunk/repository/">P2 repository</a> with all of the released versions of Google Guava.<br />
<br />
<b>Note</b>: EMFPath is a set of functions and predicates (as defined by Google Guava libraries) along with a set of utility methods to help navigating and editing Eclipse EMF models.Mikahttp://www.blogger.com/profile/00462836780238171043noreply@blogger.com2tag:blogger.com,1999:blog-46623913359353639.post-85113968111683018352010-08-11T09:27:00.011+02:002010-08-11T14:53:41.341+02:00Guava releases as OSGi bundles (with update site)Last week I created a new project on Eclipse Labs named <a href="http://code.google.com/a/eclipselabs.org/p/guava-bundle/">guava-bundle</a> that provides OSGi bundles of <a href="http://code.google.com/p/guava-libraries/">Guava</a> releases along with a P2 update site.<div><br /></div><div>The update site provides SDK (with sources and Javadoc) and Runtime (binary only) features for the following releases:</div><div><ul><li><a href="http://code.google.com/p/guava-libraries/downloads/detail?name=guava-r03.zip">guava-r03</a></li><li><a href="http://code.google.com/p/guava-libraries/downloads/detail?name=guava-r04.zip">guava-r04</a></li><li><a href="http://code.google.com/p/guava-libraries/downloads/detail?name=guava-r05.zip">guava-r05</a></li><li><a href="http://code.google.com/p/guava-libraries/downloads/detail?name=guava-r06.zip">guava-r06</a></li></ul></div><div><div>Guava follows a simple incremental numbering scheme for its releases versionning. As OSGi needs a finest level of details for versionning, guava-bundle mapped this scheme as follow:</div><div><br /></div><div><blockquote>A Guava release <b>rX</b> where <b>X</b> is the integral version number of the release will be available in guava-bundle <b>1.X.0</b>. </blockquote></div><div><br /></div><div>For instance, the <b>r05</b> release is available in the bundle with version number <b>1.5.0</b>.</div><div><br /></div><div>All OSGi metadata are synchronized with this version number mapping:</div><div><ul><li>Bundles (aka plugins) versions,</li><li>Exported packages versions,</li><li>Features versions</li></ul><div><div><b>Project home:</b> <a href="http://code.google.com/a/eclipselabs.org/p/guava-bundle/">http://code.google.com/a/eclipselabs.org/p/guava-bundle/</a></div><div><br /></div><div><b>P2 update site:</b> <a href="http://svn.codespot.com/a/eclipselabs.org/guava-bundle/trunk/repository/">http://svn.codespot.com/a/eclipselabs.org/guava-bundle/trunk/repository/</a></div></div><div><br /></div><div>Have fun!</div></div></div><div><br /></div><div>Note: there is a similar project named <a href="http://code.google.com/p/guava-osgi/">guava-osgi</a> but it only has the r03 release. <a href="http://code.google.com/p/guava-osgi/issues/detail?id=3">I suggested to merge the two projects</a> but I did not had an answer yet.</div>Mikahttp://www.blogger.com/profile/00462836780238171043noreply@blogger.com2tag:blogger.com,1999:blog-46623913359353639.post-77154150334155321722010-06-02T12:29:00.008+02:002010-06-02T13:01:50.529+02:00Creating a index of EObjects by their type with EMFPath<span class="Apple-style-span" style=" ;font-family:arial, sans-serif;font-size:13px;"><a name="Index_all_EObjects_in_an_Resource_by_their_EClass"><p>On common need you may have when working with EMF, it to build an index of elements by their type. In this post index will be an instance of the <span style="border-bottom-width: 1px; border-bottom-style: dotted; border-bottom- color:black;">Multimap</span> class of Google Collections (basically, it is an abstraction of <tt>Map<K, Collection<V>></tt>).</p><p>Let's say we have an EMF <span style="border-bottom-width: 1px; border-bottom-style: dotted; border-bottom- color:black;">Resource</span> named <tt>eResource</tt>.</p><p>First, we get the whole contents in an <tt>Iterable</tt> and we give it to the index() method of the Multimaps class and the EObjects.eClass Function as the indexing function.</p><pre class="prettyprint" style=" margin-left: 2em; padding-top: 0,5em; padding-right: 0,5em; padding-bottom: 0,5em; padding-left: 0,5em; border-left-width: 3px; border-left-style: solid; border-left-color: rgb(204, 204, 204); font-size:12px;"><span class="typ" style="color: rgb(102, 0, 102); ">Iterable</span><span class="pun" style="color: rgb(102, 102, 0); "><</span><span class="typ" style="color: rgb(102, 0, 102); ">EObject</span><span class="pun" style="color: rgb(102, 102, 0); ">></span><span class="pln" style="color: rgb(0, 0, 0); "> descendants </span><span class="pun" style="color: rgb(102, 102, 0); ">=</span><span class="pln" style="color: rgb(0, 0, 0); "> descendant</span><span class="pun" style="color: rgb(102, 102, 0); ">.</span><span class="pln" style="color: rgb(0, 0, 0); ">of</span><span class="pun" style="color: rgb(102, 102, 0); ">(</span><span class="pln" style="color: rgb(0, 0, 0); ">eResource</span><span class="pun" style="color: rgb(102, 102, 0); ">);</span><span class="pln" style="color: rgb(0, 0, 0); "><br /></span><span class="typ" style="color: rgb(102, 0, 102); ">Multimap</span><span class="pun" style="color: rgb(102, 102, 0); "><</span><span class="typ" style="color: rgb(102, 0, 102); ">EClass</span><span class="pun" style="color: rgb(102, 102, 0); ">,</span><span class="pln" style="color: rgb(0, 0, 0); "> </span><span class="typ" style="color: rgb(102, 0, 102); ">EObject</span><span class="pun" style="color: rgb(102, 102, 0); ">></span><span class="pln" style="color: rgb(0, 0, 0); "> descendantsByEClass </span><span class="pun" style="color: rgb(102, 102, 0); ">=</span><span class="pln" style="color: rgb(0, 0, 0); "> </span><span class="typ" style="color: rgb(102, 0, 102); ">Multimaps</span><span class="pun" style="color: rgb(102, 102, 0); ">.</span><span class="pln" style="color: rgb(0, 0, 0); ">index</span><span class="pun" style="color: rgb(102, 102, 0); ">(</span><span class="pln" style="color: rgb(0, 0, 0); ">descendants</span><span class="pun" style="color: rgb(102, 102, 0); ">,</span><span class="pln" style="color: rgb(0, 0, 0); "> </span><span class="typ" style="color: rgb(102, 0, 102); ">EObjects</span><span class="pun" style="color: rgb(102, 102, 0); ">.</span><span class="pln" style="color: rgb(0, 0, 0); ">eClass</span><span class="pun" style="color: rgb(102, 102, 0); ">);</span></pre><p>This is a strict index that does not index elements regarding their EClass supertypes' hierarchy. For instance if have an EClass referenced by a variable named b_EClass, <tt>descendantsByEClass.get(b_EClass)</tt> will return all elements having b_EClass as their EClass, but it will not return elements having a subclass of b_EClass as their own EClass:</p><pre class="prettyprint" style=" margin-left: 2em; padding-top: 0,5em; padding-right: 0,5em; padding-bottom: 0,5em; padding-left: 0,5em; border-left-width: 3px; border-left-style: solid; border-left-color: rgb(204, 204, 204); font-size:12px;"><span class="typ" style="color: rgb(102, 0, 102); ">EClass</span><span class="pln" style="color: rgb(0, 0, 0); "> a</span><span class="pun" style="color: rgb(102, 102, 0); ">,</span><span class="pln" style="color: rgb(0, 0, 0); "> b</span><span class="pun" style="color: rgb(102, 102, 0); ">;</span><span class="pln" style="color: rgb(0, 0, 0); "> </span><span class="com" style="color: rgb(136, 0, 0); ">// b inherits from a</span><span class="pln" style="color: rgb(0, 0, 0); "><br />descendantsByEClass</span><span class="pun" style="color: rgb(102, 102, 0); ">.</span><span class="kwd" style="color: rgb(0, 0, 136); ">get</span><span class="pun" style="color: rgb(102, 102, 0); ">(</span><span class="pln" style="color: rgb(0, 0, 0); ">b</span><span class="pun" style="color: rgb(102, 102, 0); ">);</span><span class="pln" style="color: rgb(0, 0, 0); "> </span><span class="com" style="color: rgb(136, 0, 0); ">// will return elements of type b but not a</span></pre><p>To do so, we have to substitute the indexing function EObjects.eClass by a composite one. This composite Function get the EClass of the current EObject and return this EClass and all its supertypes. To put all indexes into the Multimap, we have to change to call of Multimaps.index to Multimaps2.index to create an index of all elements by kind:</p><pre class="prettyprint" style=" margin-left: 2em; padding-top: 0,5em; padding-right: 0,5em; padding-bottom: 0,5em; padding-left: 0,5em; border-left-width: 3px; border-left-style: solid; border-left-color: rgb(204, 204, 204); font-size:12px;"><span class="typ" style="color: rgb(102, 0, 102); ">Iterable</span><span class="pun" style="color: rgb(102, 102, 0); "><</span><span class="typ" style="color: rgb(102, 0, 102); ">EObject</span><span class="pun" style="color: rgb(102, 102, 0); ">></span><span class="pln" style="color: rgb(0, 0, 0); "> descendants </span><span class="pun" style="color: rgb(102, 102, 0); ">=</span><span class="pln" style="color: rgb(0, 0, 0); "> descendant</span><span class="pun" style="color: rgb(102, 102, 0); ">.</span><span class="pln" style="color: rgb(0, 0, 0); ">of</span><span class="pun" style="color: rgb(102, 102, 0); ">(</span><span class="pln" style="color: rgb(0, 0, 0); ">eResource</span><span class="pun" style="color: rgb(102, 102, 0); ">);</span><span class="pln" style="color: rgb(0, 0, 0); "><br /></span><span class="typ" style="color: rgb(102, 0, 102); ">Multimap</span><span class="pun" style="color: rgb(102, 102, 0); "><</span><span class="typ" style="color: rgb(102, 0, 102); ">EClass</span><span class="pun" style="color: rgb(102, 102, 0); ">,</span><span class="pln" style="color: rgb(0, 0, 0); "> </span><span class="typ" style="color: rgb(102, 0, 102); ">EObject</span><span class="pun" style="color: rgb(102, 102, 0); ">></span><span class="pln" style="color: rgb(0, 0, 0); "> descendantsByKind </span><span class="pun" style="color: rgb(102, 102, 0); ">=</span><span class="pln" style="color: rgb(0, 0, 0); "> </span><span class="typ" style="color: rgb(102, 0, 102); ">Multimaps2</span><span class="pun" style="color: rgb(102, 102, 0); ">.</span><span class="pln" style="color: rgb(0, 0, 0); ">index</span><span class="pun" style="color: rgb(102, 102, 0); ">(</span><span class="pln" style="color: rgb(0, 0, 0); ">descendants</span><span class="pun" style="color: rgb(102, 102, 0); ">,</span><span class="pln" style="color: rgb(0, 0, 0); "> </span><span class="typ" style="color: rgb(102, 0, 102); ">Functions</span><span class="pun" style="color: rgb(102, 102, 0); ">.</span><span class="pln" style="color: rgb(0, 0, 0); ">compose</span><span class="pun" style="color: rgb(102, 102, 0); ">(</span><span class="typ" style="color: rgb(102, 0, 102); ">EClasses</span><span class="pun" style="color: rgb(102, 102, 0); ">.</span><span class="pln" style="color: rgb(0, 0, 0); ">eAllSuperTypesAndSelf</span><span class="pun" style="color: rgb(102, 102, 0); ">,</span><span class="pln" style="color: rgb(0, 0, 0); "> </span><span class="typ" style="color: rgb(102, 0, 102); ">EObjects</span><span class="pun" style="color: rgb(102, 102, 0); ">.</span><span class="pln" style="color: rgb(0, 0, 0); ">eClass</span><span class="pun" style="color: rgb(102, 102, 0); ">));</span></pre><p>Now, descendantsByEClass.get() will return elements of type b and its supertypes.</p><pre class="prettyprint" style=" margin-left: 2em; padding-top: 0,5em; padding-right: 0,5em; padding-bottom: 0,5em; padding-left: 0,5em; border-left-width: 3px; border-left-style: solid; border-left-color: rgb(204, 204, 204); font-size:12px;"><span class="typ" style="color: rgb(102, 0, 102); ">EClass</span><span class="pln" style="color: rgb(0, 0, 0); "> a</span><span class="pun" style="color: rgb(102, 102, 0); ">,</span><span class="pln" style="color: rgb(0, 0, 0); "> b</span><span class="pun" style="color: rgb(102, 102, 0); ">;</span><span class="pln" style="color: rgb(0, 0, 0); "> </span><span class="com" style="color: rgb(136, 0, 0); ">// b inherits from a</span><span class="pln" style="color: rgb(0, 0, 0); "><br />descendantsByEClass</span><span class="pun" style="color: rgb(102, 102, 0); ">.</span><span class="kwd" style="color: rgb(0, 0, 136); ">get</span><span class="pun" style="color: rgb(102, 102, 0); ">(</span><span class="pln" style="color: rgb(0, 0, 0); ">b</span><span class="pun" style="color: rgb(102, 102, 0); ">);</span><span class="pln" style="color: rgb(0, 0, 0); "> </span><span class="com" style="color: rgb(136, 0, 0); ">// will return elements of type b and a</span></pre><p>An equivalent without EMFPath nor Google Collections would be:</p><pre class="prettyprint" style=" margin-left: 2em; padding-top: 0,5em; padding-right: 0,5em; padding-bottom: 0,5em; padding-left: 0,5em; border-left-width: 3px; border-left-style: solid; border-left-color: rgb(204, 204, 204); font-size:12px;"><span class="typ" style="color: rgb(102, 0, 102); ">TreeIterator</span><span class="pun" style="color: rgb(102, 102, 0); "><</span><span class="typ" style="color: rgb(102, 0, 102); ">EObject</span><span class="pun" style="color: rgb(102, 102, 0); ">></span><span class="pln" style="color: rgb(0, 0, 0); "> it </span><span class="pun" style="color: rgb(102, 102, 0); ">=</span><span class="pln" style="color: rgb(0, 0, 0); "> eResource</span><span class="pun" style="color: rgb(102, 102, 0); ">.</span><span class="pln" style="color: rgb(0, 0, 0); ">getAllContents</span><span class="pun" style="color: rgb(102, 102, 0); ">();</span><span class="pln" style="color: rgb(0, 0, 0); "><br /></span><span class="typ" style="color: rgb(102, 0, 102); ">Map</span><span class="pun" style="color: rgb(102, 102, 0); "><</span><span class="typ" style="color: rgb(102, 0, 102); ">EClass</span><span class="pun" style="color: rgb(102, 102, 0); ">,</span><span class="pln" style="color: rgb(0, 0, 0); "> </span><span class="typ" style="color: rgb(102, 0, 102); ">List</span><span class="pun" style="color: rgb(102, 102, 0); "><</span><span class="typ" style="color: rgb(102, 0, 102); ">EObject</span><span class="pun" style="color: rgb(102, 102, 0); ">>></span><span class="pln" style="color: rgb(0, 0, 0); "> index </span><span class="pun" style="color: rgb(102, 102, 0); ">=</span><span class="pln" style="color: rgb(0, 0, 0); "> </span><span class="kwd" style="color: rgb(0, 0, 136); ">new</span><span class="pln" style="color: rgb(0, 0, 0); "> </span><span class="typ" style="color: rgb(102, 0, 102); ">HashMap</span><span class="pun" style="color: rgb(102, 102, 0); "><</span><span class="typ" style="color: rgb(102, 0, 102); ">EClass</span><span class="pun" style="color: rgb(102, 102, 0); ">,</span><span class="pln" style="color: rgb(0, 0, 0); "> </span><span class="typ" style="color: rgb(102, 0, 102); ">List</span><span class="pun" style="color: rgb(102, 102, 0); "><</span><span class="typ" style="color: rgb(102, 0, 102); ">EObject</span><span class="pun" style="color: rgb(102, 102, 0); ">>>();</span><span class="pln" style="color: rgb(0, 0, 0); "><br /></span><span class="kwd" style="color: rgb(0, 0, 136); ">while</span><span class="pun" style="color: rgb(102, 102, 0); ">(</span><span class="pln" style="color: rgb(0, 0, 0); ">it</span><span class="pun" style="color: rgb(102, 102, 0); ">.</span><span class="pln" style="color: rgb(0, 0, 0); ">hasNext</span><span class="pun" style="color: rgb(102, 102, 0); ">())</span><span class="pln" style="color: rgb(0, 0, 0); "> </span><span class="pun" style="color: rgb(102, 102, 0); ">{</span><span class="pln" style="color: rgb(0, 0, 0); "><br /> </span><span class="typ" style="color: rgb(102, 0, 102); ">EObject</span><span class="pln" style="color: rgb(0, 0, 0); "> current </span><span class="pun" style="color: rgb(102, 102, 0); ">=</span><span class="pln" style="color: rgb(0, 0, 0); "> it</span><span class="pun" style="color: rgb(102, 102, 0); ">.</span><span class="kwd" style="color: rgb(0, 0, 136); ">next</span><span class="pun" style="color: rgb(102, 102, 0); ">();</span><span class="pln" style="color: rgb(0, 0, 0); "><br /> </span><span class="typ" style="color: rgb(102, 0, 102); ">EClass</span><span class="pln" style="color: rgb(0, 0, 0); "> eClass </span><span class="pun" style="color: rgb(102, 102, 0); ">=</span><span class="pln" style="color: rgb(0, 0, 0); "> current</span><span class="pun" style="color: rgb(102, 102, 0); ">.</span><span class="pln" style="color: rgb(0, 0, 0); ">eClass</span><span class="pun" style="color: rgb(102, 102, 0); ">();</span><span class="pln" style="color: rgb(0, 0, 0); "><br /> addValueToMap</span><span class="pun" style="color: rgb(102, 102, 0); ">(</span><span class="pln" style="color: rgb(0, 0, 0); ">index</span><span class="pun" style="color: rgb(102, 102, 0); ">,</span><span class="pln" style="color: rgb(0, 0, 0); "> eClass</span><span class="pun" style="color: rgb(102, 102, 0); ">,</span><span class="pln" style="color: rgb(0, 0, 0); "> current</span><span class="pun" style="color: rgb(102, 102, 0); ">);</span><span class="pln" style="color: rgb(0, 0, 0); "><br /> </span><span class="kwd" style="color: rgb(0, 0, 136); ">for</span><span class="pln" style="color: rgb(0, 0, 0); "> </span><span class="pun" style="color: rgb(102, 102, 0); ">(</span><span class="typ" style="color: rgb(102, 0, 102); ">EClass</span><span class="pln" style="color: rgb(0, 0, 0); "> supertype </span><span class="pun" style="color: rgb(102, 102, 0); ">:</span><span class="pln" style="color: rgb(0, 0, 0); "> eClass</span><span class="pun" style="color: rgb(102, 102, 0); ">.</span><span class="pln" style="color: rgb(0, 0, 0); ">getEAllSuperTypes</span><span class="pun" style="color: rgb(102, 102, 0); ">())</span><span class="pln" style="color: rgb(0, 0, 0); "> </span><span class="pun" style="color: rgb(102, 102, 0); ">{</span><span class="pln" style="color: rgb(0, 0, 0); "><br /> addValueToMap</span><span class="pun" style="color: rgb(102, 102, 0); ">(</span><span class="pln" style="color: rgb(0, 0, 0); ">index</span><span class="pun" style="color: rgb(102, 102, 0); ">,</span><span class="pln" style="color: rgb(0, 0, 0); "> supertype</span><span class="pun" style="color: rgb(102, 102, 0); ">,</span><span class="pln" style="color: rgb(0, 0, 0); "> current</span><span class="pun" style="color: rgb(102, 102, 0); ">);</span><span class="pln" style="color: rgb(0, 0, 0); "><br /> </span><span class="pun" style="color: rgb(102, 102, 0); ">}</span><span class="pln" style="color: rgb(0, 0, 0); "><br /></span><span class="pun" style="color: rgb(102, 102, 0); ">}</span><span class="pln" style="color: rgb(0, 0, 0); "><br /><br /></span><span class="kwd" style="color: rgb(0, 0, 136); ">public</span><span class="pln" style="color: rgb(0, 0, 0); "> </span><span class="kwd" style="color: rgb(0, 0, 136); ">static</span><span class="pln" style="color: rgb(0, 0, 0); "> </span><span class="kwd" style="color: rgb(0, 0, 136); ">void</span><span class="pln" style="color: rgb(0, 0, 0); "> addValueToMap</span><span class="pun" style="color: rgb(102, 102, 0); ">(</span><span class="typ" style="color: rgb(102, 0, 102); ">Map</span><span class="pun" style="color: rgb(102, 102, 0); "><</span><span class="typ" style="color: rgb(102, 0, 102); ">EClass</span><span class="pun" style="color: rgb(102, 102, 0); ">,</span><span class="pln" style="color: rgb(0, 0, 0); "> </span><span class="typ" style="color: rgb(102, 0, 102); ">List</span><span class="pun" style="color: rgb(102, 102, 0); "><</span><span class="typ" style="color: rgb(102, 0, 102); ">EObject</span><span class="pun" style="color: rgb(102, 102, 0); ">>></span><span class="pln" style="color: rgb(0, 0, 0); "> index</span><span class="pun" style="color: rgb(102, 102, 0); ">,</span><span class="pln" style="color: rgb(0, 0, 0); "> </span><span class="typ" style="color: rgb(102, 0, 102); ">EClass</span><span class="pln" style="color: rgb(0, 0, 0); "> k</span><span class="pun" style="color: rgb(102, 102, 0); ">,</span><span class="pln" style="color: rgb(0, 0, 0); "> </span><span class="typ" style="color: rgb(102, 0, 102); ">EObject</span><span class="pln" style="color: rgb(0, 0, 0); "> v</span><span class="pun" style="color: rgb(102, 102, 0); ">)</span><span class="pln" style="color: rgb(0, 0, 0); "> </span><span class="pun" style="color: rgb(102, 102, 0); ">{</span><span class="pln" style="color: rgb(0, 0, 0); "><br /> </span><span class="typ" style="color: rgb(102, 0, 102); ">List</span><span class="pun" style="color: rgb(102, 102, 0); "><</span><span class="typ" style="color: rgb(102, 0, 102); ">EObject</span><span class="pun" style="color: rgb(102, 102, 0); ">></span><span class="pln" style="color: rgb(0, 0, 0); "> values </span><span class="pun" style="color: rgb(102, 102, 0); ">=</span><span class="pln" style="color: rgb(0, 0, 0); "> index</span><span class="pun" style="color: rgb(102, 102, 0); ">.</span><span class="kwd" style="color: rgb(0, 0, 136); ">get</span><span class="pun" style="color: rgb(102, 102, 0); ">(</span><span class="pln" style="color: rgb(0, 0, 0); ">k</span><span class="pun" style="color: rgb(102, 102, 0); ">);</span><span class="pln" style="color: rgb(0, 0, 0); "><br /> </span><span class="kwd" style="color: rgb(0, 0, 136); ">if</span><span class="pln" style="color: rgb(0, 0, 0); "> </span><span class="pun" style="color: rgb(102, 102, 0); ">(</span><span class="pln" style="color: rgb(0, 0, 0); ">values </span><span class="pun" style="color: rgb(102, 102, 0); ">==</span><span class="pln" style="color: rgb(0, 0, 0); "> </span><span class="kwd" style="color: rgb(0, 0, 136); ">null</span><span class="pun" style="color: rgb(102, 102, 0); ">)</span><span class="pln" style="color: rgb(0, 0, 0); "> </span><span class="pun" style="color: rgb(102, 102, 0); ">{</span><span class="pln" style="color: rgb(0, 0, 0); "><br /> values </span><span class="pun" style="color: rgb(102, 102, 0); ">=</span><span class="pln" style="color: rgb(0, 0, 0); "> </span><span class="kwd" style="color: rgb(0, 0, 136); ">new</span><span class="pln" style="color: rgb(0, 0, 0); "> </span><span class="typ" style="color: rgb(102, 0, 102); ">ArrayList</span><span class="pun" style="color: rgb(102, 102, 0); "><</span><span class="typ" style="color: rgb(102, 0, 102); ">EObject</span><span class="pun" style="color: rgb(102, 102, 0); ">>();</span><span class="pln" style="color: rgb(0, 0, 0); "><br /> index</span><span class="pun" style="color: rgb(102, 102, 0); ">.</span><span class="pln" style="color: rgb(0, 0, 0); ">put</span><span class="pun" style="color: rgb(102, 102, 0); ">(</span><span class="pln" style="color: rgb(0, 0, 0); ">k</span><span class="pun" style="color: rgb(102, 102, 0); ">,</span><span class="pln" style="color: rgb(0, 0, 0); "> values</span><span class="pun" style="color: rgb(102, 102, 0); ">);</span><span class="pln" style="color: rgb(0, 0, 0); "><br /> </span><span class="pun" style="color: rgb(102, 102, 0); ">}</span><span class="pln" style="color: rgb(0, 0, 0); "><br /> values</span><span class="pun" style="color: rgb(102, 102, 0); ">.</span><span class="pln" style="color: rgb(0, 0, 0); ">add</span><span class="pun" style="color: rgb(102, 102, 0); ">(</span><span class="pln" style="color: rgb(0, 0, 0); ">v</span><span class="pun" style="color: rgb(102, 102, 0); ">);</span><span class="pln" style="color: rgb(0, 0, 0); "><br /></span><span class="pun" style="color: rgb(102, 102, 0); ">}</span></pre><p>No comment ;)</p></a></span>Mikahttp://www.blogger.com/profile/00462836780238171043noreply@blogger.com0tag:blogger.com,1999:blog-46623913359353639.post-34618525037546302722010-05-26T00:29:00.010+02:002010-06-02T13:01:50.530+02:00EMFPath is available on Eclipse Labs<div>The <a href="http://code.google.com/a/eclipselabs.org/p/emfpath/">EMFPath</a> project is now available on <a href="http://code.google.com/a/eclipselabs.org/hosting/">EclipseLabs</a>.</div><div><br /><a href="http://code.google.com/a/eclipselabs.org/p/emfpath/">EMFPath</a> is a Java framework based on Google Collections for browsing / editing <a href="http://www.eclipse.org/modeling/emf/">EMF models</a>. It has a concise and DSL-like API and has been designed with performance in mind.<br /></div><div>There are no binary build yet, the API is still in Beta stage and then subject to change. It also lacks some documentations like a "Quick start", but everything is released so you can use it today.</div><div><a href="http://code.google.com/a/eclipselabs.org/p/emfpath/">http://code.google.com/a/eclipselabs.org/p/emfpath/</a></div><div><br />You are welcome to provide feedback / comments / reviews / contributions ;)</div>Mikahttp://www.blogger.com/profile/00462836780238171043noreply@blogger.com0tag:blogger.com,1999:blog-46623913359353639.post-50736759010769318732010-05-15T08:45:00.006+02:002010-06-02T13:01:50.530+02:00Eclipse Labs is now open<a href="http://dev.eclipse.org/blogs/mike/2010/05/13/introducing-eclipse-labs/">Eclipse</a> and <a href="http://googlecode.blogspot.com/2010/05/announcing-eclipse-labs.html">Google</a> announced <a href="http://eclipselabs.org/">Eclipse Labs</a>. It has been a long awaited initiative from the community. This is an opportunity for anyone creating an Eclipse-based software to be exposed as a part of the Eclipse Ecosystem. The hosting system is based on Google Code project hosting. It is even possible to <a href="http://code.google.com/p/support/issues/entry?template=Migration%20request">migrate projects</a> already hosted at Google. All details can be found in the <a href="http://eclipse.org/org/foundation/eclipselabs/faq.php">FAQ</a>.Mikahttp://www.blogger.com/profile/00462836780238171043noreply@blogger.com0tag:blogger.com,1999:blog-46623913359353639.post-23656474753408647622010-04-19T10:03:00.010+02:002010-06-02T13:01:50.530+02:00What Model Driven (Engineering / Architecture / Development) is not ?Model Driven (Engineering / Architecture / Development) is not about generating Java class skeletons from an UML class diagram. If you still think like that, I suggest you to read the <a href="http://www.slideshare.net/merks/the-unbearable-stupidity-of-modeling-presentation">Ed Merk's slides</a> about the "The Unbearable Stupidity of Modeling". This title is a beautiful self-mockery from the man of <a href="http://eclipse.org/modeling/">modeling at Eclipse</a> but above all, it's a very good listening of different criticisms from the community and gathers a set of objective answers.<div><br /></div><div>Hope this will convinced you that modeling is not just UML to Java...</div>Mikahttp://www.blogger.com/profile/00462836780238171043noreply@blogger.com0