Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 323905

Summary: How to get a custom property of a text item in emitter?
Product: z_Archived Reporter: Ivan <lialie>
Component: BIRTAssignee: Birt-ReportEngine-inbox <Birt-ReportEngine-inbox>
Status: RESOLVED WORKSFORME QA Contact: Xiaoying Gu <bluesoldier>
Severity: critical    
Priority: P3 CC: bluesoldier, jouyang, lialie
Version: unspecified   
Target Milestone: 3.7.0   
Hardware: PC   
OS: Windows XP   
Whiteboard: Obsolete

Description Ivan CLA 2010-08-29 08:04:12 EDT
Build Identifier: 2.5.2

I need to implement an editable text field in PDF with iText and BIRT 2.5.2.

Suppose that we creat a cell like following:

<cell id="5737">
<property name="colSpan">5</property>
<property name="rowSpan">1</property>
<property name="paddingLeft">15pt</property>
<property name="textAlign">left</property>

<property name="CUST_PROPERTY">left</property>

<text id="57371">

<property name="CUST_PROPERTY_2">left</property>

<property name="contentType">html</property>
<text-property name="content"><![CDATA[<B>Content</B>]]></text-property >
</text>
</cell>

In BIRT 2.3.2, ITextArea has the Interface getContent(), but in 2.5.2, that remove the method, so my question is:
In Emitter method
protected void drawTextAt( ITextArea text, int x, int y, int width, int height, TextStyle textInfo )
How can I get custom defined propery "CUST_PROPERTY" or "CUST_PROPERTY_2" here?

Thanks,

Reproducible: Always

Steps to Reproduce:
Developing
Comment 1 Jun Ouyang CLA 2011-03-28 22:30:52 EDT
Please override method startText(ITextContext text) in org.eclipse.birt.report.engine.layout.emitter.PageEmitter. You can get text content from the argument and the corresponding textArea by text.getExtension( IContent.LAYOUT_EXTENSION ).