From 89a536af0ed37193b5e5defb4c4388f6b804a322 Mon Sep 17 00:00:00 2001 From: luukkainen Date: Wed, 16 Oct 2013 10:49:45 +0000 Subject: [PATCH] Introduced SearchQuery object, which holds search related parameters Fixed empty results handling refs #4452 git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@27982 ac1ea38d-2e2b-0410-8846-a27921b304fc --- .../sysdyn/ui/function/ModulesSearchFunction.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 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 c228b394..c1cf02a4 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 @@ -41,6 +41,7 @@ import org.simantics.sysdyn.SysdynResource; import org.simantics.sysdyn.ui.handlers.FindSearchTrim; import org.simantics.sysdyn.ui.handlers.FindSearchTrim.Scope; import org.simantics.workbench.search.NamedResource; +import org.simantics.workbench.search.SearchQuery; import org.simantics.workbench.search.SearchResult; import org.simantics.workbench.search.Searching; @@ -51,15 +52,15 @@ import org.simantics.workbench.search.Searching; * @author Tuukka Lehtonen * @author Tuomas Miettinen */ -public class ModulesSearchFunction extends FunctionImpl5> { +public class ModulesSearchFunction extends FunctionImpl5> { private final int MAX_RESULTS = 50000; @Override - public Collection apply(IProgressMonitor monitor, ReadGraph graph, Resource model, String query, Integer maxResults) { + public Collection apply(IProgressMonitor monitor, ReadGraph graph, Resource model, SearchQuery query, Integer maxResults) { try { // Check whether only currently open diagram is searched - String filteredQuery = query.replace(FindSearchTrim.CURRENT_DIAGRAM_OPTION, ""); + String filteredQuery = query.getQuery().replace(FindSearchTrim.CURRENT_DIAGRAM_OPTION, ""); Collection> results = Searching.performSearch(graph, Layer0X.getInstance(graph).Dependencies, model, filteredQuery, MAX_RESULTS); -- 2.47.1