Bug 204524 - [KeyBindings] Jump between bookmarks with key shortcuts
Summary: [KeyBindings] Jump between bookmarks with key shortcuts
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.3   Edit
Hardware: All All
: P5 enhancement with 2 votes (vote)
Target Milestone: ---   Edit
Assignee: Platform UI Triaged CLA
QA Contact:
URL:
Whiteboard:
Keywords: helpwanted
Depends on:
Blocks:
 
Reported: 2007-09-25 06:32 EDT by Jacek Pospychala CLA
Modified: 2019-09-06 15:35 EDT (History)
4 users (show)

See Also:


Attachments
example source code (6.39 KB, multipart/x-zip)
2007-09-25 06:32 EDT, Jacek Pospychala CLA
no flags Details
example binary (3.60 KB, application/x-java-archive)
2007-09-25 06:33 EDT, Jacek Pospychala CLA
no flags Details
Jump to Bookmark v02 (8.01 KB, patch)
2008-01-10 15:25 EST, Paul Webster CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jacek Pospychala CLA 2007-09-25 06:32:14 EDT
Created attachment 79116 [details]
example source code

It would be nice to have option to jump between subsequent bookmarks in currently open file using shortcut keys, instead of mouse-going to Bookmarks view.

Attached is example source code and binary plug-in for your convenience.
Comment 1 Jacek Pospychala CLA 2007-09-25 06:33:40 EDT
Created attachment 79117 [details]
example binary
Comment 2 Remy Suen CLA 2007-11-30 16:37:30 EST
Jacek, you basically want a command for 'Next Bookmark' and 'Previous Bookmark' operations on the file that is currently being edited, correct? I noticed that your sample code seems to restrict the operation to the first couple of bookmarks for the file.
Comment 3 Jacek Pospychala CLA 2007-11-30 18:21:10 EST
(In reply to comment #2)
> Jacek, you basically want a command for 'Next Bookmark' and 'Previous Bookmark'
> operations on the file that is currently being edited, correct? I noticed that
> your sample code seems to restrict the operation to the first couple of
> bookmarks for the file.

Correct, works for 10 bookmars and that's due to the keyboard limits :) 
The only advantage of numbered shortcuts over Next-Prev commands is that you mentally assign numbers to places, instead of kinda scrolling between them.
Second, it's rare that people have more than 3-5 bookmarks in one file, so I wouldn't consider this as restriction.

Comment 4 Jacek Pospychala CLA 2008-01-08 10:04:46 EST
can't wait to see it in M5! :)
Comment 5 Paul Webster CLA 2008-01-10 15:25:28 EST
Created attachment 86600 [details]
Jump to Bookmark v02

Jacek, I've converted your example to a patch that would be more in tune with the ide ... with 2 comments.

1) you would probably re-write your execute(*) method to use HandlerUtil to extract the active editor, it's simpler

2) as it turns out, I'm in the wrong place for this kind of patch anyway, since I can't see the text editors from here.  The patch would need to be modified to be applied to the appropriate place in the text hierarchy.

PW
Comment 6 Paul Webster CLA 2008-01-10 15:26:34 EST
(In reply to comment #5)
> Created an attachment (id=86600) [details]
> Jump to Bookmark v02
> 

And the bindings would be created with a parameter (the bookmark number for that editor) and you would use event.getParameter("jumpToBookmark.num") to retrieve it.

PW
Comment 7 Paul Webster CLA 2008-01-10 15:27:04 EST
Moving to text for consideration.
PW
Comment 8 Paul Webster CLA 2008-01-10 15:32:01 EST
Jacek, my 3 posts or so to say that the patch would need some more work from you before it could be accepted at any level.  But I think you were heading in the correct direction.

PW
Comment 9 Jacek Pospychala CLA 2008-01-10 16:51:07 EST
Paul, thanks for spending your time, I really appreciate that.
Indeed my patch wasn't for production.

In fact I don't use bookmarks, but the idea was inspired by some eclipse training attendees who were used to similar function in other tool.

Now after couple of months this RFE doesn't seem very exciting.
Maybe I should better start with "how do people use bookmarks?"...

My answer:
As I said, I don't use them, because I either work with code that I know very well so Package Explorer and Ctrl+Shift+T are perfect. When I see new code, I'm navigating over stack traces - in a natural way closest to how code is executed. Stack traces are quite hard to store in Bookmarks view, because having more than one stack trace you quickly get confused. Having said that, things that I miss in Bookmarks view are: bookmarks hierarchy, drag'n'drop stack trace to bookmarks, drag'n'drop anything from Outline to Bookmarks, jumping between bookmarks on single click (like in Outline) instead of double click. And probably more... I'd love to see that functionality, but with my time constraints I'm not going to push for it.

Instead I found neat idea: let's try with something smaller (this bug). If it gets in, I (others as well) will find time for new improvements.

So,
Dear CC'd people - how do you use bookmarks?
Dear Text Wizards - are we heading in correct direction with this bug?
Comment 10 Dani Megert CLA 2008-01-11 05:24:11 EST
Bookmarks can be attached to any kind of editor (e.g. GEF) and not just textual ones and hence jumping between bookmarks should also be generic and not just for Text editors. Moving back to UI.

Note that in the textual editors you can use Ctrl+. and Ctrl+, to jump between bookmarks (assuming you have selected them in the Next/Previous Annotation tool bar drop down.
Comment 11 Paul Webster CLA 2008-01-11 13:31:19 EST
In light of that I'd consider making the command part of the org.eclipse.ui.examples.contributions plugin as an example, but I won't be spending any time providing a re-uable jumpToBookmark framework :-)

PW
Comment 12 Eclipse Webmaster CLA 2019-09-06 15:35:42 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.