| Summary: | Remove redundant style-alignment property | ||
|---|---|---|---|
| Product: | [RT] RAP | Reporter: | Jordi Boehme Lopez <jboehme> |
| Component: | RWT | Assignee: | Project Inbox <rap-inbox> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | ||
| Version: | 1.5 | ||
| Target Milestone: | 1.5 M5 | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
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 ]
}
}
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. 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. |
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" }