Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Targetting a binary method
Targetting a binary method [message #1810245] Mon, 05 August 2019 21:21 Go to next message
Alex Mising name is currently offline Alex Mising nameFriend
Messages: 149
Registered: March 2010
Senior Member
Hello,

In my plugin I am able to open the Java editor on a method with:

IMethod method = // ...
IMarker marker = method.getResource().createMarker(IMarker.TEXT);
	marker.setAttribute(IMarker.CHAR_START, method.getSourceRange().getOffset());
	marker.setAttribute(IMarker.CHAR_END, method.getSourceRange().getOffset());
IDE.openEditor(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(), marker);


Now, sometimes the method I am targetting is a BinaryMethod inside some JAR of the classpath.

How can I open the class editor (especially when there are sources attached) targetting a binary method? (similar to how JDT does when you Ctrl-click into a method for some maven dependency with attached sources).
Re: Targetting a binary method [message #1810261 is a reply to message #1810245] Tue, 06 August 2019 08:45 Go to previous messageGo to next message
Jay Arthanareeswaran is currently offline Jay ArthanareeswaranFriend
Messages: 128
Registered: July 2009
Senior Member
Please refer to the org.eclipse.jdt.internal.ui.javaeditor.EditorUtility#openInEditor(Object inputElement, boolean activate).
I am not an expert here, but this is what is invoked when you open the class file with source attachment in the Java editor.
Re: Targetting a binary method [message #1810279 is a reply to message #1810261] Tue, 06 August 2019 12:22 Go to previous messageGo to next message
Alex Mising name is currently offline Alex Mising nameFriend
Messages: 149
Registered: March 2010
Senior Member
Hello Jay,

Can you by any chance point me to the JDT class that has this code so that I may read it?

Thanks,
Alex
Re: Targetting a binary method [message #1810293 is a reply to message #1810279] Tue, 06 August 2019 15:51 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33142
Registered: July 2009
Senior Member
https://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/tree/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/EditorUtility.java

Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:GWT Designer in Eclipse 2019-06 (4.12.0)
Next Topic:How to compile patched modules on JDK 9+ by passing the --patch-module option to my project compiler
Goto Forum:
  


Current Time: Fri Apr 26 12:23:53 GMT 2024

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

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

Back to the top