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

Bug 422104

Summary: [ToolItem] JavaScript error when adding selection listener to separator
Product: [RT] RAP Reporter: Igor Zapletnev <igor.zapletnev>
Component: RWTAssignee: Project Inbox <rap-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P2 CC: rsternberg
Version: 2.0   
Target Milestone: 2.2 RC1   
Hardware: All   
OS: All   
Whiteboard: sr212

Description Igor Zapletnev CLA 2013-11-19 21:50:45 EST
In the SWT both ToolItem and ToolItemSeparator are objects of org.eclipse.swt.widgets.ToolItem. The differences only in the styles, for separator it is SWT.SEPARATOR, for simple is depends on view (SWT.PUSH/SWT.CHECK or others).

It means what in the SWT you can add selection listener for both of them (for item, and separator ToolItem.addSelectionListener). But in case of separator user can't trigger this listener.
In case of RWT this widgets has different implementations "rwt.widgets.ToolItemSeparator" and "rwt.widgets.ToolItem" respectively. 
And when I am adding SelectionListener on ToolItem(SWT.SEPARATOR) my RAP application fails because where is no selection handler attached to the ToolItemSeparator.

>Error: Error: Operation "listen" on target "w117" of type
>"rwt.widgets.ToolItemSeparator" failed:
>Property 'setHasSelectionListener' of object [object Object] is not a function

I think will be useful to provide the same behaviour as in SWT and define stub listener for separator.
Comment 1 Ivan Furnadjiev CLA 2013-11-20 03:43:42 EST
Fixed in master with commit 023ca22fd4740fbd58febf3eb9b6df2a1b9c249d.
Comment 2 Ralf Sternberg CLA 2014-01-27 07:48:47 EST
critical bug, safe fix, +1 to backport to 2.1.2
Comment 3 Ivan Furnadjiev CLA 2014-01-29 12:33:56 EST
Backported to 2.1-maintenance branch with change https://git.eclipse.org/r/21230