47117776
MD190SP3
3
Versions Compared
compared with
Key
- This line was added.
- This line was removed.
- Formatting was changed.
You will need NetBeans IDE 6.7.1 or 6.8 with Groovy Plugin to develop Groovy scripts. The Groovy support comes with NetBeans "Java" and "All" package. If your NetBeans does not have Groovy, download the plugin through NetBeans Plugin Manager. For more information about adding a new plugin, click IDE Basics > Plugins > Updating the IDE on the NetBeans Help menu.
Use the following three simple steps to develop and run a Groovy script in NetBeans:
- Set up a classpath.
- Develop a Groovy script.
To set up a classpath
- Click Tools > Libraries on the main menu. The Library Manager dialog will open.
- Click the New Library button. The New Library dialog will open.
- Specify a library name, for example, MD16.8. The Library Type must be Class Libraries.
- Click OK to close the New Library dialog.
- Select your new library in the Libraries tree.
- Click the Add JAR/Folder button button and add all the JAR files in <MagicDraw> <modeling tool name>/lib.
- Repeat steps 2 to 6 to add the Groovy library that is in <MagicDraw><modeling tool name>/plugins/com.nomagic.magicdraw.automaton/engines/groovy-2.0.1/embeddable/groovy-all-2.0.1.jar.
- Click OK to close the Library Manager dialog.
To develop a Groovy script
- Click File > New Project on the main menu to create a Java application project. The New Project dialog will open.
- Select Java in the Categories box and Java Application in the Projects box, and then click Next.
- Choose a project location. Be sure that you do not select Create Main Class.
- Click Finish.
- Expand your project node in the Project window. The Libraries node will appear.
- Right-click the Libraries node and select Add Library from the shortcut menu.
- Click File > New File on the main menu to add a new Groovy file.
- Select Groovy in the Categories box and Groovy Script in the File Types box.
- Follow the instructions until finish.