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

Bug 320742

Summary: [Table] Support for multi-line TableItem text
Product: [RT] RAP Reporter: gianluca Mising name <gianluca.busan>
Component: RWTAssignee: Project Inbox <rap-inbox>
Status: RESOLVED DUPLICATE QA Contact:
Severity: enhancement    
Priority: P4 CC: gianluca.busan, nfalco79, suraj.rajyaguru
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description gianluca Mising name CLA 2010-07-23 11:44:13 EDT
Build Identifier: 

A table that has a rows with different height depending on the "content"

Reproducible: Didn't try
Comment 1 Ivan Furnadjiev CLA 2010-11-22 03:39:02 EST
In SWT this is possible with a custom item painting, see http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet231.java. Unfortunately, MeasureItem, PaintItem and EraseItem events are missing in RAP. GC support for table is missing too. I doubt, that we can implement this in a close future.
Comment 2 Ivan Furnadjiev CLA 2011-03-17 06:55:10 EDT
--- moved from bug 340299 ---
RCP (on Linux platform) table cell content is wrapped when "\n" is used but RAP doesn't wrap the same.

Multi-line rows in web based gui is very common. Just take an example of our RAP Community Forum web page " http://www.eclipse.org/forums/index.php?t=thread&frm_id= 34&S=93d9acc82566642c9de7f1a0b73ebc23", it also uses table with multi-line for main table.

More details and findings on the problem are there in RAP community Forum topic, "http://www.eclipse.org/forums/index.php?t=msg&th=206214&start=0&S=93d9acc82566642c9de7f1a0b73ebc23"

Note: On Windows even RCP doesn't wrap the table cell content. But there is a work-around. More details on this can be fount at above mentioned forum topic.

Reproducible: Always

Steps to Reproduce:
Here is a sample code to create table with multi-line,

private void createSimpleTable(Composite parent) {
TableViewer tv = new TableViewer(parent);
tv.setContentProvider(new IStructuredContentProvider() {
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
}
public void dispose() {
}
public Object[] getElements(Object inputElement) {
return (Object[]) inputElement;
}
});
tv.getTable().setLinesVisible(true);
tv.setInput(new String[]{"line 1\n line2", "line1 \n line2", "line 1\n line2", "line1 \n line2"});
}

This shows multi-line table in RCP app on Linux platform. Using the same code in RAP shows tripped off text in single line for each rows.
Comment 3 Ivan Furnadjiev CLA 2011-03-17 06:55:46 EDT
*** Bug 340299 has been marked as a duplicate of this bug. ***
Comment 4 RĂ¼diger Herrmann CLA 2011-07-23 12:53:10 EDT
For performance and complexity reasons, is is very unlikely that we will ever support tables (or trees) with items that have different heights. Support for multiple lines within a table item will be provided with bug 346768.

*** This bug has been marked as a duplicate of bug 346768 ***