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

Bug 352599

Summary: SWT: Summary value containing line breaks do not show up with the whole text on tree nodes
Product: z_Archived Reporter: Oli Schmid <oliver.schmid>
Component: ScoutAssignee: Project Inbox <scout.core-inbox>
Status: CLOSED FIXED QA Contact:
Severity: minor    
Priority: P3 CC: Andreas.Hoegger, bruno.koeferli, stephan.leichtvogt, zimmermann
Version: unspecifiedFlags: zimmermann: indigo+
zimmermann: juno+
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Patch is returning a single line string in getText methode on a SWTTreeNode
none
Completely replace linebreaks
zimmermann: iplog+
removed trimming of returned value
none
removed trimming of returned value zimmermann: iplog+

Description Oli Schmid CLA 2011-07-20 10:51:28 EDT
When using a multiline text to show up on the treenode only the first line is shown.

Multiline texts should show up as one single line with linebreaks replaced by a space character. 

Reproducible: Always

Steps to Reproduce:
1. Create a tablepage containing a table with defining at least one column of type AbstractStringColumn with the property summary set to true
2. Asign a multiline text to the column
3. Navigate to the node in the SWT GUI
Comment 1 Oli Schmid CLA 2011-07-20 11:17:13 EDT
Created attachment 200013 [details]
Patch is returning a single line string in getText methode on a SWTTreeNode
Comment 2 Andreas Hoegger CLA 2011-07-22 04:58:33 EDT
patch applied on trunk and indigo RC1. 
Thank you Oliver.
Comment 3 Bruno Koeferli CLA 2011-08-04 07:14:31 EDT
Oli's patch does not completly replace linebreaks, f.e. "\r\n" (Windows style) on tree nodes will still be displayed incorrectly - not on a single line.

Therefore I provided a new patch which also will replace "\r\n" by a single blank.

Additionally this patch ensures that strings containing linebreaks will be displayed identical even the text is displayed as tree node, table cell or as title of a view, editor or dialog. By now the "\n" char will only be replaced in table cells. On view, editor or dialog titles the linebreaks will be removed by SWT itself, but without adding a blank.
Comment 4 Bruno Koeferli CLA 2011-08-04 07:17:25 EDT
Created attachment 200899 [details]
Completely replace linebreaks

see my comment for more details
Comment 5 Andreas Hoegger CLA 2011-08-04 07:24:26 EDT
reopen bug for Bruno's patch.
Comment 6 Andreas Hoegger CLA 2011-08-05 05:12:20 EDT
Changed the patch to replace only newline ('\r\n', '\n\r', '\n', '\r') with a space. Sequences of spaces are not replaced by a single space.

Thank you Bruno.
Comment 7 Stephan Leicht Vogt CLA 2011-08-10 02:12:44 EDT
If the string entered is an empty string "" then null is returned. That is obviously wrong.
Comment 8 Stephan Leicht Vogt CLA 2011-08-10 02:21:37 EDT
Corrected this in trunk and indigo RC1. If entered string is null or empty the same string is returned.
Comment 9 Oli Schmid CLA 2011-08-11 10:00:18 EDT
Problems when using indentation in tables.
Indentations are removed (trimed).
Replacing line breaks is not the same as trimming.
Comment 10 Oli Schmid CLA 2011-08-11 10:02:28 EDT
Created attachment 201313 [details]
removed trimming of returned value
Comment 11 Oli Schmid CLA 2011-08-11 10:03:09 EDT
Created attachment 201314 [details]
removed trimming of returned value
Comment 12 Stephan Leicht Vogt CLA 2011-08-11 11:38:11 EDT
patch applied in trunk and indigo RC1. Entered string will not be trimmed.
Comment 13 Matthias Zimmermann CLA 2011-10-10 12:59:17 EDT
shipped with scout 3.7.1
Comment 14 Matthias Zimmermann CLA 2012-05-22 06:00:17 EDT
Comment on attachment 200899 [details]
Completely replace linebreaks

moved iplog flag to patch
Comment 15 Matthias Zimmermann CLA 2012-05-22 06:01:03 EDT
Comment on attachment 201314 [details]
removed trimming of returned value

moved iplog flag to patch