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

Bug 367507

Summary: Pasting multiline text into single-line Text field
Product: z_Archived Reporter: Daniel Wiehl <daniel.wiehl>
Component: ScoutAssignee: Project Inbox <scout.core-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: bsh
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Daniel Wiehl CLA 2011-12-23 12:04:53 EST
If pasting a text containg multiple lines from within the clipboard into a single-line textfield (getConfiguredMultilineText=false), the newlines are only removed if leaving the field.
The same applies for a field that allows only to contain uppercase/lowercase characters (getConfiguredFormat = IStringField#FORMAT_LOWER / IStringField#FORMAT_UPPER). Again, the characters are only converted if leaving the field.

Proposed solution: the configured format should be applied immediately.
Comment 1 Daniel Wiehl CLA 2011-12-23 12:22:35 EST
23.12.2011 dwi
Bugzilla: 367507
Problem:
If pasting a text containg multiple lines from within the clipboard into a single-line textfield (getConfiguredMultilineText=false), the newlines are only removed if leaving the field.
The same applies for a field that allows only to contain uppercase/lowercase characters (getConfiguredFormat = IStringField#FORMAT_LOWER / IStringField#FORMAT_UPPER).
Again, the characters are only converted if leaving the field.
Solution:
The configured format is applied immediately to the entered text.
Plug-In changed: org.eclipse.scout.rt.ui.swing [SwingScoutTextFieldComposite#P_SwingDocumentFilter]
Migration: None
Comment 2 Beat Schwarzentrub CLA 2012-01-03 05:24:44 EST
When having a single-line text field (getConfiguredMultilineText=false), leading and trailing newlines should not be replaced by spaces but omitted instead.
Comment 3 Daniel Wiehl CLA 2012-01-03 05:36:47 EST
03.01.2012 dwi
Bugzilla: 367507
Problem:
I having a single line textfield (getConfiguredMultilineText=false), leading and trailing newlines should not be replaced by spaces but omitted insted.
Solution:
Leading and trailing newlines are trimmed prior to replacing them by spaces.
Plug-Ins changed:
org.eclipse.scout.commons [StringUtility], org.eclipse.scout.rt.ui.swing [SwingScoutTextFieldComposite#P_SwingDocumentFilter], org.eclipse.scout.rt.client [SwingScoutTextFieldComposite]
Migration: None
Comment 4 Daniel Wiehl CLA 2012-01-06 10:44:49 EST
03.01.2012 dwi
Bugzilla: 367507
Problem:
The text format is lost when loading the initial text of an editiable cell. That is because of ticket 367507 where newlines for single-line text fields are removed.
However, this is not about a bug of ticket 367507 but rather due to wrong initialization sequence in SwingScoutTextFieldComposite#attachScout.
The bug occurs because the display text is set prior to the model properties be read which in turn are used by the Document filter to ensure proper text format.
Solution:
Changed initialization sequence to first read model properties before setting the display text.
Plug-Ins changed:
org.eclipse.scout.rt.ui.swing [SwingScoutTextFieldComposite#attachScout]
Migration: None
Comment 5 Matthias Zimmermann CLA 2012-07-09 06:50:06 EDT
ticket closed.
deliverd as part of eclipse scout 3.8.0 (juno release train)