Monday, February 18, 2013

Overview Plugin for Eclipse


The Overview Eclipse Plugin shows the overview of the current text editor in the Overview view. Here is a screenshot:

Please note that the tooltip shows the line under the cursor with a » . If the mouse is clicked the tracked editor will scroll to that line.
Install it from this update site:

http://sandipchitaleseclipseplugins.googlecode.com/svn/trunk/text.overview.updatesite/site.xml

Now available on Eclipse Marketplace.



You may have to reset the perspective first time after installation to get the Overview view in the right position i.e.to the right of Editors area.

TODO
  1. Use Overview view to scroll the editor whose overview is being shown.
  2. Track the changes to the tracked editor. Well, sort of. When the editor contents are modified the Overview stops updating. It resumes if the modifications are saved or the focus is lost to other editor and then regained.
  3. Show tooltip with context showing line under caret.
  4. Track changes to text as the user is typing.
Tested with Eclipse 3.5+ and 4.1+.

Source

Enjoy! 

26 comments:

kriboogh said...

Promising plugin! However I'm currently seting up Eclipse Kepler (4.3). Plugin installs and I can see the view however these things happen:

- using default theme (white background) I don't see the selected area where I currently am in a large file
- changing files does not update the view, I always see the first file it was opened upon, would be great if there was some synchronize button (like the double yellow arrows in the outline view)

Keep up the good work!

kriboogh said...

Ok, just restarted eclipse and now it works.

Great!

A feature request:
When you double click a line in the overview jump to that line in the real editor.

Sandip Chitale said...

@kriboogh

Glad to hear it works now.

Single clicking a line in Overview view should move the caret in real editor to the same line. Do you mean that double clicking should move the focus also? If so I can do implement that soon.

Sandip Chitale said...

@kriboogh

Your feature request has been implemented. Get the latest.

meros said...

Is it possible to make the plugin show the entire file even if it is very long (not limiting the zoom size)?

meros said...

Is it possible to make the plugin show the entire file even if it is very long (not limiting the zoom size)?

Sandip Chitale said...

@meros It does show the whole file. That is why there is vertical scroll bar.

If a file is very large and is to be shown completely in the available vertical height you will not be able to see anything as the font size will have to be below available minimum font size.

It is possible that I have not understood your request correctly.

Tim Whitbeck said...

I opened an issue on your Google Code page. I just wanted to say thanks for an awesome Eclipse plugin! This overview feature is so much more helpful than the "Outline" view, at least for me.

Sandip Chitale said...

@Daniel Sorry there is not way to set the font size because the idea is only see the structure. But I can add it. Also there is a tooltip to show normal sized source at the cursor.

And yes...I need to set up a Donate button :)

Daniel Sokolowski said...

The reason I wanted to change the font size is to make it a little bigger but the line height much smaller - something to this lookhttp://media.creativebloq.futurecdn.net/sites/creativebloq.com/files/images/2013/05/Hannah/sublime-text.jpg

Please do definitely setup a donate button as your effort is worth it :)

Be great

Daniel Sokolowski said...

Unknown said...

the preview window colors need some work. as you can see the from the screenshot here: logikostech.net/file/eclipse-minimap.png the minimap is nearly all black except for the highlighted portion which is nearly all white, no contrast for the code. also if you click the selected area and drag in the minimap it makes the code above (if i drag down) act like it is selected (white background) .. but the fact is weather there is a white background or a black background the text is nearly invisible. I realize you were not meant to be able to read it, but you cant even see it...

Sandip Chitale said...

@Todd

The Overview window basically uses the same colors as your editor, including color for selection. It appears that in your case theme colors are such that it makes the Overview view look like the way it does. Let me think about what options can be provided to make it for your use case.

Sandip Chitale said...
This comment has been removed by the author.
Unknown said...

@Sandip thanks for the consideration, I love the idea and enjoy this feature while using sublime text. It seems to me that beings it is a preview of the code that it should use the same color scheme used in the code view? Of course perhaps this is easier said than done :P

All in all I like the idea, but for me right now it is not usable. Also, is there a way to turn the tooltip off? I can appreciate why some like the feature but if it could be turned off that would be nice.

Sandip Chitale said...

@Daniel Your wish has been granted. Now you can set the size of the overview font using a scale (slider) at the bottom of Overview view.

julienM said...

Excellent plugin !! really expected something like this to come out for eclipse.

There are 2 little behaviors thought that I find if fixed would make it totally mind blowing.
1- when scrolling in the regular editor, it slows down the scrolling when you scroll to a point where the Overview window will also scroll.
2- when I start typing, the Overview windows content is all erased.

Keep up the good work, its honestly a real time saving plugin for someone who spends 8-9 hours a day in front of eclipse.

Sandip Chitale said...

@julienM

Thanks. I am glad you find it useful.

I will look into the #1 issue.

Part of the motivation for #2 was to avoid constant updates to overview. The idea being that when you are typing you are not (most likely) interested in the overview functionality. Based on the feedback I implemented a refresh button. I could also hook it to some kind of idle detection event.

julienM said...

@Sandip Chitale
Thanks for your quick feedback.

for my point #2, I can provide more detail as to why I felt it was not "natural".
When I'm creating a dynamic web page, I will often have variables declared at the top of the file where I retrieve the stuff coming from DB that I will use to display on the page lower in the file.

The lower part of the file will often be many many scroll wheel turn lower, and once there I will not remember the exact spelling of the variable I need. so I want to go quickly to the beggining of the file to copy it in clipboard, then go quickly back where I was lower and paste it. Often I will do that back and forth tens of times in a row...many times a day.

I understand the concern though of refreshing the Overview content too often. In my situation it could be refreshed every 2 or 3 seconds without a problem. Or like you said, when there is a idle time of typing of a few seconds.

In any ways, thank you very much :)

Sandip Chitale said...

@julienM I understand your use case. I may implement the idle handler.

In the mean time, you may even have a better alternative which will not even require clicking/scrolling - which is - to clone the editor and have it side by side. Do editing in one and have the variables in the other. You can create a cloned editor in Eclipse using the Window > New Editor then dragging it to editor area edge to create a side by side layout (pre Luna) or Window > Editor > Toggle * Split commands.

Ash said...

Thanks for creating this useful plugin.

Similar to an earlier comment I would also like to see the entire file (even huge files) without needing the scrollbar. See the MetalScroll (and RockScroll) plugin for Visual Studio for how this can be done. In RockScroll the text is so small that it cannot be read, but the real benefit is that it gives you an overview of the file structure by showing the 'shape' of your code. When combined with highlighting word/symbol occurrences it is very powerful.

It would be great to have MetalScroll implemented in Eclipse. I suppose this would require a complete change to your drawing code but it would be worth it (in my opinion).

Sandip Chitale said...

@Ash

Thanks.

I understand your's and previous comment about fitting the whole file in without scrolling.

My current implementation is not based on drawing, but rather on changing the font size. The minimum font size is 4. Which means there is a lower bound on the vertical height for a given file size.

I guess I could switch to scaled drawing below font size of 4. I will look into it.

Unknown said...

Awesome plug-in, great work! Is there a way to change the color of the highlighter which now is strong blue. A more transparent blue or take away the highlighter altogether, or at least decrease its height.

Unknown said...

... And is there a way to get this to Android Studio

Sandip Chitale said...

@Oskar The highlight color is the color of the selection in the editor. I will look into making it a preference.

Sandip Chitale said...

@Oskar Android Studio is based on IntelliJ IDE and not Eclipse. My plug-in is based on Eclipse. You may find this useful for Android Studio:
https://github.com/Vektah/CodeGlance