Bug 146642 - HighlightRule element should reference Style element
Summary: HighlightRule element should reference Style element
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: BIRT (show other bugs)
Version: 2.1.0   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: 2.2.0 M5   Edit
Assignee: Birt-Report-inbox@eclipse.org CLA
QA Contact:
URL:
Whiteboard:
Keywords: plan
Depends on:
Blocks:
 
Reported: 2006-06-12 14:23 EDT by Der Spunk CLA
Modified: 2007-01-19 01:43 EST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Der Spunk CLA 2006-06-12 14:23:27 EDT
HighlightRule should reference a Style element instead of having several style properties. With a reference to a defined Style element it would be easier to change the style of hightlight rule just by changing the Style element (which may reside in a library and is used by several reports). The current ROM requires that every report defines it own highlight rule styles.
Comment 1 Wenfeng Li CLA 2006-06-12 14:50:18 EDT
Good suggestion to support using style for highlight rule.
Comment 2 Ivy Li CLA 2006-07-20 03:42:29 EDT
There are many issues if the highlith rule refer to a sytle element. 

1. Actually, the highlight rule style properties are only a sub set of a style properties. For example, the masterPage, mapRule... in style can not be applied to a highlight rule.  If the highlight rule refer to a style directly, it needs extra logic to control it.
2. If a highlight rule can refer to a style, that will cause the circularity reference issue because the referenced style also has the highlight rule property. Many constrains need to be added to handle this case. 

The highlight rule is just a group of some layout properteis. It is not a style. But I can understande the usage proposed in the bug. User defined a style with many properties and wants to use it to highlight sommething. To achieve this, we can provide a function to convert a style properteis to highlight rule. 
From the UI interface, just like to drag a dataset from data explore to layout to create table. What Model do is just convert the common properties between Style element and highlight rule and apply the property value on the rule. 
Comment 3 Wenfeng Li CLA 2006-07-20 14:30:52 EDT
I think it is a better usage to refer to a style in highlight rule then copy a subset of style properties to high light rule, since when users change the style, they might expect the highlight rule change as well.

Is it correct that a lot of report element has the same behavior that style properties is a superset of the element properties?  

How about let highlight rule only pick the subset of properties it need from the style?   Highlight rules in the style probably won't be included in that subset, so it would cause circular reference problem.  In fact, it could be a valid usage that highlight rule in a style reference to its parent style to define the formatting properties.

Comment 4 Ivy Li CLA 2006-08-01 02:48:15 EDT
This need to enhance model system to support a strcuture reference to an element, which is not simple and need a good design based on the current system. Schedule to 2.2 and I will give a spec.
Comment 5 Rick Lu CLA 2006-11-22 22:52:33 EST
Has added this feature in Model part. Need BIRT UI support next.
Comment 6 Ivy Li CLA 2006-12-18 22:30:47 EST
Model already done this feature implementation, can you close this bug and file a new one for UI?
Comment 7 Wenfeng Li CLA 2006-12-18 23:11:31 EST
Need an UI spec or mock up?
Comment 8 Wang Qiangsheng CLA 2007-01-18 00:40:59 EST
We already fixed this bug. We have seperate bug 165624 to trace this feature. Please don't reassign this to GUI. Thanks
Comment 9 Rima Kanguri CLA 2007-01-18 15:07:53 EST
question?
In the hightlight rule - What happens if a user selects a style "StyleBlue" and then sets a local property font = red.
Will the local font property override the style font property.

thanks
Comment 10 Jason Weathersby CLA 2007-01-18 15:22:01 EST
I believe this is an or condition in the highligh rule.
Either use a style or define a style property.
In M4 it does not appear to let you set the background color in anything
but a style now, which means the highlight rule would be applied last.
If you use script say like:
this.getStyle().backgroundColor = "Yellow"
This is applied after hightlight rules though.
Comment 11 Rick Lu CLA 2007-01-19 01:43:34 EST
For comments #9, the answer is YES. The color will be "red". Actually, the local property has high priority than values in the referred style.

This feature has been supported in Model part. UI has bug 165624 for this feature. Close it.