Forum Controls
Spotlight Features

The Rich Engineering Heritage Behind Dependency Injection

Andrew McVeigh takes us on a tour of the rich heritage behind dependency injection, what it represents, and tells us why its here to stay.

Java, the OLPC, and community responsibility

The "One Laptop Per Child" project has a great device ready to ship, but there's no Java on there. Let's think about working together to put Java on OLPC!
Replies: 8 - Pages: 1  
Threads: [ Previous | Next ]
  Click to reply to this thread Reply

Show Source of Selected Element Only

At 8:57 PM on Apr 17, 2006, R.J. Lorimer Javalobby Editors wrote:

One of the things that we constantly do as developers is to visually disassemble content we see and focus on the parts we're interested in. As the amount of code and content in our application grows, it becomes increasingly difficult and tedious to find and digest the interesting content; classes get longer, and they get more methods with deeper indentation. You get the idea.

As Eclipse has evolved, several tools have been implemented to help this process. Code folding is one such tool, and another is Mylar . Mylar is a topic I definitely want to cover in more detail here at EclipseZone; Riyad did a great piece on it as a spotlight feature . But, I digress.

One feature has been there since the beginning, and it seems like the only developers that know about it are either a.) those that came from VisualAge, or b.) those who think it's a bug because they turned it on accidentally.

The feature I'm referring to is the 'Show Source of Selected Element Only' feature. This functionality trims out everything in the editor except the item you have currently requested; which when you're using tools like the quick outline ( Ctrl+O) can really help the process of visually scanning source code. This behavior is actually a leftover from the VisualAge roots of Eclipse; the UI for VisualAge for Java was centered around the behavior of showing only what you were editing.

The toolbar item for this feature looks like this:

If you don't have that toolbar item, it can be added by going to Window->Customize Perspective->Commands (tab)->Editor Presentation and adding it to your toolbar. If you have this feature turned off, you may have an outline selection like this, and you'd see this in the editor:

If you have it turned on, here is what you will see instead:

This feature of Eclipse is an oldie but a goodie. In my opinion, it was drastically improved by the introduction of the quick outline functionality which acting as your primary form of navigation makes the behavior a naturally helpful utility. One advantage this feature has is that it works in any editor that has outline view support.

Until next time,

R.J. Lorimer
Contributing Editor - rj -at- javalobby.org
Author              - http://www.coffee-bytes.com
Software Consultant - http://www.numbersix.com

  Click to reply to this thread Reply
1. At 10:14 PM on Apr 17, 2006, Wayne Beaton Javalobby Regulars wrote:

Re: Show Source of Selected Element Only

If you really want that old Smalltalk feel, you've got to use this feature with the Java Browsing perspective...
Wayne Beaton Eclipse Foundation http://wbeaton.blogspot.com
  Click to reply to this thread Reply
2. At 10:31 PM on Apr 17, 2006, R.J. Lorimer Javalobby Editors wrote:

Re: Show Source of Selected Element Only

No doubt :) - or code in smalltalk...
Best, R.J. Lorimer
  Click to reply to this thread Reply
3. At 1:53 AM on Apr 18, 2006, Jin Blooming Javalobby Member wrote:

Re: Show Source of Selected Element Only

it seems no shortcut key with this function?
  Click to reply to this thread Reply
4. At 3:28 PM on Apr 18, 2006, R.J. Lorimer Javalobby Editors wrote:

Re: Show Source of Selected Element Only

Good Question Jin. I didn't find one, no. If you think it would be convenient, you should open a bug .
Best, R.J. Lorimer
  Click to reply to this thread Reply
5. At 11:30 AM on Apr 19, 2006, Paul Woodward Javalobby Newcomers wrote:

Re: Show Source of Selected Element Only

You should be checking out mylar (http://www.eclipse.org/mylar)
  Click to reply to this thread Reply
6. At 9:56 PM on Apr 19, 2006, R.J. Lorimer Javalobby Editors wrote:

Re: Show Source of Selected Element Only

Paul,

Thanks for the link. I did, in fact, reference mylar in this article. Unfortunately at the moment I don't have the time to post tips for specifically working with Mylar, but I do plan to in the future.

This tip is also useful for those in the industry who want to have some visual decluttering, but don't have the ability (or don't want to?) run Java 5 (a requirement of Mylar).

Regards!
Best, R.J. Lorimer
  Click to reply to this thread Reply
7. At 3:35 AM on Apr 20, 2006, Paul Woodward Javalobby Newcomers wrote:

Re: Show Source of Selected Element Only

Sorry, scan-read the post. Big mylar fan too ;)
  Click to reply to this thread Reply
8. At 5:01 AM on May 6, 2006, Carsten Saager Blooming Javalobby Member wrote:

Re: Show Source of Selected Element Only

Perhaps it exist(s|ted) already. I "discovered" this feature by accident - either I clicked the button inadvertedly of I hit some strange key combination.

In consequence I was completly pissed - once selected a method in the outloook all members where gone. I drove me insane and I reinstalled Eclipse. Desaster stroke some days later and this tiome a co-worker remarked the VisualAge also had this annoying habit.

Finanlly we found the button and removed it. I cannot a imagine a single good use of this function.

thread.rss_message