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 for the quick answer but I get no notifications on model opening/loading.
I have implemented the IPapyrusListener interface and registered it into the org.eclipse.papyrus.infra.core.modellistener extension.
It will give me a lot of notifications when things are happening in a loaded model, but NOT any notification on the actual opening/loading of the model.
If I have an empty model without any profile applications, the registered listener will not give me any notifications at all when the model is opened/loaded.
Startup services might be more appropriate, as you can add dependencies, especially to the IMultiDiagramEditor service.
Models/ModelSnippets will be called for each model loaded in memory, which isn't necessarily related to opening an editor. For example, when using the Model Search on the workspace, models are loaded in-memory but not opened in an editor.
So, registering a startup service (via the org.eclipse.papyrus.infra.core.services extension point) with a dependency to the editor service (org.eclipse.papyrus.infra.core.editor.IMultiDiagramEditor) is probably the most reliable solution