This tutorial will guide you through the development of a simple application based on Sphinx. The resulting application is quite simple (1 class, 2 projects, few extension point contributions). However, thanks to the power of Sphinx, it is really functional.
Our application is a model-based application. For the purpose of this tutorial we will use the Extended Library Model Example provided by EMF.
The example meta-model is provided by EMF. It consists in three generated plug-ins. Getting them is quite simple:
The meta-model descriptor is a key-notion of Sphinx. It consists in a class identifying a meta-model to be used in the workspace. Each application based on Sphinx has to provide such a meta-model descriptor for each meta-model it uses.
Edit the EXTLibraryMMDescriptor code to add the following default constructor:
public EXTLibraryMMDescriptor() { super("org.eclipse.sphinx.examples.library", EXTLibraryPackage.eNS_URI); }
TODO: Explain the object of this extension point.
This plug-in contributes to the meta-model descriptor provided by Sphinx.
id | org.eclipse.sphinx.examples.extlibrary |
class | org.eclipse.sphinx.examples.library.ide.metamodel.EXTLibraryMMDescriptor |
Now we will create a second plug-in which deals with all what is related to the user interface. This plug-in does not contain any code. It only contributes to extension points of the Eclipse UI.
Now the project exists and may contribute to extension points.
TODO: Explain the object of this extension point.
First, the UI plug-in contributes to the navigator viewer.
viewerId | org.eclipse.sphinx.examples.explorer.views.modelExplorer |
pattern | org.eclipse.sphinx.examples.library.ide.ui.navigatorContent.extendedlibrary |
TODO: Explain the object of this extension point.
The UI plug-in contributes to the navigator content.
id | org.eclipse.sphinx.examples.library.ide.ui.navigatorContent.extendedLibrary |
name | Extended Library Content |
contentProvider | org.eclipse.sphinx.emf.explorer.BasicExplorerContentProvider |
labelProvider | org.eclipse.sphinx.emf.explorer.BasicExplorerLabelProvider |
value | org.eclipse.core.resources.IFile |
property | org.eclipse.sphinx.emf.isInScope |
value | true |
property | org.eclipse.sphinx.emf.metaModelIdMatches |
value | org\.eclipse\.sphinx\.examples\.extlibrary |
value | org.eclipse.emf.ecore.EObject |
property | org.eclipse.sphinx.emf.classNameMatches |
value | org\.eclipse\.emf\.examples\.extlibrary\..* |
id | org.eclipse.sphinx.examples.library.ide.ui.navigatorContent.dropAssistant.extendedLibrary |
class | org.eclipse.sphinx.emf.explorer.BasicDropAdapterAssistant |
value | org.eclipse.emf.ecore.EObject |
TODO: Explain the object of this extension point.
The UI plug-in contributes to the Eclipse editors.
id | org.eclipse.sphinx.examples.library.ide.ui.editors.extendedLibrary |
name | Extended Library Example Editor |
icon | <path to a gif file used as an icon> |
extensions | Library, Writer, Book |
class | org.eclipse.sphinx.emf.editors.forms.BasicTransactionalFormEditor |
contributorClass | org.eclipse.sphinx.emf.editors.forms.BasicTransactionalEditorActionBarContributor |
contentTypeId | org.eclipse.emf.examples.library.extendedLibrary |
TODO: Explain the object of this extension point.
The UI plug-in contributes to the property contributor.
contributorId | org.eclipse.sphinx.examples.library.ide.ui.editors.extendedlibrary |
labelProvider | org.eclipse.sphinx.examples.common.ui.providers.AppearanceExampleTabbedPropertySheetTitleProvider |
category | advanced |
TODO: Explain the object of this extension point.
The UI plug-in contributes to the property tab.
contributorId | org.eclipse.sphinx.examples.library.ide.ui.editors.extendedLibrary |
label | Advanced |
category | advanced |
id | org.eclipse.sphinx.examples.library.ide.ui.propertyTabs.advanced |
TODO: Explain the object of this extension point.
The UI plug-in contributes to the property sections.
contributorId | org.eclipse.sphinx.examples.library.ide.ui.editors.extendedLibrary |
tab | org.eclipse.sphinx.examples.library.ide.ui.propertyTabs.advanced |
id | org.eclipse.sphinx.examples.library.ide.ui.propertySections.advanced |
class | org.eclipse.sphinx.emf.ui.properties.BasicTransactionalAdvancedPropertySection |
type | java.lang.Object |