Bug 271333 - Allow to set caret on right-click in StyledText
Summary: Allow to set caret on right-click in StyledText
Status: CLOSED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.5   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Abhishek Kishore CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks: 19825
  Show dependency tree
 
Reported: 2009-04-06 11:26 EDT by Dani Megert CLA
Modified: 2019-11-27 07:06 EST (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dani Megert CLA 2009-04-06 11:26:21 EDT
I20090331-0901.

See bug 19825 for a longer discussion. We now agree that this should be a user preference.

While we can implement this on top of StyledText it would be beneficial if SWT would offer a global switch for this, so that this behaves consistent in the whole workbench. Otherwise it will work in editors but e.g. not in the Console (until they also react and adopt a new preference).

If a global switch is rejected then at least API on StyledText to control this would be beneficial.
Comment 1 Felipe Heidrich CLA 2009-04-06 15:13:34 EDT
I think you should implement it on top of StyledText.

The global switch can not work 100% of the time. All it needs to break is one plugin that has one editor that is not based on StyledText, or one plugin that has a styledtext based editor, but forgets to set the option on it...
Comment 2 Steve Northover CLA 2009-04-06 15:26:19 EDT
The right place for the API is in SWT, on a per-StyledText basis.  The argument that says "... all it takes is one ..." applies equally, whether the functionality is implemented on top or withing SWT.

We are past API freeze and this bug looks low priority to me.  Post 3.5?
Comment 3 Dani Megert CLA 2009-04-07 02:17:53 EDT
>bug looks low priority to me.  Post 3.5?
Sure, I wasn't assuming to get new API after the freeze.

>but forgets to set the option on it...
Right, that's why my preferred solution is a global option. Look at it like e.g. OS settings for colors or time formatting that we take over and apply.

Another reason why I would like to see this in SWT is that this behavior is quite low level and if we do it on top of SWT as you suggest, then all clients that do not or cannot use the editor framework will have to copy the code and I hate to see copied code.
Comment 4 Steve Northover CLA 2009-04-07 10:29:05 EDT
> Right, that's why my preferred solution is a global option. 

We would never add a global option without allow an instance to override the behaviot.

> editor framework will have to copy the code 

It depends on the application.  Only those frameworks that want this non-standard native text editor behavior would "have" to copy the code.
Comment 5 Dani Megert CLA 2009-04-07 10:34:28 EDT
>non-standard native text editor behavior 
What standard? Different editors on different OSs handle the right-click case differently. From example on Linux gedit does set the caret on right-click but StyledText does not.
Comment 6 Steve Northover CLA 2009-04-07 10:50:19 EDT
... and that is the correct behavior.  

For fun, I tried it out on Windows, GTK and Mac carbon and no native text editor moves the caret.  On my system, gedit doesn't do it either.  Perhaps we are talking about something different?

My point:  The attitude that says "applications will have to copy the code" is flawed.  If Eclipse decides to enforce a policy that "right click will move the caret", then this is an Eclipse policy, not an operating system or SWT policy.  Those applications that want "Eclipse style right clicking" would have to "copy the code", if they insisted on having this policy and we don't provide support for them (which we will).
Comment 7 Dani Megert CLA 2009-04-07 10:59:28 EDT
>My point:  The attitude that says "applications will have to copy the code" is
>flawed.
Right, but I didn't think of other applications but e.g. the Console view in Eclipse or the Commit dialog, or.... essentially all parts that use StyledText but aren't an editor. If we add a preference and a user chooses that he likes to move the caret on right-click, he'd probably also want this in those places.

>On my system, gedit doesn't do it either. 
That's funny. I didn't touch that Linux box and it's quite old, so not sure whether this is a setting that someone tweaked.
Comment 8 Abhishek Kishore CLA 2014-06-04 02:49:47 EDT
Is there a conclusion on what we want to do here? A global API(per-Shell?), or per-StyledText?
I'm assuming we're still interested in this.
Comment 9 Dani Megert CLA 2014-06-04 16:22:00 EDT
(In reply to Abhishek Kishore from comment #8)
> Is there a conclusion on what we want to do here? A global API(per-Shell?),
> or per-StyledText?

Just a state per StyledText instance.

> I'm assuming we're still interested in this.

This is low priority.
Comment 10 Lars Vogel CLA 2019-11-27 07:06:31 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.