Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 367495 - Remove redundant style-alignment property
Summary: Remove redundant style-alignment property
Status: RESOLVED FIXED
Alias: None
Product: RAP
Classification: RT
Component: RWT (show other bugs)
Version: 1.5   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 1.5 M5   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-23 09:06 EST by Jordi Boehme Lopez CLA
Modified: 2012-01-05 05:49 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 Jordi Boehme Lopez CLA 2011-12-23 09:06:05 EST
In the current implementation, the alignment property is available in "style" and "alignment".
As alignment is always sent to the client, I would suggest to remove it from the "style" properties.

This might also apply to other widgets.

Example:
{
"target": "w198",
"action": "create",
"type": "rwt.widgets.Label",
"properties": {
"parent": "w33",
"style": [ "SHADOW_IN", "RIGHT", "BORDER", "LEFT_TO_RIGHT" ],
"bounds": [ 5, 5, 450, 27 ],
"zIndex": 300,
"tabIndex": -1,
"background": [ 248, 247, 197, 255 ],
"text": "0.",
"alignment": "right"
}
Comment 1 Jordi Boehme Lopez CLA 2011-12-23 09:28:14 EST
Same for "scrollBarsVisible"

{
"target": "w233",
"action": "create",
"type": "rwt.widgets.ScrolledComposite",
"properties": {
"parent": "w232",
"style": [ "H_SCROLL", "LEFT_TO_RIGHT" ],
"bounds": [ 5, 5, 118, 150 ],
"zIndex": 300,
"tabIndex": 35,
"customVariant": "variant_PAGINGENABLED",
"content": "w234",
"scrollBarsVisible": [ true, false ]
}
}
Comment 2 Ralf Sternberg CLA 2012-01-04 07:34:20 EST
The problem here is not only redundancy, but also that in the first example, the alignment can change, leading to contradicting style flag and property. In SWT, setting the alignment would internally change the style, i.e. the style is not static! IIRC, another example for this behavior is Text.setEnabled().

I think we should only send those style flags to the client that are either needed in the protocol adapter/constructor or declared in the theme.xml.
Comment 3 Ivan Furnadjiev CLA 2012-01-05 05:49:16 EST
All LCAs have been checked. "Dynamic" styles (where the corresponding property exists) are not rendered anymore. Only these styles needed for initial widget configuration or theming are now rendered. JUnit tests adjusted.