X

Geertjan's Blog

  • August 25, 2008

Jumping to Related Places in the NetBeans Java Editor

Geertjan Wielenga
Product Manager
I learned something interesting about the NetBeans Java Editor today. Say you have an import statement (or anything else) selected, as here:

Now look at those browny-greeny marks in the right sidebar. When you click them, the cursor jumps to places where the selected item is used. So, in the case of import statements, you can click the browny-greeny mark and then find yourself in places in the code where you're doing something with that class.

I never knew that and it's pretty cool.

Join the discussion

Comments ( 6 )
  • Casper Bang Monday, August 25, 2008

    Yeah personally I use that all the time as a simple but very fast "find occurrences".

    It would be even better though if a preview could be shown as you hover over the mark occurrences gutter, such that you did not necessarily have to click and go there, if all you really want is to inspect something.

    At the same time, this hover preview functionality could be used for when hovering a block of folded code! ;)


  • Jesse Glick Monday, August 25, 2008

    No need to select anything. Just move the caret into the identifier. Once it is highlighted in for the usual "mark occurrences" feature, use Alt-Up/Down to jump to various usages (cycling back to the definition). Handy way to quickly jump to usages of imports, or private fields / methods / constructors / nested classes.


  • Vincent Cantin Monday, August 25, 2008

    I feel like I just lost the probably only chance I had to reverse the roles and actually teach you something.

    Yesterday I could have sent you an email like "by the way, do you know about the jump-to-highlighting stuffs in the right side column?". Instead of that, I spent my time to read your tutorials.

    I feel so frustrated :-)


  • Varun Monday, August 25, 2008

    I knew this, and forgot to blog about, or create a doc for it..Damn!

    Anyways, its really cool stuff!

    Enjoy learning ;-)


  • Varun Monday, August 25, 2008

    Similar case is for the class you implement. When you put the cursor on that className, then it would mark occurrences for the implemented methods.

    Not sure about Inheritance (extends).


  • lunaticbd Monday, August 25, 2008

    yeah! used this feature before :)


Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.