|
Lines 19-25
Link Here
|
| 19 |
|
19 |
|
| 20 |
import javax.servlet.http.HttpServletRequest; |
20 |
import javax.servlet.http.HttpServletRequest; |
| 21 |
|
21 |
|
|
|
22 |
import org.eclipse.birt.report.engine.api.IReportRunnable; |
| 22 |
import org.eclipse.birt.report.engine.api.ReportParameterConverter; |
23 |
import org.eclipse.birt.report.engine.api.ReportParameterConverter; |
|
|
24 |
import org.eclipse.birt.report.engine.css.engine.value.css.CSSConstants; |
| 23 |
import org.eclipse.birt.report.service.BirtViewerReportDesignHandle; |
25 |
import org.eclipse.birt.report.service.BirtViewerReportDesignHandle; |
| 24 |
import org.eclipse.birt.report.service.api.IViewerReportDesignHandle; |
26 |
import org.eclipse.birt.report.service.api.IViewerReportDesignHandle; |
| 25 |
import org.eclipse.birt.report.service.api.IViewerReportService; |
27 |
import org.eclipse.birt.report.service.api.IViewerReportService; |
|
Lines 145-151
Link Here
|
| 145 |
* RTL option. |
147 |
* RTL option. |
| 146 |
*/ |
148 |
*/ |
| 147 |
|
149 |
|
| 148 |
protected boolean rtl = false; |
150 |
protected Boolean rtl = null; |
| 149 |
|
151 |
|
| 150 |
/** |
152 |
/** |
| 151 |
* determin whether the link is a toc or bookmark |
153 |
* determin whether the link is a toc or bookmark |
|
Lines 233-239
Link Here
|
| 233 |
protected void init( HttpServletRequest request ) throws Exception |
235 |
protected void init( HttpServletRequest request ) throws Exception |
| 234 |
{ |
236 |
{ |
| 235 |
this.locale = ParameterAccessor.getLocale( request ); |
237 |
this.locale = ParameterAccessor.getLocale( request ); |
| 236 |
this.rtl = ParameterAccessor.isRtl( request ); |
238 |
this.rtl = ParameterAccessor.getRtl( request ); |
| 237 |
this.reportletId = ParameterAccessor.getReportletId( request ); |
239 |
this.reportletId = ParameterAccessor.getReportletId( request ); |
| 238 |
this.__init( request ); |
240 |
this.__init( request ); |
| 239 |
} |
241 |
} |
|
Lines 249-255
Link Here
|
| 249 |
InputOptions options = new InputOptions( ); |
251 |
InputOptions options = new InputOptions( ); |
| 250 |
options.setOption( InputOptions.OPT_REQUEST, request ); |
252 |
options.setOption( InputOptions.OPT_REQUEST, request ); |
| 251 |
options.setOption( InputOptions.OPT_LOCALE, locale ); |
253 |
options.setOption( InputOptions.OPT_LOCALE, locale ); |
| 252 |
options.setOption( InputOptions.OPT_RTL, new Boolean( rtl ) ); |
254 |
options.setOption( InputOptions.OPT_RTL, rtl ); |
| 253 |
|
255 |
|
| 254 |
Collection parameterList = this.getReportService( ) |
256 |
Collection parameterList = this.getReportService( ) |
| 255 |
.getParameterDefinitions( reportDesignHandle, options, false ); |
257 |
.getParameterDefinitions( reportDesignHandle, options, false ); |
|
Lines 420-426
Link Here
|
| 420 |
*/ |
422 |
*/ |
| 421 |
public boolean isRtl( ) |
423 |
public boolean isRtl( ) |
| 422 |
{ |
424 |
{ |
| 423 |
return rtl; |
425 |
return Boolean.TRUE.equals( rtl ); |
| 424 |
} |
426 |
} |
| 425 |
|
427 |
|
| 426 |
/** |
428 |
/** |
|
Lines 584-587
Link Here
|
| 584 |
{ |
586 |
{ |
| 585 |
this.documentInUrl = documentInUrl; |
587 |
this.documentInUrl = documentInUrl; |
| 586 |
} |
588 |
} |
|
|
589 |
|
| 590 |
/** |
| 591 |
* Gets the HTML/CSS equivalent of the {@link #rtl} flag. |
| 592 |
* |
| 593 |
* @return the {@link org.eclipse.birt.report.engine.css.engine.value.css.CSSConstants#CSS_RTL_VALUE} |
| 594 |
* or {@link org.eclipse.birt.report.engine.css.engine.value.css.CSSConstants#CSS_LTR_VALUE} |
| 595 |
* |
| 596 |
* @author bidi_hcg |
| 597 |
*/ |
| 598 |
public String getOrientation( ) |
| 599 |
{ |
| 600 |
return Boolean.TRUE.equals( rtl ) ? CSSConstants.CSS_RTL_VALUE |
| 601 |
: CSSConstants.CSS_LTR_VALUE; |
| 602 |
} |
| 603 |
|
| 604 |
/** |
| 605 |
* Updates the rtl flag based on the report design orientation. |
| 606 |
* |
| 607 |
* @author bidi_hcg |
| 608 |
*/ |
| 609 |
protected void fixOrientation( HttpServletRequest request ) throws Exception |
| 610 |
{ |
| 611 |
if ( this.rtl != null ) // already was obtained from HTTP request before |
| 612 |
return; |
| 613 |
|
| 614 |
IViewerReportDesignHandle handle = getDesignHandle( request ); |
| 615 |
if ( handle != null ) |
| 616 |
{ |
| 617 |
Object designObject = getDesignHandle( request ).getDesignObject( ); |
| 618 |
if ( designObject instanceof IReportRunnable ) |
| 619 |
{ |
| 620 |
if ( ( (IReportRunnable) designObject ).getDesignHandle( ) |
| 621 |
.isDirectionRTL( ) ) |
| 622 |
{ |
| 623 |
this.rtl = Boolean.TRUE; |
| 624 |
request.setAttribute( InputOptions.OPT_RTL, |
| 625 |
Boolean.TRUE ); |
| 626 |
} |
| 627 |
else |
| 628 |
{ |
| 629 |
this.rtl = Boolean.FALSE; |
| 630 |
request.setAttribute( InputOptions.OPT_RTL, Boolean.FALSE ); |
| 631 |
} |
| 632 |
} |
| 633 |
} |
| 634 |
if ( this.rtl == null ) |
| 635 |
request.removeAttribute( InputOptions.OPT_RTL ); |
| 636 |
} |
| 587 |
} |
637 |
} |