I am building a new perspective that will embeded papyrus ModelExplorerView.
References to the content to display are still stored in Papyrus .di file but I want te be able to specify on which file the ModelExpèlorer get the data without opening the MultiDiagramEditor.
I investigate how everything interact in order to setup this view.
I believe that I need to start a service registry probably like that
ServicesRegistry servicesRegistry = new ExtensionServicesRegistry(Activator.PLUGIN_ID);
Then load the model
// Start servicesRegistry
IFile file = ((IFileEditorInput)input).getFile();
try {
// Start the ModelSet first, and load if from the specified File
List<Class<?>> servicesToStart = new ArrayList<Class<?>>(1);
servicesToStart.add(ModelSet.class);
servicesRegistry.startServicesByClassKeys(servicesToStart);
resourceSet = servicesRegistry.getService(ModelSet.class);
resourceSet.loadModels(file);
// start remaining services
servicesRegistry.startRegistry();
} catch (ModelMultiException e) {
log.error(e);
throw new PartInitException("errors in model", e);
} catch (ServiceException e) {
log.error(e);
throw new PartInitException("could not initialize services", e);
}
After I think I am not sure what I really need, It seem that the ModelExplorerView need a Content Provider and an Editing domain. How do I get those and how to I provide them to ModelExplorer view without opening any MultiDiagramEditor ?