How to listen to models being loaded? [message #1406934] |
Mon, 11 August 2014 09:20  |
Eclipse User |
|
|
|
What is the proper way to, from a plug-in, listen to and act upon a model being loaded in Papyrus 1.0, e.g. opened in the Model Explorer.
I assume there is some way to register a listener on models being loaded, but I cannot find the proper way to do so by studying the Papyrus source code.
Thanks in advance,
Thomas
|
|
|
|
|
|
|
|
|
|
|
Re: How to listen to models being loaded? [message #1691610 is a reply to message #1623789] |
Wed, 08 April 2015 09:07  |
Eclipse User |
|
|
|
Thanks, Camille, this works great!
For the record, my plugin.xml looks like this:
<extension
point="org.eclipse.papyrus.infra.core.service">
<service
classname="service.Service1"
priority="1"
startKind="startup">
<dependsOn
serviceKeyRef="org.eclipse.papyrus.infra.core.editor.IMultiDiagramEditor"></dependsOn>
<dependsOn
serviceKeyRef="org.eclipse.papyrus.infra.core.resource.ModelSet">
</dependsOn>
</service>
</extension>
And the Service1 class:
public void startService() throws ServiceException {
ModelSet modelSet = servicesRegistry.getService(ModelSet.class);
IMultiDiagramEditor diagramEditor = servicesRegistry.getService(IMultiDiagramEditor.class);
}
|
|
|
Powered by
FUDForum. Page generated in 0.06707 seconds