]> gerrit.simantics Code Review - simantics/sysdyn.git/commitdiff
Introduced SearchQuery object, which holds search related parameters
authorluukkainen <luukkainen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Wed, 16 Oct 2013 10:49:45 +0000 (10:49 +0000)
committerluukkainen <luukkainen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Wed, 16 Oct 2013 10:49:45 +0000 (10:49 +0000)
Fixed empty results handling

refs #4452

git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@27982 ac1ea38d-2e2b-0410-8846-a27921b304fc

org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/function/ModulesSearchFunction.java

index c228b394d88d7fa3ea7d946642bb545517dc030a..c1cf02a45991adfaf97f697abf7c8f1860352b97 100644 (file)
@@ -41,6 +41,7 @@ import org.simantics.sysdyn.SysdynResource;
 import org.simantics.sysdyn.ui.handlers.FindSearchTrim;\r
 import org.simantics.sysdyn.ui.handlers.FindSearchTrim.Scope;\r
 import org.simantics.workbench.search.NamedResource;\r
+import org.simantics.workbench.search.SearchQuery;\r
 import org.simantics.workbench.search.SearchResult;\r
 import org.simantics.workbench.search.Searching;\r
 \r
@@ -51,15 +52,15 @@ import org.simantics.workbench.search.Searching;
  * @author Tuukka Lehtonen\r
  * @author Tuomas Miettinen\r
  */\r
-public class ModulesSearchFunction extends FunctionImpl5<IProgressMonitor, ReadGraph, Resource, String, Integer, Collection<SearchResult>> {\r
+public class ModulesSearchFunction extends FunctionImpl5<IProgressMonitor, ReadGraph, Resource, SearchQuery, Integer, Collection<SearchResult>> {\r
 \r
        private final int MAX_RESULTS = 50000;\r
        \r
     @Override\r
-    public Collection<SearchResult> apply(IProgressMonitor monitor, ReadGraph graph, Resource model, String query, Integer maxResults) {\r
+    public Collection<SearchResult> apply(IProgressMonitor monitor, ReadGraph graph, Resource model, SearchQuery query, Integer maxResults) {\r
         try {\r
                // Check whether only currently open diagram is searched\r
-               String filteredQuery = query.replace(FindSearchTrim.CURRENT_DIAGRAM_OPTION, "");\r
+               String filteredQuery = query.getQuery().replace(FindSearchTrim.CURRENT_DIAGRAM_OPTION, "");\r
                Collection<Map<String, Object>> results = Searching.performSearch(graph,\r
                     Layer0X.getInstance(graph).Dependencies, model, filteredQuery, MAX_RESULTS);\r
 \r