我试图以编程方式加载e4应用程序模型以便能够在模型元素上进行迭代。目前我面临的问题是,我不知道如何正确加载它。以编程方式加载e4应用程序模型
鉴于Application.e4xmi
我试图简单地加载文件,使用简单的load an existing model,但是没有导致填充资源(null)。
然后我发现了org.eclipse.e4.tools.emf.ui.common.XMIModelResource
,不过,我不能够使用下面的代码
URI uriNew = URI.createURI("file:///Users/marco/github-clones/osara/at.osara.rcp/Application.e4xmi");
XMIModelResource xmimr = new XMIModelResource(uriNew);
实例化模型,我得到Package with uri 'http://www.eclipse.org/ui/2010/UIModel/application' not found.
此的Ecore但是位于已经导入org.eclipse.e4.ui.model.workbench
任何人对此有何暗示?谢谢!
我很抱歉,那不是问题!在你的信息中加载一个已经可用的应用程序的应用程序模型!我正试图从文件中加载应用程序模型而不使用它! –
奇怪的是,我得到以下内容: URI uriNew = URI.createURI(“file:///Users/kirill/Documents/Dev/DW/DomainWorkbench/org.domainworkbench/Application.e4xmi”); \t \t XMIModelResource xmimr = new XMIModelResource(uriNew); \t \t assertNotNull(xmimr); assertEquals(1,xmimr.getRoot()。size()); 依赖关系: 要求-软件包:org.eclipse.core.runtime, org.junit, org.eclipse.e4.tools.emf.ui;捆绑版本= “0.12.0”, org.eclipse.platform ; bundle-version =“4.3.0”, org.eclipse.core.databinding.observable; bundle-version =“1.4.1” green ... – Kyrill
而对于org.eclipse.platform; bundle-version =“ 4.2.1“它也起作用。 (当然,对于没有DynamicMenuContributions的模型...)。 – Kyrill