Enhanced Ctrl-Tab File Switcher in NetBeans IDE 7.2

Press Ctrl-Tab to toggle the file switcher in NetBeans IDE and you'll see something more expressive when you're using NetBeans IDE 7.2:

As you can see, not only open editor documents are found in the file switcher. Also open view documents, e.g., "Properties" in the screenshot above, are shown. Keep pressing Tab while holding down the Ctrl key or hold down the Ctrl key while pressing up and down to move up and down the list.

However, in addition, you can see that you can now also switch to tabs within file documents. Above, you can see I have selected "ShapeTopComponent.java" which, because it is a GUI component, has three different tabs, "Source", "Design", and "History". By pressing the right arrow key and the left arrow key, I can switch between those different tabs in the switcher, if I am still holding down the Ctrl key. Then, when the I release the Ctrl key, whichever currently selected file, at whatever selected tab, is opened.

All this thanks to JDeveloper, where this enhanced switcher was a requirement. (Read here.)

Related to all of this is the new call "TopComponent.getSubComponents", which was needed to achieve part of the above: "The new method can be used to access for example inner tabs in a multiview window." (Read here.)

Note also that there's a new branding token "WinSys.CtrlTabSwitching.In.JTable.Enabled", to disable Ctrl-Tab window switching when a JTable or a JTabbedPane has input focus, because in those contexts Ctrl-Tab consumes key strokes associated with those components. (Read here and read here.)

A happy side effect for anyone creating their generic desktop applications on the NetBeans Platform is that your users can click Ctrl-Tab to switch between open windows (which in some NetBeans Platform applications can be MANY open windows), even when you don't have any editor documents in your application:

So, thanks to JDeveloper, NetBeans Platform applications all over the world now have a handy window switcher, automatically, without you needing to write a single line of code.

Comments:

Cool gimmick. And this is not even mentioned in http://wiki.netbeans.org/NetBeans_72_NewAndNoteworthy. @Geertjan: Could you add this info to the wiki?

Posted by guest on June 14, 2012 at 02:48 AM PDT #

It is mentioned there: "The popup window that shows when pressing Ctrl+TAB keys now includes non-document windows (Projects, Navigator etc) and also inner tabs in document windows (Source/Design/History)."

Posted by Geertjan on June 15, 2012 at 03:30 AM PDT #

Hello, I like the new File Switcher, however it has this odd behavior I would like to disable: if you press the Ctrl key and hit the TAB key two times fast, it'll jump to the 3rd document, instead of the 2nd. Is this the expected behavior?

Posted by Edgar Merino on July 27, 2012 at 03:45 PM PDT #

I second, pressing ctrl+tab fast twice gives nasty bug.

Posted by krabas on August 07, 2012 at 12:40 AM PDT #

Thanks for this blog entry. I had completely forgotten about this shortcut for switching files.

Posted by Ryan on August 23, 2012 at 08:34 AM PDT #

Is there a way to disable new Ctrl-Tab behavior?
Now this window opens much slower on older CPU and I don't need these new elements in my work.

Posted by guest on September 24, 2012 at 12:01 AM PDT #

Sincerely, I prefer Netbeans 7.1 Ctrl+TAB behavior. What is the purpose of list Properties, Projects, etc tabs when you are pressing Ctrl+TAB when you are in the editor? the obvious purpose of use Ctrl+TAB is to change the current document and must accomplish this task as efficient as possible.

Also, with this approach, user loose possibility to view old documents in history using multiple columns and select/view it faster if he/she need that. Now, if user has to many documents opened, needs to hold Ctrl+TAB to, slowly, find an old document in Ctrl+TAB list (with the risk to get focus on the no-sense second column, an odd behavior.)

I guess a better design is to allow multiple column file list when you press Ctrl+TAB and don't allow the possibility to change into Source, History, Design, etc; this allow a more compact columned list and strip a hard to use feature and maximize the document efficiency.

Posted by guest on January 30, 2013 at 07:18 AM PST #

This new "feature" is shit. ctrl tab should go to the next goddamn tab.

Posted by guest on September 11, 2013 at 06:39 PM PDT #

Post a Comment:
  • HTML Syntax: NOT allowed
About

Geertjan Wielenga (@geertjanw) is a Principal Product Manager in the Oracle Developer Tools group living & working in Amsterdam. He is a Java technology enthusiast, evangelist, trainer, speaker, and writer. He blogs here daily.

The focus of this blog is mostly on NetBeans (a development tool primarily for Java programmers), with an occasional reference to NetBeans, and sometimes diverging to topics relating to NetBeans. And then there are days when NetBeans is mentioned, just for a change.

Search

Archives
« March 2015
SunMonTueWedThuFriSat
4
14
15
16
22
28
29
30
31
    
       
Today