X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=bundles%2Forg.simantics.workbench.search%2Fsrc%2Forg%2Fsimantics%2Fworkbench%2Fsearch%2FDependenciesSearchFunction.java;h=8a040223b1bf2d5ac264101908026826146a36c1;hb=refs%2Fchanges%2F38%2F238%2F2;hp=28baffad9b4cff411e5035eee00857db88b329c2;hpb=24e2b34260f219f0d1644ca7a138894980e25b14;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.workbench.search/src/org/simantics/workbench/search/DependenciesSearchFunction.java b/bundles/org.simantics.workbench.search/src/org/simantics/workbench/search/DependenciesSearchFunction.java index 28baffad9..8a040223b 100644 --- a/bundles/org.simantics.workbench.search/src/org/simantics/workbench/search/DependenciesSearchFunction.java +++ b/bundles/org.simantics.workbench.search/src/org/simantics/workbench/search/DependenciesSearchFunction.java @@ -1,46 +1,46 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Association for Decentralized Information Management - * in Industry THTH ry. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * VTT Technical Research Centre of Finland - initial API and implementation - *******************************************************************************/ -package org.simantics.workbench.search; - -import java.util.Collection; -import java.util.Map; - -import org.eclipse.core.runtime.IProgressMonitor; -import org.simantics.db.ReadGraph; -import org.simantics.db.Resource; -import org.simantics.db.common.utils.Logger; -import org.simantics.db.exception.DatabaseException; -import org.simantics.operation.Layer0X; -import org.simantics.scl.runtime.function.FunctionImpl5; - -/** - * dependenciesSearchFunction: - * (IProgressMonitor, ReadGraph, model : Resource, query : String, maxResults : Integer) -> QueryResult - * - * @author Tuukka Lehtonen - */ -public class DependenciesSearchFunction extends FunctionImpl5 { - - @Override - public SearchResult apply(IProgressMonitor monitor, ReadGraph graph, Resource model, SearchQuery query, Integer maxResults) { - try { - Collection> results = Searching.performSearch(graph, - Layer0X.getInstance(graph).Dependencies, model, query.getQuery("Name","Types"), maxResults); - - return Searching.generateDependenciesSearchResult(graph, results); - } catch (DatabaseException e) { - Logger.defaultLogError(e); - } - return null; - } - -} +/******************************************************************************* + * Copyright (c) 2007, 2010 Association for Decentralized Information Management + * in Industry THTH ry. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * VTT Technical Research Centre of Finland - initial API and implementation + *******************************************************************************/ +package org.simantics.workbench.search; + +import java.util.Collection; +import java.util.Map; + +import org.eclipse.core.runtime.IProgressMonitor; +import org.simantics.db.ReadGraph; +import org.simantics.db.Resource; +import org.simantics.db.common.utils.Logger; +import org.simantics.db.exception.DatabaseException; +import org.simantics.operation.Layer0X; +import org.simantics.scl.runtime.function.FunctionImpl5; + +/** + * dependenciesSearchFunction: + * (IProgressMonitor, ReadGraph, model : Resource, query : String, maxResults : Integer) -> QueryResult + * + * @author Tuukka Lehtonen + */ +public class DependenciesSearchFunction extends FunctionImpl5 { + + @Override + public SearchResult apply(IProgressMonitor monitor, ReadGraph graph, Resource model, SearchQuery query, Integer maxResults) { + try { + Collection> results = Searching.performSearch(graph, + Layer0X.getInstance(graph).Dependencies, model, query.getQuery("Name","Types"), maxResults); + + return Searching.generateDependenciesSearchResult(graph, results); + } catch (DatabaseException e) { + Logger.defaultLogError(e); + } + return null; + } + +}