|
Re: Add all ecore Files in Workspace as Semantic Resource [message #1776161 is a reply to message #1776156] |
Mon, 13 November 2017 10:19 |
|
Hello,
On your modeling project (in the Model Explorer view), on the "Project Dependencies" you have a contextual menu "Add model". This will open a dialog window to choose a model from the workspace or from the file system.
Also note that Session.getSemanticResources() will return all semantic resources used wherever they are in the project or not.
Regards,
Steve
Steve Monnier - Obeo Canada
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
|
|
|
|
|
Re: Add all ecore Files in Workspace as Semantic Resource [message #1776180 is a reply to message #1776168] |
Mon, 13 November 2017 13:46 |
|
Hello again,
Ah ok you want to do it programatically. You can create the URI using URI.createPlatformResourceURI(path, true) where path is "/project-name/path-to-my-model" and then you execute the org.eclipse.sirius.tools.api.command.semantic.AddSemanticResourceCommand like this:
Command addSemanticResourceCmd = new AddSemanticResourceCommand(session, semanticResourceURI, new NullProgressMonitor());
session.getTransactionalEditingDomain().getCommandStack().execute(addSemanticResourceCmd);
You can find many test using this command if you need to have a look.
Regards,
Steve
Steve Monnier - Obeo Canada
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03913 seconds