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

Bug 436085

Summary: setTabs method in Text widget is ignored when style includes SWT.SINGLE
Product: [Eclipse Project] Platform Reporter: Peter Holloway <holloway.p.r>
Component: SWTAssignee: Eric Williams <ericwill>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: akurtakov, ericwill, xixiyan
Version: 3.8Keywords: triaged
Target Milestone: 4.11 RC1Flags: akurtakov: review+
Hardware: PC   
OS: Linux   
See Also: https://git.eclipse.org/r/137296
https://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=8540e746179ae6f69e9f415f37179feca80a3bb0
Whiteboard: RHT

Description Peter Holloway CLA 2014-05-28 11:48:47 EDT
Creating a text widget with the style flag set to SWT.SINGLE, means that the setTabs method or at least the setTabStops method it calls) is ignored.
    
Text txtInput = new Text(inputHolder, SWT.SINGLE);
txtInput.setTabs(4);
txtInput.addTraverseListener(new TraverseListener() {
    //code to ignore traverses
});

results in tabs still being shown as equal to 8 spaces.

This is coming from the "if ((style & SWT.SINGLE) != 0) return;" line in the setTabStops method of the gtk Text widget. In the win32 version of the widget there is no such check (and may explain the worksforme resolution of bug #34805)
Comment 1 Xi Yan CLA 2018-06-29 14:50:57 EDT
I can reproduce the issue on SWT master as of today, with GTK3.22 and Fedora 28 on both X11 and Wayland.
Comment 2 Eclipse Genie CLA 2019-02-20 09:58:51 EST
New Gerrit change created: https://git.eclipse.org/r/137296
Comment 3 Eric Williams CLA 2019-02-20 10:01:19 EST
We have the ability to support this on GTK3.10+, which is the min version for SWT-GTK anyway. The attached patch should land in early 4.12.
Comment 5 Eric Williams CLA 2019-02-22 09:46:16 EST
(In reply to Eclipse Genie from comment #4)
> Gerrit change https://git.eclipse.org/r/137296 was merged to [master].
> Commit:
> http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/
> ?id=8540e746179ae6f69e9f415f37179feca80a3bb0

In master now.