Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 30352229321f83dea72491ed6f127c00946a466c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
<?xml version='1.0' encoding='utf-8' ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/></head><body><h2 id="Browser_Registry">Browser Registry</h2><p>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.</p><h3 id="Registering_a_model_browser">Registering a model browser</h3><p>To register a model browser, you must use the <b>org.eclipse.papyrus.emf.facet.util.emf.core</b> extension point, and provide a subset or all of the following interfaces (through the <b>ePackageViewer</b>, <b>eObjectViewer</b> and <b>resourceViewer</b> elements in the extension):</p><ul><li>implement <b>IEPackageBrowserOpener</b> if the model browser that your are registering can be opened on an EPackage</li><li>implement <b>IEObjectBrowserOpener</b> if the model browser that your are registering can be opened on an EObject</li><li>implement <b>IResourceBrowserOpener</b> if the model browser that your are registering can be opened on an EMF Resource.</li></ul><h3 id="Querying_the_registry">Querying the registry</h3><p>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:</p><p><code>List&lt;IEObjectBrowserOpener&gt; openers = IBrowserRegistry.INSTANCE.getAllRegisteredEObjectBrowsers();</code></p><p>Or to get the default model browser for Resources:</p><p><code>IResourceBrowserOpener defaultOpener = IBrowserRegistry.INSTANCE.getDefaultResourceBrowserOpener();</code></p><p>You can also ask the registry to directly open the given Resource/EObject/EPackage. For example:</p><p><code>IBrowserRegistry.INSTANCE.browseResource(targetModel);</code></p><h2 id="Serialization">Serialization</h2><p>You can use extension point <i>org.eclipse.papyrus.emf.facet.widgets.celleditors.serialization</i> to specify an implementation for serializing specific types.
A serializer can be registered like this:</p><pre>&lt;extension point="org.eclipse.papyrus.emf.facet.util.emf.core.serialization"&gt;
   &lt;serializer class="com.example.MyTypeSerializer"/&gt;
&lt;/extension&gt;
</pre><p><font size="-2">
Copyright &#169; 2012 Mia-Software.
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
which accompanies this distribution, and is available at
<a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
</font></p></body></html>

Back to the top