<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>MDA, MDSD, MDE, MDWhatever! &#187; debug</title>
	<atom:link href="http://mdwhatever.free.fr/index.php/tag/debug/feed/" rel="self" type="application/rss+xml" />
	<link>http://mdwhatever.free.fr</link>
	<description>About model driven engineering</description>
	<lastBuildDate>Mon, 12 Mar 2012 19:56:30 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>How to debug your MagicDraw plugin with Eclipse</title>
		<link>http://mdwhatever.free.fr/index.php/2010/07/how-to-debug-your-magicdraw-plugin/</link>
		<comments>http://mdwhatever.free.fr/index.php/2010/07/how-to-debug-your-magicdraw-plugin/#comments</comments>
		<pubDate>Sat, 03 Jul 2010 05:08:10 +0000</pubDate>
		<dc:creator>xavier</dc:creator>
				<category><![CDATA[Model Driven]]></category>
		<category><![CDATA[debug]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[magicdraw]]></category>
		<category><![CDATA[magicdraw open API]]></category>
		<category><![CDATA[plugins]]></category>

		<guid isPermaLink="false">http://mdwhatever.free.fr/?p=143</guid>
		<description><![CDATA[After reading this post, you are now MagicDraw open API experts! But you still need to debug your plugins! Here is a short presentation on how to debug your MagicDraw plugin with Eclipse. Create your MagicDraw user library First of all you need to create a user library (Window&#62;Preferences&#62;Java&#62;Build Path&#62;User Libraries) in Eclipse containing every]]></description>
			<content:encoded><![CDATA[<p>After reading this <a title="post" href="http://mdwhatever.free.fr/index.php/2010/03/how-to-develop-your-magicdraw-plugin/" target="_blank">post</a>, you are now MagicDraw open API experts! But you still need to debug your plugins! Here is a short presentation on how to debug your MagicDraw plugin with Eclipse.</p>
<p><span id="more-143"></span></p>
<h2>Create your MagicDraw user library</h2>
<p>First of all you need to create a user library (Window&gt;Preferences&gt;Java&gt;Build Path&gt;User Libraries) in Eclipse containing <strong>every *.jar</strong> from the &#8220;<strong>&lt;MagicDraw_Install_Dir&gt;/lib</strong>&#8221; and its subfolders.</p>
<p style="text-align: center;"><a href="http://mdwhatever.free.fr/wp-content/uploads/MagicDrawUserLibrary.png" rel="shadowbox[post-143];player=img;" title="MagicDraw User Library"><img class="size-medium wp-image-148 aligncenter" style="border: 1px solid black;" title="MagicDraw User Library" src="http://mdwhatever.free.fr/wp-content/uploads/MagicDrawUserLibrary-300x187.png" alt="" width="300" height="187" /></a></p>
<h2>Create your debug project</h2>
<p>Create a new Java Project, and then you need to reference your plugin project in the build path of your debug project : (Right click ﻿on the project&gt;Configure build path)</p>
<p style="text-align: center;"><a href="http://mdwhatever.free.fr/wp-content/uploads/Properties-for-magicdraw-debug-.png" rel="shadowbox[post-143];player=img;" title="Add your plugin project to the build path"><img class="aligncenter size-medium wp-image-144" style="border: 1px solid black;" title="Add your plugin project to the build path" src="http://mdwhatever.free.fr/wp-content/uploads/Properties-for-magicdraw-debug--300x199.png" alt="" width="300" height="199" /></a></p>
<p>Here I take the Eclipse project given in this <a title="post" href="http://mdwhatever.free.fr/index.php/2010/03/how-to-develop-your-magicdraw-plugin/" target="_blank">post</a>.</p>
<p>Then you need to create a main class which will init your plugin and launch MagicDraw :</p>
<pre lang="java">
package fr.free.mdwhatever.magicdrawDebug;

import com.nomagic.magicdraw.core.Application;
import com.nomagic.runtime.ApplicationExitedException;

import fr.free.mdwhatever.simplePlugin.SimplePlugin;
/**
 * This class allows you to debug your MagicDraw plugin
 *
 * @author Xavier Seignard
 */
public class Debug {
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		try {
			SimplePlugin plugin = new SimplePlugin();
			Application app = Application.getInstance();
			// Start the application (visible, not silent,
			// don't try to load a project, the given args,
			// the StartUp participant)
			app.start(true, false, false, args, null);
			plugin.init();
		} catch (ApplicationExitedException e) {
			e.printStackTrace();
		}
	}
}
</pre>
<p>Then all you need to do is to right-click on this class and choose &#8220;Debug as&#8221; to launch MagicDraw within the Eclipse debugger and use all the functionalities it gives us!</p>
<p><strong>Nota :</strong> Maybe you&#8217;ll need to tune up a bit more your debug configuration by adding &#8220;-Xmx1024m&#8221; as VM argument as shown below :</p>
<p style="text-align: center;"><a href="http://mdwhatever.free.fr/wp-content/uploads/RunConfiguration.png" rel="shadowbox[post-143];player=img;" title="Run Configuration VM argument"><img class="aligncenter size-medium wp-image-154" style="border: 1px solid black;" title="Run Configuration VM argument" src="http://mdwhatever.free.fr/wp-content/uploads/RunConfiguration-300x197.png" alt="" width="300" height="197" /></a></p>
<p>Hope this helps! See you!</p>
]]></content:encoded>
			<wfw:commentRss>http://mdwhatever.free.fr/index.php/2010/07/how-to-debug-your-magicdraw-plugin/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
