| Summary: | [ToolItem] JavaScript error when adding selection listener to separator | ||
|---|---|---|---|
| Product: | [RT] RAP | Reporter: | Igor Zapletnev <igor.zapletnev> |
| Component: | RWT | Assignee: | 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 | ||
Fixed in master with commit 023ca22fd4740fbd58febf3eb9b6df2a1b9c249d. critical bug, safe fix, +1 to backport to 2.1.2 Backported to 2.1-maintenance branch with change https://git.eclipse.org/r/21230 |
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.