Bug 6277 - Shift Left/Right use CTRL+I
Summary: Shift Left/Right use CTRL+I
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 2.0   Edit
Hardware: Other other
: P2 normal (vote)
Target Milestone: 2.0 M2   Edit
Assignee: Claude Knaus CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-11-23 17:05 EST by Nick Edgar CLA
Modified: 2002-01-15 05:04 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Edgar CLA 2001-11-23 17:05:25 EST
Build 20011122.

In the edit menu for a Java editor, the accelerators for Shift Left/Right
use Ctrl+I.  Shouldn't it show as Ctrl+Tab?

Tab should be a different keycode than CTRL+I.
Currently, the Java editor takes both.
Comment 1 Erich Gamma CLA 2001-11-23 19:12:06 EST
The short cut has history. First there was only CTRL-I then we added TAB (not 
CTRL-TAB) and SHIFT-TAB support as in VA/Java. 

Since short cuts are a limited resource, suggest to remove the CTRL-I and CTRL-
SHIFT-I short cuts, 
Comment 2 Nick Edgar CLA 2001-11-26 10:13:38 EST
That would be my preference too.
Comment 3 Claude Knaus CLA 2002-01-09 04:52:10 EST
Should the accelerator change to Tab, Shift-Tab or be left out completely?
Comment 4 Claude Knaus CLA 2002-01-11 10:07:40 EST
Nick,

Specifying 'Tab' and 'Shift-Tab' as accelerators in the properties file would
let the menu items eat away the key events. Do you have a proposal for
an unrecognized accelerator key name, as it's done with 'Delete'?
'Tabulation'/'Shift-Tabulation' looks weird...
Comment 5 Nick Edgar CLA 2002-01-11 11:24:12 EST
In 2.0, you can specify both the accelerator text to display (using the normal 
@ syntax in the action label) and the -actual- accelerator to use (which may be 
different).  In this case, specify "Shift Right@Tab" for the label and add an 
attribute: accelerator="0".  See the extension point doc for more details.
You can also specify accelerators using the string syntax (e.g. 
accelerator="Ctrl+Z", although this is currently undocumented (we're fixing it).
See also Action.setAccelerator.
Comment 6 Claude Knaus CLA 2002-01-11 12:25:13 EST
Well, I'm not using extension points. How can I programatically disable the 
accelerator? Calling Action.setAccelerator(0) does not help, as the accelerator 
will get overridden some time later when the label string is translated.
Comment 7 Nick Edgar CLA 2002-01-11 12:44:17 EST
Do you mean in the future when translations are made for NLS, where they might 
not use Tab?
Or do you mean in the current code, the label is set again later in the 
execution?

If the former, wouldn't that pose a problem currently since you're hardwiring a 
key event to handle Tab?
If the latter, please provide more details.
Comment 8 Nick Edgar CLA 2002-01-11 12:45:24 EST
Also, it's reasonable to assume that NLS translations will use the same key.
If you assume that all translations use Tab, then it's OK to reset the 
accelerator to 0 since you handle it in the key listener.
If you don't want to do this, you can always check to see whether the 
accelerator is in fact Tab before resetting it.
Comment 9 Claude Knaus CLA 2002-01-11 12:51:33 EST
The tabs are handled by key listeners. All I want is to change the menu item 
labels to present the right accelerator, w/o actually using them.

The problem is that the accelerator get's overwritten with the accelerator 
provided in the label, even if I set it manually to 0 using setAccelerator(),
since this seems to happen at a later time.

A workaround is obviously to choose a name which would not actually translate 
to a real key accelerator. I thought for the same reasons 'Delete' was used 
instead of 'Del' in the edit menu.
Comment 10 Nick Edgar CLA 2002-01-11 12:54:44 EST
Using a different word is just a hack, and is not recommended.
When we did Delete, we didn't have setAccelerator.
Action should probably be changed to allow either Del or Delete.

If you're creating the action in code, then you control when the label is set.
You should be able to just set the accelerator to 0 after setting the label.
As long as you call setAccelerator(0) after setText(...), you should be fine.
Comment 11 Claude Knaus CLA 2002-01-15 05:04:40 EST
fixed > 20020113