Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 25871 - Link like navigation key
Summary: Link like navigation key
Status: CLOSED DUPLICATE of bug 27231
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 2.1   Edit
Hardware: PC All
: P2 normal (vote)
Target Milestone: ---   Edit
Assignee: Claude Knaus CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-11-07 21:00 EST by Sebastian Davids CLA
Modified: 2003-04-10 09:52 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sebastian Davids CLA 2002-11-07 21:00:26 EST
I think the Ctrl-key is not a good choice to invoke this feature.

Try the following:

Integer.MAX_VALUE;
Integer.MAX_VALUE;
Integer.MAX_VALUE;
Integer.MAX_VALUE;
Long.MAX_VALUE;

Now select "Long" press CTRL + C.

Now place your mouse over the first "Integer" and double click on text (to
select it) and press CTRL + V to replace it with "Long".

Do the same with the other "Integer"s -- and do it fast.

I'd bet you will open the java.lang.Integer.

OK, one could use Search/Replace in this case, but most of the time -- if you
only have a few thinks to replace one will use this double-click/Ctrl + V strategy.

Another pitfall ... one wants to use code assist.

Again we're in the flow and are not really paying attention.

Unfortunately we end up with the following order of key press/mouse click:

Ctrl, left mouse click, Space -- oops.

Before we had this feature one could almost simultaniously press Ctrl + Space
and click with left mouse button.

I suggest using the Alt-key.
Comment 1 Dani Megert CLA 2002-11-08 03:30:39 EST
We already discussed that the Ctrl modifier might not be the best choice. I
actually would like to get the link feature without any keyboard interaction:
sometimes I'd like to be able to navigate through my code just by mouse.
Comment 2 Claude Knaus CLA 2002-11-08 11:35:31 EST
My proposal w/o keyboard interaction is to use the middle mouse button. When 
the mouse is moved, a background thread is launched to search for an associated 
declaration. If it finds a declaration, the text turns into a link, and it can 
be visited by pressing the middle mouse button. The only problem I see here is 
that middle mouse button is typically paste on platforms with X. But then 
again, Eclipse is not honoring middle mouse button at all, until now.

Erich, do you have any feelings regarding the alternatives? (different key 
modifier vs. middle mouse button)?

The Ctrl was better than Alt in that it it's easier to find blindly on a 
keyboard. Alt is a rarely pressed modifier... In this case it's truly an 
alternative though.
Comment 3 Sebastian Davids CLA 2002-11-08 11:58:49 EST
X users will expect a paste operation if one uses the middle mouse button (see
bug 6725).

Users w/out a third mouse button will not profit from this feature.

Two other suggestions:

a) Place a toggle button "Link Navigation Mode" next to the "Show Source of
Selected Element Only" and "Show Hover Text" buttons on the main toolbar.
b) Place a checkmark menu item on the editor tab's menu "Link Navigation Mode"

In "Link Navigation Mode" you'd have the same kind of browsing you have now if
you constantly hold the Ctrl-key down.

There should still be a key you can hold down to temporarily enter the "Link
Navigation Mode".

@@@@

Still, I think the Ctrl-key should not be used to enter the "Link Navigation
Mode" because of the problems I indicated above.
Comment 4 Claude Knaus CLA 2002-11-10 06:42:16 EST
I agree that middle mouse button should not be the only way to trigger the link.
I feel like I still need more opinions on how this kind of navigation should be 
made accessible to make a proper decision.
Comment 5 Erich Gamma CLA 2002-11-11 18:27:56 EST
To avoid the temporary link highlight I suggest to only switch to the link 
highlight mode once the ctrl key was pressed AND the mouse has moved.
Comment 6 Claude Knaus CLA 2002-11-12 07:15:43 EST
Implemented behaviour suggested by Erich >= 20021112 (not in warmup integration 
build).

I don't think using Alt modifier would work since pressing Alt on windows 
activates the menu bar. No more key or mouse events are sent during this time.

A toggle button/checkbox would be too heavyweight. Following links should be a 
light weight operation, w/o requiring to enter a 'persistent' navigation-mode.

The bug remains open...
Comment 7 Claude Knaus CLA 2002-11-13 05:15:26 EST
I realized that the case when I use both mouse and keyboard at the same time is 
when I cut/copy/paste with keyboard (Ctrl-[XCV]) and select text regions to 
cut/copy with the mouse. It is very irritating to see the link highlight when 
doing these operations.
Comment 8 Sebastian Davids CLA 2002-11-30 05:20:36 EST

*** This bug has been marked as a duplicate of 27231 ***
Comment 9 Sebastian Davids CLA 2003-04-10 09:52:14 EDT
.