Wednesday, December 06, 2006
Accessibility, Editable Text and Labels
You may have noticed that throughout the Eclipse UI we will periodically use an editable Text instead of a Label. There are two reasons for this
This only works if the label and the widget that can take focus have the same parent and are one after the other in the z-order. z-order is order of creation by default - if that doesn't work for you because of how your code is structured check out Control#moveAbove or Control#moveBelow to adjust this order.
If you want more details you can check out my article on eclipse.org at or better yet vote and then go to Cori Ryan's talk at Eclipsecon .
- You might want to allow the user to select the text for copying. We use it in the Resource Property Page to allow you to select the path of a resource for instance.
- Accessibility. If a label needs to be read to make a dialog usable it has to be able to take focus for screen reader users. The wizard dialog error message area is an example of this. Note that we don't do this if the label is just a secondary note.
This only works if the label and the widget that can take focus have the same parent and are one after the other in the z-order. z-order is order of creation by default - if that doesn't work for you because of how your code is structured check out Control#moveAbove or Control#moveBelow to adjust this order.
If you want more details you can check out my article on eclipse.org at or better yet vote and then go to Cori Ryan's talk at Eclipsecon .