Hello Istvan,
thanks for the tip. I was kind of lost in the in the Query Explorer code and was trying to come up with an own API. But this looks definitely easier and more promising.
So using the Advanced API, it is possible to use any kind of pattern model representations, including the .xmi instances of PatternLanguage.ecore?
I see that in the org.eclipse.incquery.application.common example, the IncQueryHeadlessAdvanced.java has this line, where the pattern models are being loaded from a file, more interestingly from a hidden .xmi file called "globalEiqModel.xmi" as follows:
ResourceSet resourceSet = new ResourceSetImpl();
URI fileURI = URI.createPlatformPluginURI("headlessQueries.incquery/queries/globalEiqModel.xmi", false);
Resource patternResource = resourceSet.getResource(fileURI, true);
I believe, that this means, that every .xmi file with valid patterns to search for, could be used as a pattern model resource?
FYI: I am seeing two errors in the example application code.
1.) IncQueryHeadless.java, line 215:
IObservableSet set = IncQueryObservables.observeMatchesAsSet(factory, engine);
Error :The method observeMatchesAsSet(IMatcherFactory<Matcher>, Notifier) in the type IncQueryObservables is not applicable for the arguments (EPackageMatcherFactory,
IncQueryEngine)
2.) IncQueryHeadlessAdvanced.java, line 163:
matcher.addCallbackOnMatchUpdate(new IMatchUpdateListener<IPatternMatch>() {
Error: The method addCallbackOnMatchUpdate(IMatchUpdateListener<capture#13-of ? extends IPatternMatch>, boolean) in the type IncQueryMatcher<capture#13-of ? extends
IPatternMatch> is not applicable for the arguments (new IMatchUpdateListener<IPatternMatch>(){}, boolean)
Best regards,
Emre