Papyrus Banner

Browser Registry

EMF Facet contains a registry for model browsers. When a component needs to open a model in Eclipse, it can query the registry to find a suitable model browser. EMF Facet lets end users choose which model browser they want to use through an Eclipse preference page.

Registering a model browser

To register a model browser, you must use the org.eclipse.papyrus.emf.facet.util.emf.core extension point, and provide a subset or all of the following interfaces (through the ePackageViewer, eObjectViewer and resourceViewer elements in the extension):

Querying the registry

You can obtain an interface used to open a model browser by querying the registry. For example, to get all model browsers that can be opened on EObjects:

List<IEObjectBrowserOpener> openers = IBrowserRegistry.INSTANCE.getAllRegisteredEObjectBrowsers();

Or to get the default model browser for Resources:

IResourceBrowserOpener defaultOpener = IBrowserRegistry.INSTANCE.getDefaultResourceBrowserOpener();

You can also ask the registry to directly open the given Resource/EObject/EPackage. For example:

IBrowserRegistry.INSTANCE.browseResource(targetModel);

Serialization

You can use extension point org.eclipse.papyrus.emf.facet.widgets.celleditors.serialization to specify an implementation for serializing specific types. A serializer can be registered like this:

<extension point="org.eclipse.papyrus.emf.facet.util.emf.core.serialization">
   <serializer class="com.example.MyTypeSerializer"/>
</extension>

Copyright © 2012 Mia-Software. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License 2.0 which accompanies this distribution, and is available at https://www.eclipse.org/legal/epl-2.0/.