我試圖以編程方式加載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