Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 71765 - Look & Feel of readonly text fields is problematic on Mac OS X
Summary: Look & Feel of readonly text fields is problematic on Mac OS X
Status: CLOSED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.0   Edit
Hardware: PC Mac OS X
: P3 major with 6 votes (vote)
Target Milestone: ---   Edit
Assignee: Silenio Quarti CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
: 33241 34547 39661 66994 68713 74716 75566 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-08-11 06:47 EDT by Andre Weinand CLA
Modified: 2019-11-27 07:03 EST (History)
18 users (show)

See Also:


Attachments
readonly text fields in XCode IDE (64.78 KB, image/jpeg)
2004-08-11 06:50 EDT, Andre Weinand CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andre Weinand CLA 2004-08-11 06:47:40 EDT
3.0

Eclipse uses readonly text fields as an emulation for "accessible labels", that is labels
into which you can navigate by tabbing and where you select and copy the text to the clipboard.

This approach reveals the follwoing problems on Mac OS X:

- a readonly text field does not have the same background as a Label.
  It still looks like a field where you can enter text (bugs #39661, #68713, #34547)
  This invalidates Eclipse's use of readonly fields as "accessible labels".
  See first attached screenshot for how Apple implements accessible labels in the XCode IDE.
  
- tabbing into readonly fields is questionable:
  example: you can tab into a wizard's header description field (see bug #65322).
  Apple does not support tabbing into text labels even if the text can be selected
  with the mouse or keyboard. See property dialog in XCode IDE.
  (Even turning on the "Full Keyboard Access" option in the Keyboard & Mouse
  preference pane doesn't enable tabbing into text labels).
  
- showing a focus ring for readonly text fields is misleading (bugs #33241)
  See any Mac application that supports selectable/copyable text labels
  (Apple XCode, MS Entourage): they never show a focus ring.
  

In addition readonly text fields have another problem on their own:

- a readonly field has no cue that it is readonly (bugs #32471, #32944)
Comment 1 Andre Weinand CLA 2004-08-11 06:50:18 EDT
Created attachment 13871 [details]
readonly text fields in XCode IDE
Comment 2 Andre Weinand CLA 2004-08-11 06:52:44 EDT
*** Bug 39661 has been marked as a duplicate of this bug. ***
Comment 3 Andre Weinand CLA 2004-08-11 06:53:32 EDT
*** Bug 68713 has been marked as a duplicate of this bug. ***
Comment 4 Andre Weinand CLA 2004-08-11 06:54:09 EDT
*** Bug 34547 has been marked as a duplicate of this bug. ***
Comment 5 Andre Weinand CLA 2004-08-11 06:54:50 EDT
*** Bug 33241 has been marked as a duplicate of this bug. ***
Comment 6 Billy Biggs CLA 2004-08-11 14:19:58 EDT
The accessible labels cause similar problems on Linux/GTK+ as they look out of
place on themes with pixmap backgrounds (I thought there was already a bug about
this but I cannot find it).  GTK+ 2.4 added support for keynav into labels using
Ctrl-Tab for a11y.  If the Mac has no way to tab into a label, how do screen
readers work?
Comment 7 Andre Weinand CLA 2004-08-12 03:25:46 EDT
Billy, may be bug #39661 is the one you are looking for. It started as a linux bug and was closed and 
later reopened for Mac OS X.
Comment 8 Veronika Irvine CLA 2004-08-13 11:22:45 EDT
Need to determine how native Windows applications do this.
Comment 9 Dani Megert CLA 2004-09-23 03:47:51 EDT
*** Bug 74716 has been marked as a duplicate of this bug. ***
Comment 10 Steve Northover CLA 2004-09-23 10:22:35 EDT
SSQ, could we use the fact that the text fields of this type are SWT.READ_ONLY 
and created without a border to indicate that they are really "accessible 
labels".  At least on the Mac, we could draw them the same way that XCode does.
Comment 11 Steve Northover CLA 2004-11-02 10:49:31 EST
I think we should make our TNXObject based Text control behave the same way as 
the single line read only text control that we are proposing to use in the 
Spinner control.  SSQ?
Comment 12 Billy Biggs CLA 2004-11-15 23:20:02 EST
*** Bug 66994 has been marked as a duplicate of this bug. ***
Comment 13 Billy Biggs CLA 2005-02-12 23:08:00 EST
*** Bug 75566 has been marked as a duplicate of this bug. ***
Comment 14 Todd Brackett CLA 2005-04-14 20:14:38 EDT
What Carbon APIs are being leveraged to create the readonly text fields in Eclipse?

Apple's Human Interface Guildelines provide guidance on how to display static text (active/dimmed/
selectable) as well as text fields in Mac OS X.  For reference see:  http://developer.apple.com/
documentation/UserExperience/Conceptual/OSXHIGuidelines/index.html
Comment 15 Steve Northover CLA 2005-04-15 09:04:11 EDT
>>I think we should make our TNXObject based Text control behave
>>the same way as the single line read only text control that we
>>are proposing to use in the Spinner control.  SSQ?
Comment 16 Steve Northover CLA 2006-08-01 16:10:19 EDT
Under HIView, we are using the HITextView control rather than the TXNObject.  We are no longer drawing the focus ring.  However, you can still tab to the field but you get no indication that focus is in the control (bad).

I'm not sure we should change this for accessibility reasons.  Your thoughts?
Comment 17 Markus Keller CLA 2011-05-13 14:08:58 EDT
Readonly text fields are still a sore point in the SWT API.

The commonly used solution is a Text widget with SWT.READ_ONLY and
  text.setBackground(getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));

Since on Windows, a READ_ONLY text gets a gray background for free, most users forget to hack the bg color. On GTK and Cocoa, the bg stays white.
Comment 18 Dani Megert CLA 2012-10-03 09:37:49 EDT
(In reply to comment #17)
> Readonly text fields are still a sore point in the SWT API.
> 
> The commonly used solution is a Text widget with SWT.READ_ONLY and
>  
> text.setBackground(getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
> 
> Since on Windows, a READ_ONLY text gets a gray background for free, most
> users forget to hack the bg color. On GTK and Cocoa, the bg stays white.

Just happened to me  (see bug 222090 comment 10). It would be good to address this.
Comment 19 Markus Keller CLA 2012-10-03 10:09:22 EDT
Current state:

On Cocoa, a Text with READ_ONLY but without BORDER has a white background (not widget background color).

On GTK, it depends on the specifics of how the Text is created: In the ControlExample, it initially looks OK (gray bg with READ_ONLY), but when you set a custom bg color and then click Colors and Fonts > Default, the bg becomes white. OTOH, in an Eclipse properties page, it was always white (bug 222090 comment 10).
Comment 20 Markus Keller CLA 2013-12-10 11:08:26 EST
Regex to find readonly text fields that need a workaround:
new Text\([^,]+,[^\)]+SWT\.READ_ONLY

Internal workaround for JDT UI code:
org.eclipse.jdt.internal.ui.util.SWTUtil#fixReadonlyTextBackground(Text)
Comment 21 Lars Vogel CLA 2019-11-27 07:03:12 EST
This bug hasn't had any activity in quite some time. Maybe the problem got
resolved, was a duplicate of something else, or became less pressing for some
reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it.
The information can be, for example, that the problem still occurs, that you
still want the feature, that more information is needed, or that the bug is
(for whatever reason) no longer relevant.

If the bug is still relevant, please remove the stalebug whiteboard tag.