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

Bug 338639

Summary: ToolBar /w ControlContribution and Actions unwanted selection behaviour
Product: [RT] RAP Reporter: Thomas Jodes <tjodes>
Component: RWTAssignee: Project Inbox <rap-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: unspecified   
Target Milestone: 1.4 M6   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
RAP project
none
RCP project none

Description Thomas Jodes CLA 2011-03-02 05:18:11 EST
Build Identifier: 

Issue is described in the rap forum here: http://www.eclipse.org/forums/index.php?t=msg&th=205379&start=0&S=77bdf55a6bfb8e56cd944711713f7f45

Short UI/functionality description:

Created a ToolBar and ToolBarManager out of 2 IActions and 1 ControlContribution.
So there are three "items" in the toolBar after ToolBarManager#update(boolean):

1. A reset action
2. A text field
3. An 'action' action

ad 1.) The reset action clears a Label below the toolBar and reset the text field to a default text;
ad 2.) In the text field you can enter any String. There's a selectionListener that calls the same method as 3. does;
ad 3.) The 'action' item commits the current string in the text field in the Label below the toolBar;

In RAP, when you follow the 'Steps to reproduce', there is an unwanted behaviour pressing Return in the Text field: after pressing also the last selected toolItem's action is triggered.

Tested in Mozilla 3.6 and IE8 against RAP 1.4M5 from early Feb 2011.
RCP and RAP projects are attachment as zip archives.


Reproducible: Always

Steps to Reproduce:
1. Start the ToolItems_Test rap application (accessible via "/rap?startup=ToolItem_Test.app")
2. Click left into the Text field
3. Enter any string and press return
4. Click left on 'Reset'
5. Click left into the Text field again
6. Enter any string and press return
Comment 1 Thomas Jodes CLA 2011-03-02 05:18:39 EST
Created attachment 190117 [details]
RAP project
Comment 2 Thomas Jodes CLA 2011-03-02 05:19:04 EST
Created attachment 190118 [details]
RCP project
Comment 3 Ivan Furnadjiev CLA 2011-03-09 11:45:08 EST
Now the ToolBar does not handle the key events if its target is different from ToolItem or ToolBar. Changes are in CVS HEAD. JS test added.