From d5880d84d466e37705128335d35d42a16c20b8ca Mon Sep 17 00:00:00 2001 From: luukkainen Date: Thu, 8 Jan 2009 14:57:16 +0000 Subject: [PATCH] git-svn-id: https://www.simantics.org/svn/simantics/3d/branches/dev@8536 ac1ea38d-2e2b-0410-8846-a27921b304fc --- .../META-INF/MANIFEST.MF | 3 ++- .../dialogs/LibraryComponentDialog.java | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/org.simantics.proconf.processeditor/META-INF/MANIFEST.MF b/org.simantics.proconf.processeditor/META-INF/MANIFEST.MF index c70a17ee..132bac2c 100644 --- a/org.simantics.proconf.processeditor/META-INF/MANIFEST.MF +++ b/org.simantics.proconf.processeditor/META-INF/MANIFEST.MF @@ -24,4 +24,5 @@ Require-Bundle: org.eclipse.ui, org.eclipse.ui.views, org.simantics.animation Eclipse-LazyStart: true -Export-Package: org.simantics.processeditor.tools +Export-Package: org.simantics.processeditor.stubs, + org.simantics.processeditor.tools diff --git a/org.simantics.proconf.processeditor/src/org/simantics/processeditor/dialogs/LibraryComponentDialog.java b/org.simantics.proconf.processeditor/src/org/simantics/processeditor/dialogs/LibraryComponentDialog.java index f6b9473c..63961a98 100644 --- a/org.simantics.proconf.processeditor/src/org/simantics/processeditor/dialogs/LibraryComponentDialog.java +++ b/org.simantics.proconf.processeditor/src/org/simantics/processeditor/dialogs/LibraryComponentDialog.java @@ -132,6 +132,25 @@ public class LibraryComponentDialog extends Dialog{ Resource projectResource = ProConfUI.getProject().getResource(); Stack handling = new Stack(); handling.push(projectResource); + + // this is just a hack to get equipment defined in ontologies + Resource projectsLib = g.getObjects(projectResource, g.getBuiltins().PartOf).iterator().next(); + Collection projects = g.getObjects(projectsLib, g.getBuiltins().ConsistsOf); + Resource typeSystemProject = null; + for (Resource project : projects) { + IEntity ent = EntityFactory.create(g,project); + String name = ent.getName(); + if(name.equals("Type System Project")) { + typeSystemProject = project; + break; + } + } + Collection ontologies = g.getObjects(typeSystemProject, g.getBuiltins().ConsistsOf); + for (Resource ontology : ontologies) { + if(g.isInstanceOf(ontology, g.getBuiltins().Ontology)) + handling.add(ontology); + } + while (!handling.isEmpty()) { final Resource node = handling.pop(); if (g.isInstanceOf(node,primaryType)) { -- 2.45.2