Sphinx provides an example called Hummingbird to illustrate its main interesting features. This example consists in a small model-based application manipulating a meta-model.
Sphinx is able to manage simultaneously several versions of a same metamodel. Thus, two ecore models are provided, Hummingbird10 and Hummingbird20, that represent version 1.0 and version 2.0 of a same meta-model.
This tutorial introduces the Hummingbird example and proposes a step-by-step tour of its main functions.
The first step consists in creating a new project to experiment the Hummingbird example.
The second step consists in creating a new model conform with the Hummingbird meta-model.
At this step, the project has no yet the Hummingbird nature.
To give the Hummingbird nature to our project, we need to edit the .project file.
<nature>org.eclipse.sphinx.examples.hummingbird.ide.HummingbirdNature</nature>
Now, the icon of the project has a new decoration, "20", that tells that the project has the Hummingbird nature. More precisely, it is supposed to be configured to the last version of the Hummingbird meta-model, 2.0.
A warning decoration also appears on the model icon to indicate that its version (Hummingbird 1.0) is not compatible with the version of the enclosing project. A message is available in the Problems view to explain this warning.
By default, the last version of the meta-model is supposed to be associated to the project. This preference may be changed by editing the .settings directory.
hummingbird.metamodel.version=org.eclipse.sphinx.examples.hummingbird10
Now the warning disappears and the nature decoration of the project changes.
An explorer example is provided to illustrate the relation with the edited models.
In this explorer we can see about the same content as in other navigator views, except that we also see the root object of our model.
Now we will add objects in our model.
Now the editor tab is marked dirty (with a star '*' in front of the name). The Model Explorer view is also marked dirty. Saving one of them will save the changes.
Several means exist to edit the model. Creating a new element may also be done from the Model Explorer view.
Sphinx provides many interesting features. Let's explore them through the Hummingbird example: