Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » EMF-IncQuery » setSelectionToViewer NoSuchMethod exception
setSelectionToViewer NoSuchMethod exception [message #1066994] Fri, 05 July 2013 11:21 Go to next message
Jan Reimann is currently offline Jan ReimannFriend
Messages: 140
Registered: July 2009
Senior Member
Hi guys,
I just updated to Kepler. When I double-click a result in the Query
Explorer Eclipse switches to the Error View and I get:

NoSuchMethodException:
org.emftext.language.java.resource.java.ui.JavaEditor.setSelectionToViewer(java.util.Collection)

And indeed, the JavaEditor from (JaMoPP - EMFText) has no such method.
But how can you assume that editors have such method? From which
interface does it come?

best regards,
Jan
Re: setSelectionToViewer NoSuchMethod exception [message #1066998 is a reply to message #1066994] Fri, 05 July 2013 11:34 Go to previous messageGo to next message
Zoltan Ujhelyi is currently offline Zoltan UjhelyiFriend
Messages: 392
Registered: July 2015
Senior Member
Hi,

we have a model connector interface, that tries to identify the type of editors used, and select a common way to get the model. The setSelectionToViewer method is generally available in EMF generated tree editors, however is not available on their base classes, so as a workaround it is used via reflection.

However, this method should not be evaluated for the text editor from JaMoPP, as it is not a tree editor - possibly an application condition is written.

I tried to find the source code of JaMoPP and found the GitHub repository https://github.com/DevBoost/JaMoPP, but I couldn't find there the JavaEditor class, neither its registration to check why does it get selected.

Can you help where is this editor defined? It would help a lot to fix this issue.

Best regards,
Zoltán
Re: setSelectionToViewer NoSuchMethod exception [message #1067007 is a reply to message #1066998] Fri, 05 July 2013 12:04 Go to previous messageGo to next message
Zoltan Ujhelyi is currently offline Zoltan UjhelyiFriend
Messages: 392
Registered: July 2015
Senior Member
Hi,

I have installed JaMoPP, and the implementation should not find this editor for the model connector. This is clearly a bug.

Can you please open a bug on Bugzilla for this issue?

Thanks,
Zoltán
Re: setSelectionToViewer NoSuchMethod exception [message #1067054 is a reply to message #1067007] Fri, 05 July 2013 15:27 Go to previous messageGo to next message
Eclipse UserFriend
Hi Zoltan,

Zoltan Ujhelyi wrote:
> I have installed JaMoPP, and the implementation should not find this
> editor for the model connector. This is clearly a bug.
Why should the implementation don't find this editor? I mean, I want to
query a Java model, that's why I open a Java file with the EMFText
generated JaMoPP editor. Thus, a Java file (or better a Java model) can
be handled as each EMF-based model, too. In this sense, what I've done
was opening the JaMoPP editor for my Java file and press the play button
in the Query Explorer to let the querying process. And so it did. I got
my results but I was wondering about this error when double-clicking a
result. You cannot assume that only tree-based EMF editors can be
queried because at least there might be EMFText or Xtext editors. From
my own experiences, I know that both EMFText and Xtext editors are able
to select EObjects. In my oppinion you should provide an extension point
where developers can register implementations of your model connector
interface to support more different editors. I could provide you
implementations for EMFText and Xtext.

> Can you please open a bug on Bugzilla for this issue?
Should I still open a bug?

best regards,
Jan
Re: setSelectionToViewer NoSuchMethod exception [message #1067081 is a reply to message #1067054] Fri, 05 July 2013 17:56 Go to previous messageGo to next message
Zoltan Ujhelyi is currently offline Zoltan UjhelyiFriend
Messages: 392
Registered: July 2015
Senior Member
Hi,

yes, we have that kind of extension mechanism in place (no, there is no documentation yet, sorry), and the current implementations should support tree-based editors, Graphiti and GMF editors. Xtext editors are not supported, as we know of specific issues with regards to notifications (https://bugs.eclipse.org/bugs/show_bug.cgi?id=387119), that causes really hard to debug inconsistencies during editing. As of EMFText based editors, we have not encountered such before, so naturally we did not write explicit supporting code.

Alltogether, none of our current implementation can support explicitly the EMFText based editors, so the thing that an existing implementation kicks in and causes errors, is very clearly a bug.

As of now, our approach relies on the adapter support of Eclipse (http://www.eclipse.org/articles/article.php?file=Article-Adapters/index.html): the Query Explorer gets the current editor, and asks for an IModelConnector interface adapter (see http://git.eclipse.org/c/incquery/org.eclipse.incquery.git/tree/plugins/org.eclipse.incquery.runtime/src/org/eclipse/incquery/runtime/api/IModelConnector.java).

I would like to have an open bug, as the general EMF implementation gets executed too often. If you are ready to provide an EMFText implementation, we would be glad to include it, however we cannot do it on eclipse.org because of IP rules (but we are ready to look for a way to support it). As of Xtext, we are not ready to support it, as of the previously mentioned issue, but it is possible to create the correct model connector for that as well.

Thanks for the report and the promised help,
Zoltán
Re: setSelectionToViewer NoSuchMethod exception [message #1067397 is a reply to message #1067081] Mon, 08 July 2013 13:51 Go to previous messageGo to next message
Jan Reimann is currently offline Jan ReimannFriend
Messages: 140
Registered: July 2009
Senior Member
Created a bug report at https://bugs.eclipse.org/bugs/show_bug.cgi?id=412507
And attached a fix for EMFText-generated editors.

best regards,
Jan
Re: setSelectionToViewer NoSuchMethod exception [message #1076526 is a reply to message #1067397] Wed, 31 July 2013 14:29 Go to previous messageGo to next message
Jan Reimann is currently offline Jan ReimannFriend
Messages: 140
Registered: July 2009
Senior Member
Improved model connector for EMFText-generated editors.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=412507

best regards,
Jan
Re: setSelectionToViewer NoSuchMethod exception [message #1243891 is a reply to message #1066994] Tue, 11 February 2014 15:50 Go to previous messageGo to next message
Jan Reimann is currently offline Jan ReimannFriend
Messages: 140
Registered: July 2009
Senior Member
Added some documentation for this:
https://wiki.eclipse.org/EMFIncQuery/DeveloperDocumentation/Model_connectors

best regards,
Jan

Jan Reimann wrote:
> Hi guys,
> I just updated to Kepler. When I double-click a result in the Query
> Explorer Eclipse switches to the Error View and I get:
>
> NoSuchMethodException:
> org.emftext.language.java.resource.java.ui.JavaEditor.setSelectionToViewer(java.util.Collection)
>
> And indeed, the JavaEditor from (JaMoPP - EMFText) has no such method.
> But how can you assume that editors have such method? From which
> interface does it come?
>
> best regards,
> Jan
>
Re: setSelectionToViewer NoSuchMethod exception [message #1243896 is a reply to message #1243891] Tue, 11 February 2014 15:57 Go to previous message
Zoltan Ujhelyi is currently offline Zoltan UjhelyiFriend
Messages: 392
Registered: July 2015
Senior Member
Hi,

thank you very much, it is more than helpful. I have updated to code snippets to provide syntax highlighting, but otherwise it is very nice.

Thanks again,
Zoltán
Previous Topic:Distinct Query
Next Topic:Reflective IncQueryEngine
Goto Forum:
  


Current Time: Thu Mar 28 20:06:45 GMT 2024

Powered by FUDForum. Page generated in 0.03192 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top