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

Bug 360121

Summary: Not set style flag is rendered by the protocol for some widgets
Product: [RT] RAP Reporter: Ivan Furnadjiev <ivan>
Component: RWTAssignee: Project Inbox <rap-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: mail
Version: 1.5   
Target Milestone: 1.5 M5   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on:    
Bug Blocks: 351945    

Description Ivan Furnadjiev CLA 2011-10-06 11:59:07 EDT
There are cases where two style flags with the  same value exists for a single widget. For example:
- Text - SWT.ICON_CANCEL == SWT.H_SCROLL == 256
         - SWT.ICON_SEARCH == SWT.V_SCROLL == 512
where: new Text( parent, SWT.SEARCH | SWT.ICON_CANCEL ) renders H_SCROLL instead of ICON_CANCEL.
- ToolBar - SWT.HORIZONTAL == SWT.H_SCROLL == 256
              - SWT.VERTICAL == SWT.V_SCROLL == 512
where: new ToolBar( parent, SWT.HORIZONTAL ) renders SWT.HORIZONTAL and H_SCROLL.
Probably rendering of this "phantom" H_SCROLL/V_SCROLL  style will not hurt, but substituting one style with an other (with the same value) is definitely a problem. Currently, SWT.ICON_CANCEL and SWT.ICON_SEARCH are missing from Text supported styles in RWTStylesUtil (but iOS native client support them). To avoid collision, probably we should remove H_SCROLL and V_SCROLL from ToolBar supported styles too.
Comment 1 Ivan Furnadjiev CLA 2011-10-06 12:11:37 EDT
For Text widget the logic is the following:
- if SWT.MULTI is set, style flag with a value 256 means H_SCROLL, style flag with a value 512 means V_SCROLL
- if SWT.SINGLE is set, style flag with a value 256 means SWT.ICON_CANCEL, style flag with a value 512 means SWT.ICON_SEARCH
For ToolBar we always should read style flag with a value 256 as SWT.HORIZONTAL and style flag with a value 512 as SWT.VERTICAL. I removed H_SCROLL and V_SCROLL as supported styles for ToolBar in RWTStylesUtil.
Probably, there are other widgets affected by the similar issue.
Comment 2 Sebastian Bauer CLA 2011-10-18 10:04:35 EDT
(In reply to comment #0)
> Probably rendering of this "phantom" H_SCROLL/V_SCROLL  style will not hurt,
> but substituting one style with an other (with the same value) is definitely a
> problem. Currently, SWT.ICON_CANCEL and SWT.ICON_SEARCH are missing from Text
> supported styles in RWTStylesUtil (but iOS native client support them). To
> avoid collision, probably we should remove H_SCROLL and V_SCROLL from ToolBar
> supported styles too.

I notices as well that SWT.ICON_CANCEL and SWT.ICON_SEARCH is not supported on the Webclient. Shall I file a new Bug report regarding this issue?
Comment 3 Ivan Furnadjiev CLA 2011-10-18 10:53:48 EDT
Yes, please file an enhancement request.
Comment 4 Sebastian Bauer CLA 2011-10-18 11:49:36 EDT
(In reply to comment #3)
> Yes, please file an enhancement request.

Okay done. See Bug 361273.
Comment 5 Ivan Furnadjiev CLA 2012-01-03 04:53:26 EST
Now, after all widgets are switched to the protocol, the Text widget is the only one with style flags collisions. That's why, I decided to keep the RWTStylesUtil (at least for now) and fix the collision in TextLCAUtil. Now ICON_CANCEL and ICON_SEARCH styles are rendered with the protocol too. The actual support for these styles in the Web client will be covered by bug 361273.
Comment 6 Ivan Furnadjiev CLA 2012-01-05 05:52:07 EST
Finally, we decided to remove the RWTStylesUtil class. Allowed widget styles are defined in the corresponding LCA.