Enhancement to help a developer visualize the code

Ok. These ideas just popped into my mind when I was searching for the word "JViewport" in a bunch of java files.

I would like to be able to conveniently see where I'm located in the code when I've found a location in the editor.

This does exist (sort of) when finding usages... then you search and you get the results as a tree representing the location (class - method) of the usage of this particular thing you were trying to locate the usages of.

What I would like to be able to do however, is see where I'm located in the code when I'm editing. Let's say that my cursor is located in the following place (cursor denoted by "|"):

I would like to be able to press some quick key combination and get:
Foo


+-Bar

+-getSomeValue()

Just to see where I'm located in the code.

An example scenario (the one that I'm currently in) is when I'm creating a GUI component and I'm emulating some of the behavior of a swing component... For example: I'm creating an OutlookBar component and I'm using JTabbedPane as an example to build my component upon... I just wanted to see where they defined the JViewport for scrolling the tabs in JTabbedPane because I wanted to define my JViewport in the same place... I did a search for JViewport in BasicTabbedPaneUI and I did find some places but it was hard to realize the exact location in the code structure since there is a lot of code.

Does anybody agree with me on this? Would this be usable? I wanted to see if there was anyone else that might think this is useful before I put in a request for this feature. Maybe it's a stupid one?

Kind regards, Stefan Freyr.

5 comments

Does ALT-F1 "File Structure"/"Project" or ALT-Q not enough?

"Stefan Freyr Stefansson" <stefan_freyr_stefansson@hotmail.com> a ?crit dans
le message de news:
22905487.1052302362117.JavaMail.javamailuser@localhost...

Ok. These ideas just popped into my mind when I was searching for the

word "JViewport" in a bunch of java files.
>

I would like to be able to conveniently see where I'm located in the code

when I've found a location in the editor.
>

This does exist (sort of) when finding usages... then you search and you

get the results as a tree representing the location (class - method) of the
usage of this particular thing you were trying to locate the usages of.
>

What I would like to be able to do however, is see where I'm located in

the code when I'm editing. Let's say that my cursor is located in the
following place (cursor denoted by "|"):

 public class Foo
> {
>     private static int var = 0;
>     ....
>     public static void main( String args )
>     {
>         ...
>     }
>     ...
>     private class Bar
>     {
>         ...
>         private int getSomeValue()
>         {
>             // Do some calculations....
>             return value"|";
>         }
>         ...
>     }
>     ...
> }
> ]]>

I would like to be able to press some quick key combination and get:
Foo
|
+-Bar
|
+-getSomeValue()

>

Just to see where I'm located in the code.

>

An example scenario (the one that I'm currently in) is when I'm creating a

GUI component and I'm emulating some of the behavior of a swing component...
For example: I'm creating an OutlookBar component and I'm using JTabbedPane
as an example to build my component upon... I just wanted to see where they
defined the JViewport for scrolling the tabs in JTabbedPane because I wanted
to define my JViewport in the same place... I did a search for JViewport in
BasicTabbedPaneUI and I did find some places but it was hard to realize the
exact location in the code structure since there is a lot of code.
>

Does anybody agree with me on this? Would this be usable? I wanted to

see if there was anyone else that might think this is useful before I put in
a request for this feature. Maybe it's a stupid one?
>

Kind regards, Stefan Freyr.



0

well... AltF1 is it... sort of I guess... I'd just like to have it more convenient. But it does do what I needed (only thing is that I can't use AltF1 because I'm on KDE in Linux and Alt+F1 is taken for displaying the "Start menu" (I know... I'll change the key binding).

Kind regards and thanks for letting me know...
Stefan Freyr.

0

It's may be combined with Alt+Q "Context info".
Or something like autoscroll from source in Source view.

0

Try "Structure View" with "AutoScroll from source" activated

0

Thanks for the replies. This does pretty much do what I want except that I would like to see a clearer view... it does happen that I have to scroll up and down in the Structure view to see what class the method belongs to... what I'd like would be to see simply the hierarchy of only that one method... but I do understand that this is probably a feature that is "unnecessary" and will probably just bloat IDEA :(

0

Please sign in to leave a comment.