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

Bug 398301

Summary: RAP vs SWT Text vertical alignment inconsistent
Product: [RT] RAP Reporter: John Gymer <jgymer>
Component: RWTAssignee: Project Inbox <rap-inbox>
Status: RESOLVED WONTFIX QA Contact:
Severity: normal    
Priority: P3    
Version: 2.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description John Gymer CLA 2013-01-16 10:57:40 EST
In SWT the default behaviour of a Text widget is to align the text entered with the TOP of the entry field, but in RAP the default behaviour is to vertically CENTRE it in the control.
RAP should be changed to mimic the behaviour of SWT and align the entry text vertically with the TOP.
(Using RAP 2.0 M4+ some nightly)
Thanks, John
Comment 1 Ivan Furnadjiev CLA 2013-01-18 06:44:49 EST
As Ralf mentioned in the newsgroup the vertical alignment of Text widget is platform dependent. I don't think that we have to mimic the Windows behavior in any case. I will close it as WONTFIX.
Comment 2 John Gymer CLA 2013-01-18 07:01:39 EST
How about an enhancement then, to support setting of vertical alignment through a method/property?
Comment 3 Ivan Furnadjiev CLA 2013-01-18 07:53:50 EST
This will make the implementation event more complex. Is this issue so critical for you?
Comment 4 John Gymer CLA 2013-01-21 06:04:30 EST
Hi Ivan,
it isn't necessarily a show-stopper, but I would at least like to find a way to achieve the same thing under RAP, even if it means creating the Text inside a Composite, or some other trick. This is what I'm doing for Prompts already, but for an entry field it might be a little harder to make it look convincing. I'll experiment and see what I can come up with.
Thanks for your time on it.
John
Comment 5 Ralf Sternberg CLA 2013-01-23 14:38:52 EST
You could create a Text field without BORDER and place it in a Composite with a suitable layout and the same background color as the Text.

I believe that we should not change the text field because, as I've said in the forum, it behaves just as the SWT Text under GTK. And I haven't seen a GTK application with a broken text field. But maybe a screenshot of the problematic UI could convince us that we have to handle the case.
Comment 6 John Gymer CLA 2013-01-24 06:13:57 EST
Hi Ralf/Ivan,
No problems - I've taken the advice of placing the Text inside a Composite with a GridLayout on the Composite to get the Text at the top, which works perfectly.
Thanks, John