Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 357710 - Text#getCaretLocation() not implemented for SINGLE style
Summary: Text#getCaretLocation() not implemented for SINGLE style
Status: CLOSED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.8   Edit
Hardware: PC Mac OS X
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: George Cheng CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-14 20:02 EDT by Markus Keller CLA
Modified: 2019-11-14 03:42 EST (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Keller CLA 2011-09-14 20:02:08 EDT
HEAD

Text#getCaretLocation() is not implemented for SINGLE style Texts. It always returns {0, 0}.

Furthermore, the Javadoc of the method doesn't make sense. It should tell that the location is relative to this Text.
Comment 1 Felipe Heidrich CLA 2011-09-15 10:09:36 EDT
Silenio, do you know if this be fixed ?

maybe Lakshmi can investigate this...
Comment 2 Felipe Heidrich CLA 2011-09-15 10:18:50 EDT
I fixed the doc
http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=33702c0f14302d7231ea3f607b86a900e03829aa
Thank you for pointing that out, it has being wrong for ages. It looks like someone copied the javadoc from Control#getLocation() but didn't change the text propertly...
Comment 3 Silenio Quarti CLA 2011-09-20 18:00:19 EDT
George is fixing bug#44072. He will fix this one too.
Comment 4 George Cheng CLA 2011-09-21 09:26:11 EDT
(In reply to comment #3)
> George is fixing bug#44072. He will fix this one too.

The fix is included in the patch for Bug 44072.
Comment 5 Doug M CLA 2011-10-20 18:29:58 EDT
Just downloaded this week's 4.2 Stream Maintenance build. It's not fixed. But a TODO note has been added to fix.

Please SWT wizards - this deficiency is holding up my project.

While you are at it, the corresponding setCaretLocation is missing. You can get the equivalent in StyledText with setCaretOffset(getCaretOffset(point)). But there's no way to set the caret location for Text.
Comment 6 Doug M CLA 2011-10-20 18:37:47 EDT
(In reply to comment #5)
> Just downloaded this week's 4.2 Stream Maintenance build. It's not fixed. But a
> TODO note has been added to fix.
> 
> Please SWT wizards - this deficiency is holding up my project.
> 
> While you are at it, the corresponding setCaretLocation is missing. You can get
> the equivalent in StyledText with setCaretOffset(getCaretOffset(point)). But
> there's no way to set the caret location for Text.

Whoops that should be getOffsetAtLocation(point).
Comment 7 Lars Vogel CLA 2019-11-14 03:42:15 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.