Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 95598 Details for
Bug 225536
[Bidi] Support global orientation of report output
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Patch for HTML emitter
html_080410.diff (text/plain), 10.43 KB, created by
Lina Kemmel
on 2008-04-10 17:54:30 EDT
(
hide
)
Description:
Patch for HTML emitter
Filename:
MIME Type:
Creator:
Lina Kemmel
Created:
2008-04-10 17:54:30 EDT
Size:
10.43 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.birt.report.engine.emitter.html >Index: src/org/eclipse/birt/report/engine/emitter/html/AttributeBuilder.java >=================================================================== >RCS file: /cvsroot/birt/source/org.eclipse.birt.report.engine.emitter.html/src/org/eclipse/birt/report/engine/emitter/html/AttributeBuilder.java,v >retrieving revision 1.36 >diff -u -r1.36 AttributeBuilder.java >--- src/org/eclipse/birt/report/engine/emitter/html/AttributeBuilder.java 7 Dec 2007 08:10:58 -0000 1.36 >+++ src/org/eclipse/birt/report/engine/emitter/html/AttributeBuilder.java 10 Apr 2008 21:52:08 -0000 >@@ -12,6 +12,7 @@ > package org.eclipse.birt.report.engine.emitter.html; > > import org.eclipse.birt.report.engine.content.IStyle; >+import org.eclipse.birt.report.engine.css.engine.value.birt.BIRTConstants; > import org.eclipse.birt.report.engine.ir.DimensionType; > import org.w3c.dom.css.CSSValue; > >@@ -676,4 +677,34 @@ > styleBuffer.append( "')" ); //$NON-NLS-1$ > } > } >+ >+ /** >+ * Builds the direction style. >+ * >+ * @param styleBuffer >+ * The <code>StringBuffer</code> to which the result is output. >+ * @param style >+ * The style object. >+ * >+ * @author bidi_hcg >+ */ >+ public static void buildBidiDirection( StringBuffer styleBuffer, >+ IStyle style ) >+ { >+ if ( style != null ) >+ { >+ String direction = style.getDirection(); >+ >+ if ( direction != null ) >+ { >+ if ( BIRTConstants.BIRT_RTL_VALUE.equals( direction ) ) >+ buildProperty( styleBuffer, IStyle.CSS_DIRECTION_PROPERTY, >+ IStyle.CSS_RTL_VALUE ); >+ else if ( BIRTConstants.BIRT_LTR_VALUE.equals( direction ) ) >+ buildProperty( styleBuffer, IStyle.CSS_DIRECTION_PROPERTY, >+ IStyle.CSS_LTR_VALUE ); >+ } >+ } >+ } >+ > } >Index: src/org/eclipse/birt/report/engine/emitter/html/HTMLEmitter.java >=================================================================== >RCS file: /cvsroot/birt/source/org.eclipse.birt.report.engine.emitter.html/src/org/eclipse/birt/report/engine/emitter/html/HTMLEmitter.java,v >retrieving revision 1.8 >diff -u -r1.8 HTMLEmitter.java >--- src/org/eclipse/birt/report/engine/emitter/html/HTMLEmitter.java 18 Feb 2008 10:21:06 -0000 1.8 >+++ src/org/eclipse/birt/report/engine/emitter/html/HTMLEmitter.java 10 Apr 2008 21:52:09 -0000 >@@ -12,7 +12,6 @@ > package org.eclipse.birt.report.engine.emitter.html; > > import java.util.Stack; >-import org.eclipse.birt.report.engine.api.HTMLRenderOption; > import org.eclipse.birt.report.engine.content.ICellContent; > import org.eclipse.birt.report.engine.content.IColumn; > import org.eclipse.birt.report.engine.content.IContainerContent; >Index: src/org/eclipse/birt/report/engine/emitter/html/HTMLReportEmitter.java >=================================================================== >RCS file: /cvsroot/birt/source/org.eclipse.birt.report.engine.emitter.html/src/org/eclipse/birt/report/engine/emitter/html/HTMLReportEmitter.java,v >retrieving revision 1.196 >diff -u -r1.196 HTMLReportEmitter.java >--- src/org/eclipse/birt/report/engine/emitter/html/HTMLReportEmitter.java 10 Apr 2008 03:19:41 -0000 1.196 >+++ src/org/eclipse/birt/report/engine/emitter/html/HTMLReportEmitter.java 10 Apr 2008 21:52:12 -0000 >@@ -60,6 +60,7 @@ > import org.eclipse.birt.report.engine.content.ITableContent; > import org.eclipse.birt.report.engine.content.ITableGroupContent; > import org.eclipse.birt.report.engine.content.ITextContent; >+import org.eclipse.birt.report.engine.css.engine.value.css.CSSConstants; > import org.eclipse.birt.report.engine.emitter.ContentEmitterAdapter; > import org.eclipse.birt.report.engine.emitter.EmitterUtil; > import org.eclipse.birt.report.engine.emitter.IEmitterServices; >@@ -361,7 +362,8 @@ > actionHandler = actHandler; > } > pageFooterFloatFlag = htmlOption.getPageFooterFloatFlag( ); >- htmlRtLFlag = htmlOption.getHtmlRtLFlag( ); >+ //htmlRtLFlag = htmlOption.getHtmlRtLFlag( ); >+ retrieveRtLFlag( htmlOption ); // bidi_hcg > enableMetadata = htmlOption.getEnableMetadata( ); > ouputInstanceIDs = htmlOption.getInstanceIDs( ); > metadataEmitter = new MetadataEmitter( writer, htmlOption, idGenerator ); >@@ -480,6 +482,8 @@ > // style.removeProperty( "text-align" ); > style.setProperty( IStyle.STYLE_TEXT_ALIGN, > IStyle.RIGHT_VALUE ); >+ style.setProperty( IStyle.STYLE_DIRECTION, >+ IStyle.RIGHT_TO_LEFT_VALUE ); // bidi_hcg > } > } > } >@@ -543,6 +547,16 @@ > > writer.openTag( HTMLTags.TAG_DIV ); > >+ // bidi_hcg start >+ // RTL attribute is required at HTML or BODY level for the correct >+ // scroll bar position. >+ if ( htmlRtLFlag ) >+ { >+ writer.attribute( HTMLTags.ATTR_HTML_DIR, CSSConstants >+ .CSS_RTL_VALUE ); >+ } >+ // bidi_hcg end >+ > //output the report default style > writer.attribute( HTMLTags.ATTR_STYLE, > defaultStyleBuffer.toString( ) ); >@@ -551,6 +565,13 @@ > > writer.startWriter( ); > writer.openTag( HTMLTags.TAG_HTML ); >+ // bidi_hcg start >+ if ( htmlRtLFlag ) >+ { >+ writer.attribute( HTMLTags.ATTR_HTML_DIR, CSSConstants >+ .CSS_RTL_VALUE ); >+ } >+ // bidi_hcg end > writer.openTag( HTMLTags.TAG_HEAD ); > > // write the title of the report in html. >@@ -1212,7 +1233,8 @@ > writer.attribute( "valign", "top" ); > if ( htmlRtLFlag ) > { >- writer.attribute( HTMLTags.ATTR_HTML_DIR, "RTL" ); >+ writer.attribute( HTMLTags.ATTR_HTML_DIR, CSSConstants >+ .CSS_RTL_VALUE ); > } > } > >@@ -1446,9 +1468,29 @@ > CSSValue display = style.getProperty( IStyle.STYLE_DISPLAY ); > if ( null == display || IStyle.BLOCK_VALUE == display ) > { >- // The text-algin value must be center or right. >- CSSValue algin = style.getProperty( IStyle.STYLE_TEXT_ALIGN ); >- if( IStyle.CENTER_VALUE == algin || IStyle.RIGHT_VALUE == algin) >+ // The text-align value must be center or right. >+ CSSValue align = style.getProperty( IStyle.STYLE_TEXT_ALIGN ); >+ >+ // bidi_hcg start >+ // If alignment is inconsistent with direction we need to >+ // be explicit for non-center alignment (i.e. alignment >+ // left and dir is RTL or alignment right and dir is LTR. >+ if ( IStyle.CENTER_VALUE.equals( align ) ) >+ { >+ return true; >+ } >+ CSSValue direction = style.getProperty( IStyle.STYLE_DIRECTION ); >+ if ( IStyle.RIGHT_TO_LEFT_VALUE.equals(direction) ) >+ { >+ if ( IStyle.LEFT_VALUE.equals( align ) ) >+ { >+ return true; >+ } >+ } >+ else >+ // bidi_hcg end >+ >+ if( /*IStyle.CENTER_VALUE == align || */IStyle.RIGHT_VALUE == align) > { > return true; > } >@@ -2859,6 +2901,33 @@ > writer.attribute( HTMLTags.ATTR_ID, group.getBookmark( ) ); > writer.closeTag( HTMLTags.TAG_SPAN ); > } >+ >+ /** >+ * Figures out the RTL rendering option. >+ * >+ * @param htmlOption >+ * @author bidi_hcg >+ */ >+ private void retrieveRtLFlag( HTMLRenderOption htmlOption ) >+ { >+ // If htmlOption has RTL_FLAG option set (likely adopted from an URL >+ // parameter), honor this option, otherwise obtain direction from >+ // the report design. >+ Object bidiFlag = htmlOption.getOption( IRenderOption.RTL_FLAG ); >+ if ( Boolean.TRUE.equals( bidiFlag ) ) >+ { >+ htmlRtLFlag = true; >+ } >+ else if ( bidiFlag == null && report != null) >+ { >+ ReportDesignHandle handle = report.getDesign( ).getReportDesign( ); >+ if ( handle != null ) >+ { >+ htmlRtLFlag = handle.isDirectionRTL( ); >+ htmlOption.setHtmlRtLFlag( htmlRtLFlag ); // not necessary though >+ } >+ } >+ } > } > > class IDGenerator >Index: src/org/eclipse/birt/report/engine/emitter/html/HTMLPerformanceOptimize.java >=================================================================== >RCS file: /cvsroot/birt/source/org.eclipse.birt.report.engine.emitter.html/src/org/eclipse/birt/report/engine/emitter/html/HTMLPerformanceOptimize.java,v >retrieving revision 1.17 >diff -u -r1.17 HTMLPerformanceOptimize.java >--- src/org/eclipse/birt/report/engine/emitter/html/HTMLPerformanceOptimize.java 22 Feb 2008 03:30:39 -0000 1.17 >+++ src/org/eclipse/birt/report/engine/emitter/html/HTMLPerformanceOptimize.java 10 Apr 2008 21:52:09 -0000 >@@ -52,6 +52,11 @@ > AttributeBuilder.buildVisual( styleBuffer, style ); > AttributeBuilder.buildTextDecoration( styleBuffer, style ); > >+ // bidi_hcg start >+ // Build direction. >+ AttributeBuilder.buildBidiDirection( styleBuffer, style ); >+ // bidi_hcg end >+ > // Build the textAlign > String value = style.getTextAlign( ); > if ( null != value ) >@@ -441,6 +446,12 @@ > styleBuffer ); > > >+ // bidi_hcg start >+ // Build direction. >+ AttributeBuilder.buildBidiDirection( styleBuffer, text >+ .getComputedStyle( ) ); >+ // bidi_hcg end >+ > // build the text-align > String textAlign = style.getTextAlign( ); > if ( textAlign != null ) >@@ -482,6 +493,11 @@ > HTMLEmitterUtil.DISPLAY_INLINE_BLOCK, > styleBuffer ); > >+ // bidi_hcg start >+ // Build direction. >+ AttributeBuilder.buildBidiDirection( styleBuffer, foreign.getComputedStyle( ) ); >+ // bidi_hcg end >+ > // build the text-align > String textAlign = style.getTextAlign( ); > if ( textAlign != null ) >Index: src/org/eclipse/birt/report/engine/emitter/html/HTMLVisionOptimize.java >=================================================================== >RCS file: /cvsroot/birt/source/org.eclipse.birt.report.engine.emitter.html/src/org/eclipse/birt/report/engine/emitter/html/HTMLVisionOptimize.java,v >retrieving revision 1.15 >diff -u -r1.15 HTMLVisionOptimize.java >--- src/org/eclipse/birt/report/engine/emitter/html/HTMLVisionOptimize.java 22 Feb 2008 03:30:39 -0000 1.15 >+++ src/org/eclipse/birt/report/engine/emitter/html/HTMLVisionOptimize.java 10 Apr 2008 21:52:12 -0000 >@@ -474,6 +474,12 @@ > if( null != textComputedStyle ) > { > AttributeBuilder.buildTextDecoration( styleBuffer, textComputedStyle ); >+ >+ // bidi_hcg start >+ // Build direction. >+ AttributeBuilder >+ .buildBidiDirection( styleBuffer, textComputedStyle ); >+ // bidi_hcg end > } > > // build the text-align >@@ -534,6 +540,11 @@ > AttributeBuilder.buildText( styleBuffer, style ); > AttributeBuilder.buildVisual( styleBuffer, style ); > >+ // bidi_hcg start >+ // Build direction. >+ AttributeBuilder.buildBidiDirection( styleBuffer, textComputedStyle ); >+ // bidi_hcg end >+ > // build the text-align > String textAlign = style.getTextAlign( ); > if ( textAlign != null )
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
bjorn.freeman-benson
:
iplog+
Lina.Kemmel
:
review?
Actions:
View
|
Diff
Attachments on
bug 225536
:
95596
| 95598 |
96157
|
96159
|
96282
|
96299
|
96652
|
99946
|
101888
|
103603