Bug 328832 - [Win32] Multi line Text field (SWT.MULTI) does not support Text.setMessage
Summary: [Win32] Multi line Text field (SWT.MULTI) does not support Text.setMessage
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.7   Edit
Hardware: PC Windows 7
: P3 normal with 2 votes (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 569160
  Show dependency tree
 
Reported: 2010-10-27 10:27 EDT by Henno Vermeulen CLA
Modified: 2021-06-18 03:12 EDT (History)
6 users (show)

See Also:


Attachments
Snippet showing this. (2.11 KB, application/octet-stream)
2018-12-18 06:29 EST, Wim Jongman CLA
no flags Details
FloatingText Widget (10.33 KB, application/octet-stream)
2018-12-18 06:36 EST, Wim Jongman CLA
no flags Details
Snippet for the FloatingText composite (2.33 KB, application/octet-stream)
2018-12-18 06:38 EST, Wim Jongman CLA
no flags Details
Demonstration of SWT.MULTI showing in FloatingText (472.23 KB, video/mp4)
2018-12-18 06:41 EST, Wim Jongman CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Henno Vermeulen CLA 2010-10-27 10:27:20 EDT
Build Identifier: 20090920-1017

Currently Text.setMessage("enter remarks") has no effect for multi line text fields.

One use case for SWT.setMessage (which has nothing to do with SWT.SEARCH): a multi-line textfield for remarks which shows "enter remarks" in gray when it is empty.


Reproducible: Always
Comment 1 Wim Jongman CLA 2018-12-18 06:29:03 EST
Created attachment 276951 [details]
Snippet showing this.
Comment 2 Wim Jongman CLA 2018-12-18 06:36:29 EST
Created attachment 276952 [details]
FloatingText Widget

This is a composite that does show the message on SWT.MULTI in some situations.
Comment 3 Wim Jongman CLA 2018-12-18 06:38:12 EST
Created attachment 276953 [details]
Snippet for the FloatingText composite

When using this Snippet that uses the FloatingText composite which is also attached you can see that SWT.MULTI does show a message in some situations.
Comment 4 Wim Jongman CLA 2018-12-18 06:41:19 EST
Created attachment 276954 [details]
Demonstration of SWT.MULTI showing in FloatingText

In this movie, you can see that the middle widget does not show a message but the bottom widget does and they are both SWT.MULTI.
Comment 5 Thomas Wolf CLA 2020-11-27 12:29:05 EST
The difference in behavior in the FloatingTextSnippet is caused by a bug in FloatingText in line 113 in the attachment: SWT.SEPARATOR == SWT.MULTI. (See also [1].)

The bottom "multi" field is not a multi-line field; it's a single line field that just grabs the remaining space. Try entering a second line there :-)

The middle one is a multi-line field. FloatingText by mistake removes the SWT.MULTI when it clears the SWT.SEPARATOR flag, but Text re-adds SWT.MULTI because SWT.WRAP is set.

The original report from comment 0 is still correct, though: setMessage() works only for single-line fields (I checked only OS X). However, at least on Cocoa, the implementation class for mutli-line text fields, NSTextView, does not have that concept. It would need to be emulated, but that'd be departing from the SWT concept of being as close as possible to native widgets.

[1] https://git.eclipse.org/r/c/platform/eclipse.platform.ui/+/172920/4/bundles/org.eclipse.jface.widgets/src/org/eclipse/jface/widgets/floatingtext/FloatingText.java#126
Comment 6 Marcus Hirt CLA 2021-06-18 03:12:30 EDT
https://bugs.openjdk.java.net/browse/JMC-7298