MagicDraw 18.5 Documentation
The preconfigured Eclipse projects for two sample plugins and a batch mode (command-line) tool are provided with a program installation. These projects can be found in <modeling tool installation directory>\openapi\ide\eclipse.zip.
Let's use MagicDraw as an example to describe the following procedures.
Make sure MagicDraw installation directory does not contain spaces.
To setup the Eclipse environment for the modeling tool development
Start Eclipse IDE. To install Eclipse SDK, from the main menu, select Help > Install New Software. The Install dialog opens. In the Work with list, select All Available Sites, and, in the filter box, type eclipse sdk and press Enter. All available Eclipse versions are listed. Click to select Eclipse SDK and go Next. Follow the installation wizard steps to proceed software installation process.
In case you have Eclipse IDE for Eclipse Committers, Eclipse SDK is already available in your IDE and you can skip this step.
- After the installation completes, import java projects from <modeling tool installation directory>\openapi\ide\eclipse.zip into your Eclipse Workspace. On the main menu, click File > Import. The Import dialog opens. In the Select an import source list, select General > Existing Projects into Workspace and click Next. Copy the java project location to the Select archive file box or browse to the java projects and click Browse. The project list appears in the Projects box. Select projects you need and click Finish.
Open the Package Explorer view, expand the MagicDraw project and edit the MAGIC_DRAW_INSTALL_DIRECTORY link:
3.1. Right-click the link and select Properties.
3.2. On the left side of the opened dialog, select Resource and click the Edit button on the right side of the dialog. The Edit Link Location dialog opens.
3.3. Select the location and click OK.
Be sure the link points to your MagicDraw (or other according to a modeling tool you are using) installation directory (see the following figure). Installation directory must not contain spaces.
In the Package Explorer, expand the MagicDraw project and open target definition file MagicDraw bundles+Running Platform.target. Click Set as Target Platform.
Locate two exemplary launch configurations in the Package Explorer.
5.1. MagicDraw with all plugins.launch is in the project MagicDraw with all plugins. It launches MagicDraw (or other modeling tool) with plugins available in the IDE workspace namely My Plugin 1 and My Plugin 2.
The libraries (jar files) of the plugin must be added to the development class path throughout the plugin dependency hierarchy if the developing code depends on that plugin.
For example, if the code depends on plugin A; plugin A depends on plugins B and C; plugin B depends on plugin D, the libraries of all plugins (A, B, C, and D) must be added to the class path.
5.2. My Commandline.launch is in the project My Commandline. It launches batch mode tool My Commandline.
Eclipse Workspace is ready for the source code development and running/debugging.
Even if the plugin descriptor file contains information about the runtime plugin .jar file, it is not necessary to build and deploy this .jar file to a plugin directory while the plugin is developed under Eclipse.