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.

Bug 54579 - Feature Request:supply a declaring window
Summary: Feature Request:supply a declaring window
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Navigation (show other bugs)
Version: 4.x
Hardware: PC Windows ME/2000
: P3 blocker with 4 votes (vote)
Assignee: Tomas Zezula
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-02-05 07:28 UTC by pzgyuanf
Modified: 2007-09-20 11:52 UTC (History)
2 users (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
like eclipse done. (14.48 KB, image/png)
2005-03-04 09:22 UTC, pzgyuanf
Details
another screen shot (29.60 KB, image/png)
2005-06-23 06:15 UTC, pzgyuanf
Details

Note You need to log in before you can comment on or make changes to this bug.
Description pzgyuanf 2005-02-05 07:28:49 UTC
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.
Comment 1 pzgyuanf 2005-02-05 08:00:28 UTC
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);
}
Comment 2 pzgyuanf 2005-03-04 09:22:58 UTC
Created attachment 20673 [details]
like eclipse done.
Comment 3 pzgyuanf 2005-06-23 06:07:59 UTC
along with the javadoc window, maybe a lightweight tooltips, as you'll see in
the screenshot - the attachment.
Comment 4 pzgyuanf 2005-06-23 06:15:43 UTC
Created attachment 22862 [details]
another screen shot
Comment 5 pzgyuanf 2005-06-23 06:21:47 UTC
discuss it on the user mail list:
http://www.netbeans.org/servlets/ReadMsg?list=nbusers&msgNo=54840

regards.

-pprun
Comment 6 _ tboudreau 2005-06-23 08:49:02 UTC
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.
Comment 7 pzgyuanf 2005-06-23 10:10:50 UTC
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

Comment 8 _ tboudreau 2005-06-23 19:15:22 UTC
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...
Comment 9 _ tboudreau 2005-07-03 23:43:09 UTC
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.
Comment 10 pzgyuanf 2005-07-08 04:42:16 UTC
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
Comment 11 Tomas Zezula 2007-09-20 11:52:52 UTC
Already there in NB 6.0. Window/Other/Declaration View.