![]() ![]() |
||||
|
||||
The
simplest way to create an OSATE plug-in is to either copy and paste one of the example
plug-in projects such as the Architecture project, or to import an OSATE plug-in project
template (we
will need to set one up).
This is the simplest way because it already provides a
skeleton implementation of the plug-in. |
||||
Here we create a new plug-in project using the Eclipse project wizard.
Figure
1: Creating a new project.
Figure
2: Selecting the plug-in project wizard.
A new project and source tree will be created; the structure of the newly created
plug-in
package is shown in Figure 3.
![]() Figure
3: The contents of the new plug-in project.
The wizards creates
|
||||
Our
first concern is establishing the plug-ins dependencies on other plug-ins. Plug-ins export
Java packages into the Eclipse environment and, conversely, must declare which plug-ins they
depend on. By default, a plug-in project generated from the Plug-in Project wizard
already
depends on the org.eclipse.ui and org.eclipse.core.runtime plug-ins. Our model statistics
plug-in utilizes the AADL meta-model, which is itself modeled in the EMF framework. The
plug-in, therefore, also depends on the edu.cmu.sei.aadl.model plug-in and the
org.eclipse.emf.ecore plug-in. In general, it is expected that any OSATE plug-in will use
the
AADL meta-model, and thus depend on these two packages.
Our
model statistics plug-in also depends on the plug-in edu.cmu.sei.osate.ui. This plug-in
defines abstract implementations of Eclipse actions that we extend to drive the plug-in from
Eclipses user interface; see Section 3.3.1 Eclipse Actions. See Section 9 Packages
Provided by the OSATE Plug-ins for a description of which packages are in which OSATE
plug-ins.
Plug-in
dependencies are declared in the plugin.xml file:
![]() Figure 4: Editing a plug-in's dependencies.
![]() Figure 5: Selecting a plug-in.
Alternatively,
you can edit the XML directly by going to the plugin.xml pane. The
dependencies are declared in the requires clause, e.g.,
<requires> <importplugin="org.eclipse.ui"/> <importplugin="org.eclipse.core.runtime"/> <importplugin="edu.cmu.sei.aadl.model"/> <importplugin="org.eclipse.emf.ecore"/> <importplugin="edu.cmu.sei.osate.ui"/> </requires> |
||||