Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 6064

Summary: Open on selection shouldn't require selection
Product: [Eclipse Project] JDT Reporter: Nick Edgar <n.a.edgar>
Component: CoreAssignee: David Audel <david_audel>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P1 CC: kai-uwe_maetzel
Version: 2.0Keywords: accessibility
Target Milestone: 2.0 M3   
Hardware: PC   
OS: Windows 2000   
Whiteboard:

Description Nick Edgar CLA 2001-11-19 10:02:52 EST
Build 20011116

- move the text insertion point into the middle of a type name in a Java editor
- press F3
- it has no effect

It would be better if it opened on the current word.

(I notice that it currently works for a partial selection, if the selection 
includes the start of the type name, as if it's doing code-assist or something.)

This is an issue for keyboard accessibility.  It currently requires you to move 
the cursor to the start of the word, hit CTRL+SHIFT+RIGHT to select the word, 
then F3.  It would be better if you could just move to the word and hit F3.
Comment 1 Dirk Baeumer CLA 2002-01-09 09:44:29 EST
Since accessibility is an important feature for 2.0 I think we should look into 
this.
Comment 2 Nick Edgar CLA 2002-01-09 11:00:09 EST
There was also a recent EC post about finding the decl for a method.
Somebody pointed him at F3, but he complained about having to select the whole 
word.
Comment 3 Erich Gamma CLA 2002-01-18 06:37:17 EST
if we do it we should do it consistently (e.g. search should do the same).
Comment 4 Claude Knaus CLA 2002-01-25 11:36:48 EST
I fixed it for OpenOnSelectionAction and OpenOnHierarchySelectionAction.

Dani, please add the corresponding change to OpenSearchDialogAction. What you
have to do is, if the selection is a ITextSelection, call something like
OpenOnSelectionAction.expandToWord(ITextSelection).
Comment 5 Dani Megert CLA 2002-01-28 06:34:09 EST
Agree to add the feature to Java search but not text search.

I don't like that also existing selections are expanded (e.g. if I select Object
in the work ObjectStreamField and press F3 I would expect class Object to be opened.
Idee is to move Claude's code to the StructuredSelectionProvider.

Comment 6 Dani Megert CLA 2002-01-28 06:47:29 EST
- Filed a new PR against JSearch to use StructuredSelectionProvider
- Backward parsing needs help from JCore.
Comment 7 Claude Knaus CLA 2002-01-28 08:01:54 EST
backed out change in OpenOnSelectionAction and OpenHierarchyOnSelectionAction
Comment 8 Erich Gamma CLA 2002-01-28 09:26:53 EST
To ensure that this is:
1) done consistently all over in the UI (e.g. refactoring is yet another 
example)
2) done correctly (determining the proper token boundaries)
This could be done as part of ICodeAssist.codeSelect(int offset, int length). 
When length == 0 then the.

Moving to Jdt Core for comment
Comment 9 Philipe Mulet CLA 2002-01-29 18:52:28 EST
What is it that you would precisely want ? If length==0, then it would find 
take the entire token starting at offset ?

This is quite easy to do on our side.
Comment 10 David Audel CLA 2002-02-11 07:16:02 EST
Now in ICodeAssist.codeSelect(int offset, int length), when length == 0 then 
the SelectionEngine select the entire token.

Fixed