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

Bug 296013

Summary: [win32] Text.selectAll() does not work as expected if a Text control has a tool tip
Product: [Eclipse Project] Platform Reporter: Benjamin Leipold <benjamin.leipold>
Component: SWTAssignee: Platform-SWT-Inbox <platform-swt-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: major    
Priority: P3 CC: cocoakevin, eclipse.felipe, niraj.modi
Version: 3.5Keywords: triaged
Target Milestone: ---   
Hardware: PC   
OS: Windows All   
Whiteboard: stalebug
Attachments:
Description Flags
Reproducer for the described behavior. none

Description Benjamin Leipold CLA 2009-11-24 10:30:15 EST
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.1.5) Gecko/20091102 Firefox/3.5.5
Build Identifier: 20090619-0625

Calling selectAll() from within a mouse down event handler does not select the whole content of a text control, if a tool tip was set for that control. Instead, only the text from caret position 0 up to the mouse pointer is selected. If no tool tip is set, everything works fine.
By the way, the tool tip only appears as long as you don't click into the text field. After doing so, the tool tip won't appear any more.

Reproducible: Always

Steps to Reproduce:
See attachment.
Comment 1 Benjamin Leipold CLA 2009-11-24 10:31:41 EST
Created attachment 152959 [details]
Reproducer for the described behavior.
Comment 2 Felipe Heidrich CLA 2009-11-24 10:45:18 EST
Why do you call selectAll() from mouse down ? Usually people call selectAll() from focus in.
Comment 3 Benjamin Leipold CLA 2009-11-25 03:56:53 EST
Because i have the same problem described as here: http://dev.eclipse.org/newslists/news.eclipse.platform.swt/msg14487.html.
Comment 4 Felipe Heidrich CLA 2009-11-25 09:27:15 EST
I see, you can use FocusIn+asyncExce instead of MouseDown. But neither works  well when the user hold button1 down for one or two second (or worse, moves the mouse).
To fix that you can use MouseUp, is that an option for you ?
Comment 5 Benjamin Leipold CLA 2009-11-26 09:14:00 EST
I will have a look at mouse up. But even if mouse up is an option for me, it is a bug, isn't it?
Comment 6 Felipe Heidrich CLA 2009-11-26 09:25:46 EST
(In reply to comment #5)
> I will have a look at mouse up. But even if mouse up is an option for me, 
> it is a bug, isn't it?

Not sure, note that the text without the tooltip also has the same problems, (click and hold the mouse down for a little longer and you will see it).

What your are trying to do is valid, and I'm trying to help you find the best implementation. At this point I'm not sure if calling selectAll() from MouseDown alone is the right answer.

Note the address bar in IE works the way you want and doesn't have any for the problems we have.
Comment 7 Benjamin Leipold CLA 2009-11-27 04:23:47 EST
I've tried MouseUp and it works well (every user must release the mouse button sometime ;-)). But, from the user's point of view, select all on a MouseDown event would be the more intuitional way.
Comment 8 Felipe Heidrich CLA 2009-11-30 10:48:08 EST
(In reply to comment #7)
> I've tried MouseUp and it works well (every user must release the mouse button
> sometime ;-)). But, from the user's point of view, select all on a MouseDown
> event would be the more intuitional way.

How does it look if you do it on both (mouse down and mouse up). Sorry that I'm just suggesting random ideas, I haven't had time to actually work on this problem.
Comment 9 Benjamin Leipold CLA 2009-12-16 03:05:44 EST
If i do it on both events, on mouse down only part of the text is selected and on mouse up all.
But there seems to be another problem. If all text is selected on mouse up, the tool tip is never shown again.
Comment 10 Eclipse Genie CLA 2020-03-25 05:17:49 EDT
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. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. 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.

--
The automated Eclipse Genie.