|
|
|
Re: RAP doesn't wrap "\n" in table cell [message #660175 is a reply to message #660166] |
Thu, 17 March 2011 08:51 |
Ivan Furnadjiev Messages: 2426 Registered: July 2009 Location: Sofia, Bulgaria |
Senior Member |
|
|
Hi Sun,
just tried your snippet in RCP (Windows) and there is *no* multi-line
text in table cells ('\n' is ignored). As RAP, in most cases, tries to
behave the same like the corresponding RCP part on Windows platform,
this is an expected behavior. In RCP (Windows) it's possible to
workaround this limitation by drawing the text with GC (see this
snippet:
http://www.java2s.com/Tutorial/Java/0280__SWT/MultilineTable cell.htm ),
but drawing on Table is still *not* supported in RAP. If you think that
this is a useful feature, please file an enhancement request to consider
the Linux behavior.
Best,
Ivan
On 3/17/2011 10:11 AM, Sun wrote:
> I am using simple table viewer and setting the input which has
> multiline string as objects. Wrote a simple method for you to try out
> as I can not post original code,
>
> 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.
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04226 seconds