Community
Participate
Working Groups
Build Identifier: I20100608-0911 I have SWT Text widget which is created with SWT.SINGLE style e.g. Text myTextControl = new Text(shell, SWT.SINGLE); Now, when I try to copy column from Ms-Excel only first of that selected column gets pasted into Text widget and not entire column. I do understand that when I create Text widget with SWT.MULTI then I am able to paste entire Ms-Excel column into widget but it will not be in single row. Previously, I was using Swings JTextField and in that case whenever I used to paste MS-Excel column ( using CTRL-V ) the entire Ms-Excel column gets pasted as a row in JTextField. I am looking for same kind of feature for SWT Text widget. Reproducible: Always Steps to Reproduce: 1.Create SWT Text widget 2.Copy any column from Ms-Excel 3. Paste into SWT Text widget.
To me the current behaviour makes sense. If you are pasting multiple lines into a single line text box, you should only get the first line. However, I will let SWT decide this bug's fate.
This is the correct native win32 behaviour, the same thing happens if you paste into any other single-line win32 text control in Windows itself. Closing report. To override this native behaviour you need to access the clipboard content and insert the text you want into the text control. For an example of accessing the clipboard see http://git.eclipse.org/c/platform/eclipse.platform.swt.git/plain/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet94.java .