Community
Participate
Working Groups
This bug is to introduce design element text direction property. To improve readability of certain text-enabled items, users will be given ability to control text direction at report element level. The direction default will be driven from the global orientation (bug 225140), but it would be possible to apply text direction value mismatching that of the global orientation.
Created attachment 94547 [details] Patch against the current trunk This attachment includes API-related and some other basic changes to support design element text direction. The changes mostly apply to the style model and Report engine (generation phase).
Comment on attachment 94547 [details] Patch against the current trunk More information: The main goal of the changes is to extend the ROM Style element with a new property representing the horizontal direction of text flow, and provide API for retrieving and manipulating this property programmatically. 1. Report metadata changes aim at defining a Property element named "bidiTextDirection", and are handled in course of bug 225140. 2. Design engine: 2.2. Public constants: - org.eclipse.birt.report.model.elements.interfaces.IStyleModel #TEXT_DIRECTION_PROP 2.3. Getters and setters: - org.eclipse.birt.report.model.simpleapi.Style#getDirection - org.eclipse.birt.report.model.simpleapi.Style#setDirection - org.eclipse.birt.report.model.api.StyleHandle#getDirection - org.eclipse.birt.report.model.api.StyleHandle#setDirection - org.eclipse.birt.report.model.api.HighlightRuleHandle#getDirection - org.eclipse.birt.report.model.api.HighlightRuleHandle#setDirection - org.eclipse.birt.report.model.api.TOCHandle#getDirection (not settable for the time being) 2.4. A new public method org.eclipse.birt.report.model.api.GroupPropertyHandle#isDirectionRTL - figures out whether the first property is the group is right-to-left. Meant to be consumed for presentation purposes in Eclipse-based Design tool. 3. Report engine: 3.1. Public constants: 3.1.1. Internal BIRT style model: - org.eclipse.birt.report.model.elements.interfaces.IStyleModel #TEXT_DIRECTION_PROP = "bidiTextDirection" 3.1.2. CSS-compliant style constant: - org.eclipse.birt.report.engine.css.engine.value.css .CSSConstants#CSS_DIRECTION_PROPERTY = "direction" 3.2. Other constants, property getters and setters: 3.2.1. Class org.eclipse.birt.report.engine.css.dom.AbstractStyle: 3.2.1.1. Getter: - public String getDirection( ) 3.2.1.2. Setter: - public String setDirection( String ) 3.2.2. Class org.eclipse.birt.report.engine.api.TOCStyle: 3.2.2.1. Constants: - public static final String DIRECTION = "direction" (where the name matches that defined in the CSS-2 spec) 3.2.2.2. Getter: - public String getDirection( ) 3.2.2.3. Setter: - public String setDirection( String ) 3.2.3. Class org.eclipse.birt.report.engine.script.internal.instance .StyleInstance: 3.2.3.1. Getter: - public String getDirection( ) 3.2.3.2. Setter: - public String setDirection( String ) 3.3. Style constants definitions, a hash table and hash implementation for looking up a property name were modified to back the new keyword - "direction". Affected modules: - src/org/eclipse/birt/report/engine/css/engine/token.gperf - src/org/eclipse/birt/report/engine/css/engine/token.cpp (re-generated) - class org.eclipse.birt.report.engine.css.engine.PerfectHash - class org.eclipse.birt.report.engine.css.engine.StyleConstants
I suggest we use the name "direction" for the new style property. This is consistent with the CSS name. Actually the proposed api already use get/setDirection(). And maybe the same for report design, just use "direction" or "orientation".
These names were used initially, but changed later, mainly for the following reason. Since BIRT is aimed at a broad range of users, including those not really familiar with bi-directionality or CSS spec in general, the PMC board recommended to use more indicative names in the UI. Another reason for not using the CSS-compliant name for direction was that functionalities behind the CSS "direction" and the BIRT "bidiTextDirection" are not equal. The former is supposed to act as "layout orientation", affecting both graphical and textual elements of the UI component. The latter only implies the order of characters in a text paragraph. These behave similarly to |WS_EX_LAYOUTRTL| and |WS_EX_RTLREADING| MS Window styles respectively (http://msdn2.microsoft.com/en-us/library/ms632680.aspx). (In the future, we would like to support also the CSS-compliant direction style, actually referred to in bug 223357.)
Created attachment 95391 [details] Complementary patch Complementary patch that relocates some changes from bug 225140 here, with support for both orientation and direction. Also includes changes to write Bidi properties into report XML file (ModuleWriter). This patch should not conflict with the previous one.
please wait for the result of the bidi contribution IP review. You can find the detail at https://dev.eclipse.org/ipzilla/show_bug.cgi?id=2260
The IP review is complete, and this submission is now approved.
Patched on Model codes. Since also contains Engine patch, reassign to Engine team. Some APIs are different from patch for the Model API naming schema: StyleHandle.getTextDirection/setTextDirection HighlightRuleHandle.getTextDirection/setTextDirection TocHandle.getTextDirection/setTextDirection Bidi choice constants: DesignChoiceConstants.BIDI_DIRECTION_RTL DesignChoiceConstants.BIDI_DIRECTION_LTR
Lina, class org.eclipse.birt.report.engine.util.BidiAlignmentResolver is missed in the patch.
Created attachment 99429 [details] BidiAlignmentResolver patch BidiAlignmentResolver was included in attachment #96624 [details]. I add it also here, with minor modifications.
Fixed.
(In reply to comment #8) > Bidi choice constants: > > DesignChoiceConstants.BIDI_DIRECTION_RTL > DesignChoiceConstants.BIDI_DIRECTION_LTR > Rick, will the direction choice constants "rtl" and "ltr" be used uniformly, replacing all occurrences of "Right To Left" and "Left To Right"? Thanks.
(In reply to comment #12) > (In reply to comment #8) > > Bidi choice constants: > > > > DesignChoiceConstants.BIDI_DIRECTION_RTL > > DesignChoiceConstants.BIDI_DIRECTION_LTR > > > > Rick, will the direction choice constants "rtl" and "ltr" be used uniformly, > replacing all occurrences of "Right To Left" and "Left To Right"? > Thanks. > Yes, since in CSS, "rtl"/"ltr" is standard option for direction. BIRT mimics it. The design file and constants uses them instead of "Right To Left"/"Left To Right".
Okay, sounds great. Thanks to All for integrating the changes!
Comment on attachment 94547 [details] Patch against the current trunk per Ganymede IP log
Comment on attachment 99429 [details] BidiAlignmentResolver patch per Ganymede IP log
Comment on attachment 95391 [details] Complementary patch per Ganymede IP log
Verified. Closing.