This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Feature Request:supply a declaring window. Currently, -you must to press Alt+O to 'go to the source' when you try to understand fully some elements in the source editor. Or (in the current java file), -navigating in the navigator to seek the element and selecting/clicking it. May be there is a window to explore the declaration of these elements dynamic. This can spare some efforts of finding/pressing.
For example: code in source editor- String.valueOf(1); when clicking on the valueof() method, the declaring window show- public static String valueOf(int i) { return Integer.toString(i, 10); }
Created attachment 20673 [details] like eclipse done.
along with the javadoc window, maybe a lightweight tooltips, as you'll see in the screenshot - the attachment.
Created attachment 22862 [details] another screen shot
discuss it on the user mail list: http://www.netbeans.org/servlets/ReadMsg?list=nbusers&msgNo=54840 regards. -pprun
This would be relatively trivial to implement as a plug-in - everything that it would need to do is available in dribs and drabs from a few existing modules: Have a look at objectbrowser/navigator/javanavigation for how to look up the tooltip of whatever you want - most of the code for that could be borrowed from there; editor/hints will supply the code for tracking down the java element the text caret in the editor is over - can borrow the same code that tracks the caret for displaying the little lightbulb by lines that have suggestions available; java/hints or javanavigation again for how to look up and read the source for a java class. The only fancy things that might be needed are: - The lookup should happen on a time delay so a lot of work isn't done every time the caret moves. See the change queueing code in org.openide.propertysheet.PropertySheet for how to do this well. - It would be nicest to have all the syntax highlighting goodies available in the editor used for the source code shown. Should be as simple as setting the editor kit, but there might be some issues.
your comment is very pertinent. Yes, it is only an alternative and the code to implement has existed here too. Because of the 'track' fuction, the navigator got more slowly currently in 4.2. As an IDE, integrating some dribs and drabs isn't a trivial task, IMO. regards
Navigator originally had a track function that wasn't slow, so that's worth looking into. It would also highlight all methods that called whatever method you have the caret in (I think that can still be done with a line switch), which is like something else you mentioned on nbusers, but the highlighting was deemed to be confusing...
FYI, there are the beginnings of such a module now in contrib/CodeInfo. It doesn't do that much yet, but it's a start. Main issues: - Can't get body text for methods in JDK classes (the JMI element returns null from getBodyText() - not sure what to do about it - it's looking at the .class file, not the .java file from src.jar - SourceForBinaryQuery?) - Still some deciphering to do of what JavaModel is returning when you determine what the caret is over - some things (MultipartId, ParameterImpl) are not handled correctly, so it prints out the toString() of them which is a MOF id). It's a little maddening.
It's more flexible to implement them (the declaration and javadoc) in different docked windows instead of using the JSplitPanel, like the 'local variable' , 'watch' and other windows of Debug view. besides some maddening, could not get the javadoc of Class body. it's delighted if it can get information of cross-reference in java doc, such as: /** * ... * * @see java.lang.String#toString() * */ and /** * ... * * {@link ...#something()} * */ in addition, supply a 'Go to' button on the windows to fast go to the declaration or javadoc if one will. Utill that,it will be very useful! cheers -pprun
Already there in NB 6.0. Window/Other/Declaration View.