From a3786ffcf729e3a39de868c2ed07263485ccdd72 Mon Sep 17 00:00:00 2001 From: lehtonen Date: Fri, 5 Jul 2013 13:01:40 +0000 Subject: [PATCH] Fixed workbench search to work better with multiple active models, as in Sysdyn. refs #3966 git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@27696 ac1ea38d-2e2b-0410-8846-a27921b304fc --- .../ui/function/ModulesSearchFunction.java | 21 ++----------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/function/ModulesSearchFunction.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/function/ModulesSearchFunction.java index ba8f42a1..68d716c5 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/function/ModulesSearchFunction.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/function/ModulesSearchFunction.java @@ -11,7 +11,6 @@ *******************************************************************************/ package org.simantics.sysdyn.ui.function; -import java.io.IOException; import java.util.ArrayList; import java.util.Collection; import java.util.HashSet; @@ -29,20 +28,14 @@ import org.simantics.db.layer0.genericrelation.Dependencies; import org.simantics.diagram.stubs.DiagramResource; import org.simantics.layer0.Layer0; import org.simantics.operation.Layer0X; -import org.simantics.scl.runtime.function.FunctionImpl4; import org.simantics.scl.runtime.function.FunctionImpl5; -import org.simantics.sysdyn.SysdynResource; import org.simantics.workbench.search.NamedResource; -import org.simantics.workbench.search.QueryResult; import org.simantics.workbench.search.SearchResult; import org.simantics.workbench.search.Searching; -//import fi.vtt.apros.AprosBuiltins; -import freemarker.template.TemplateException; - /** * modulesSearchFunction: - * (ReadGraph, query : String, maxResults : Integer) -> QueryResult + * (IProgressMonitor, ReadGraph, model : Resource, query : String, maxResults : Integer) -> QueryResult * * @author Tuukka Lehtonen */ @@ -63,9 +56,7 @@ public class ModulesSearchFunction extends FunctionImpl5 generateSearchResults(ReadGraph graph, Collection> results) throws DatabaseException { - System.out.println(results.size()); - Layer0 L0 = Layer0.getInstance(graph); - SysdynResource SR = SysdynResource.getInstance(graph); + Layer0 L0 = Layer0.getInstance(graph); DiagramResource DIA = DiagramResource.getInstance(graph); Collection result = new ArrayList(results.size()); @@ -74,14 +65,6 @@ public class ModulesSearchFunction extends FunctionImpl5 r : results) { Resource resource = (Resource) r.get(Dependencies.FIELD_RESOURCE); - // Ignore non-AprosModules - /*if (!graph.isInstanceOf(resource, APROS.AprosModule)) - continue; - - // Ignore attached default modules. - if (graph.hasStatement(resource, APROS.AttachedModule)) - continue;*/ - // Prevent index corruption from producing duplicate results. if (!processed.add(resource)) continue; -- 2.47.1