|
Lines 60-65
Link Here
|
| 60 |
import org.eclipse.birt.report.engine.content.ITableContent; |
60 |
import org.eclipse.birt.report.engine.content.ITableContent; |
| 61 |
import org.eclipse.birt.report.engine.content.ITableGroupContent; |
61 |
import org.eclipse.birt.report.engine.content.ITableGroupContent; |
| 62 |
import org.eclipse.birt.report.engine.content.ITextContent; |
62 |
import org.eclipse.birt.report.engine.content.ITextContent; |
|
|
63 |
import org.eclipse.birt.report.engine.css.engine.value.css.CSSConstants; |
| 63 |
import org.eclipse.birt.report.engine.emitter.ContentEmitterAdapter; |
64 |
import org.eclipse.birt.report.engine.emitter.ContentEmitterAdapter; |
| 64 |
import org.eclipse.birt.report.engine.emitter.EmitterUtil; |
65 |
import org.eclipse.birt.report.engine.emitter.EmitterUtil; |
| 65 |
import org.eclipse.birt.report.engine.emitter.IEmitterServices; |
66 |
import org.eclipse.birt.report.engine.emitter.IEmitterServices; |
|
Lines 361-367
Link Here
|
| 361 |
actionHandler = actHandler; |
362 |
actionHandler = actHandler; |
| 362 |
} |
363 |
} |
| 363 |
pageFooterFloatFlag = htmlOption.getPageFooterFloatFlag( ); |
364 |
pageFooterFloatFlag = htmlOption.getPageFooterFloatFlag( ); |
| 364 |
htmlRtLFlag = htmlOption.getHtmlRtLFlag( ); |
365 |
//htmlRtLFlag = htmlOption.getHtmlRtLFlag( ); |
|
|
366 |
retrieveRtLFlag( htmlOption ); // bidi_hcg |
| 365 |
enableMetadata = htmlOption.getEnableMetadata( ); |
367 |
enableMetadata = htmlOption.getEnableMetadata( ); |
| 366 |
ouputInstanceIDs = htmlOption.getInstanceIDs( ); |
368 |
ouputInstanceIDs = htmlOption.getInstanceIDs( ); |
| 367 |
metadataEmitter = new MetadataEmitter( writer, htmlOption, idGenerator ); |
369 |
metadataEmitter = new MetadataEmitter( writer, htmlOption, idGenerator ); |
|
Lines 480-485
Link Here
|
| 480 |
// style.removeProperty( "text-align" ); |
482 |
// style.removeProperty( "text-align" ); |
| 481 |
style.setProperty( IStyle.STYLE_TEXT_ALIGN, |
483 |
style.setProperty( IStyle.STYLE_TEXT_ALIGN, |
| 482 |
IStyle.RIGHT_VALUE ); |
484 |
IStyle.RIGHT_VALUE ); |
|
|
485 |
style.setProperty( IStyle.STYLE_DIRECTION, |
| 486 |
IStyle.RIGHT_TO_LEFT_VALUE ); // bidi_hcg |
| 483 |
} |
487 |
} |
| 484 |
} |
488 |
} |
| 485 |
} |
489 |
} |
|
Lines 543-548
Link Here
|
| 543 |
|
547 |
|
| 544 |
writer.openTag( HTMLTags.TAG_DIV ); |
548 |
writer.openTag( HTMLTags.TAG_DIV ); |
| 545 |
|
549 |
|
|
|
550 |
// bidi_hcg start |
| 551 |
// RTL attribute is required at HTML or BODY level for the correct |
| 552 |
// scroll bar position. |
| 553 |
if ( htmlRtLFlag ) |
| 554 |
{ |
| 555 |
writer.attribute( HTMLTags.ATTR_HTML_DIR, CSSConstants |
| 556 |
.CSS_RTL_VALUE ); |
| 557 |
} |
| 558 |
// bidi_hcg end |
| 559 |
|
| 546 |
//output the report default style |
560 |
//output the report default style |
| 547 |
writer.attribute( HTMLTags.ATTR_STYLE, |
561 |
writer.attribute( HTMLTags.ATTR_STYLE, |
| 548 |
defaultStyleBuffer.toString( ) ); |
562 |
defaultStyleBuffer.toString( ) ); |
|
Lines 551-556
Link Here
|
| 551 |
|
565 |
|
| 552 |
writer.startWriter( ); |
566 |
writer.startWriter( ); |
| 553 |
writer.openTag( HTMLTags.TAG_HTML ); |
567 |
writer.openTag( HTMLTags.TAG_HTML ); |
|
|
568 |
// bidi_hcg start |
| 569 |
if ( htmlRtLFlag ) |
| 570 |
{ |
| 571 |
writer.attribute( HTMLTags.ATTR_HTML_DIR, CSSConstants |
| 572 |
.CSS_RTL_VALUE ); |
| 573 |
} |
| 574 |
// bidi_hcg end |
| 554 |
writer.openTag( HTMLTags.TAG_HEAD ); |
575 |
writer.openTag( HTMLTags.TAG_HEAD ); |
| 555 |
|
576 |
|
| 556 |
// write the title of the report in html. |
577 |
// write the title of the report in html. |
|
Lines 1212-1218
Link Here
|
| 1212 |
writer.attribute( "valign", "top" ); |
1233 |
writer.attribute( "valign", "top" ); |
| 1213 |
if ( htmlRtLFlag ) |
1234 |
if ( htmlRtLFlag ) |
| 1214 |
{ |
1235 |
{ |
| 1215 |
writer.attribute( HTMLTags.ATTR_HTML_DIR, "RTL" ); |
1236 |
writer.attribute( HTMLTags.ATTR_HTML_DIR, CSSConstants |
|
|
1237 |
.CSS_RTL_VALUE ); |
| 1216 |
} |
1238 |
} |
| 1217 |
} |
1239 |
} |
| 1218 |
|
1240 |
|
|
Lines 1446-1454
Link Here
|
| 1446 |
CSSValue display = style.getProperty( IStyle.STYLE_DISPLAY ); |
1468 |
CSSValue display = style.getProperty( IStyle.STYLE_DISPLAY ); |
| 1447 |
if ( null == display || IStyle.BLOCK_VALUE == display ) |
1469 |
if ( null == display || IStyle.BLOCK_VALUE == display ) |
| 1448 |
{ |
1470 |
{ |
| 1449 |
// The text-algin value must be center or right. |
1471 |
// The text-align value must be center or right. |
| 1450 |
CSSValue algin = style.getProperty( IStyle.STYLE_TEXT_ALIGN ); |
1472 |
CSSValue align = style.getProperty( IStyle.STYLE_TEXT_ALIGN ); |
| 1451 |
if( IStyle.CENTER_VALUE == algin || IStyle.RIGHT_VALUE == algin) |
1473 |
|
|
|
1474 |
// bidi_hcg start |
| 1475 |
// If alignment is inconsistent with direction we need to |
| 1476 |
// be explicit for non-center alignment (i.e. alignment |
| 1477 |
// left and dir is RTL or alignment right and dir is LTR. |
| 1478 |
if ( IStyle.CENTER_VALUE.equals( align ) ) |
| 1479 |
{ |
| 1480 |
return true; |
| 1481 |
} |
| 1482 |
CSSValue direction = style.getProperty( IStyle.STYLE_DIRECTION ); |
| 1483 |
if ( IStyle.RIGHT_TO_LEFT_VALUE.equals(direction) ) |
| 1484 |
{ |
| 1485 |
if ( IStyle.LEFT_VALUE.equals( align ) ) |
| 1486 |
{ |
| 1487 |
return true; |
| 1488 |
} |
| 1489 |
} |
| 1490 |
else |
| 1491 |
// bidi_hcg end |
| 1492 |
|
| 1493 |
if( /*IStyle.CENTER_VALUE == align || */IStyle.RIGHT_VALUE == align) |
| 1452 |
{ |
1494 |
{ |
| 1453 |
return true; |
1495 |
return true; |
| 1454 |
} |
1496 |
} |
|
Lines 2859-2864
Link Here
|
| 2859 |
writer.attribute( HTMLTags.ATTR_ID, group.getBookmark( ) ); |
2901 |
writer.attribute( HTMLTags.ATTR_ID, group.getBookmark( ) ); |
| 2860 |
writer.closeTag( HTMLTags.TAG_SPAN ); |
2902 |
writer.closeTag( HTMLTags.TAG_SPAN ); |
| 2861 |
} |
2903 |
} |
|
|
2904 |
|
| 2905 |
/** |
| 2906 |
* Figures out the RTL rendering option. |
| 2907 |
* |
| 2908 |
* @param htmlOption |
| 2909 |
* @author bidi_hcg |
| 2910 |
*/ |
| 2911 |
private void retrieveRtLFlag( HTMLRenderOption htmlOption ) |
| 2912 |
{ |
| 2913 |
// If htmlOption has RTL_FLAG option set (likely adopted from an URL |
| 2914 |
// parameter), honor this option, otherwise obtain direction from |
| 2915 |
// the report design. |
| 2916 |
Object bidiFlag = htmlOption.getOption( IRenderOption.RTL_FLAG ); |
| 2917 |
if ( Boolean.TRUE.equals( bidiFlag ) ) |
| 2918 |
{ |
| 2919 |
htmlRtLFlag = true; |
| 2920 |
} |
| 2921 |
else if ( bidiFlag == null && report != null) |
| 2922 |
{ |
| 2923 |
ReportDesignHandle handle = report.getDesign( ).getReportDesign( ); |
| 2924 |
if ( handle != null ) |
| 2925 |
{ |
| 2926 |
htmlRtLFlag = handle.isDirectionRTL( ); |
| 2927 |
htmlOption.setHtmlRtLFlag( htmlRtLFlag ); // not necessary though |
| 2928 |
} |
| 2929 |
} |
| 2930 |
} |
| 2862 |
} |
2931 |
} |
| 2863 |
|
2932 |
|
| 2864 |
class IDGenerator |
2933 |
class IDGenerator |