[ jEdit-devel ] [jedit:patches] #568 Consolidate mouse input handler of JEditTextArea and JEditEmbeddedTextArea

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[ jEdit-devel ] [jedit:patches] #568 Consolidate mouse input handler of JEditTextArea and JEditEmbeddedTextArea

Rafal Kolanski

[patches:#568] Consolidate mouse input handler of JEditTextArea and JEditEmbeddedTextArea

Status: open
Group:
Created: Fri Aug 28, 2015 07:41 PM UTC by Rafal Kolanski
Last Updated: Fri Aug 28, 2015 07:41 PM UTC
Owner: nobody
Attachments:

Issue: Cannot copy with mouse from JEditEmbeddedText area into '%' register, but can with JEditTextArea. For the Isabelle plugin, this means copying of goals from the prover output is inconvenient.

JEdit code instructs plugin authors to use JEditEmbeddedTextArea
(superclass: TextArea). For the main text area, JEdit uses
JEditTextArea (superclass: TextArea).

JEditEmbeddedTextArea uses TextAreaMouseHandler for its mouse setup.
JEditTextArea uses MouseHandler (superclass: TextAreaMouseHandler)for
its mouse setup.

Now here's where it goes wrong: someone in the distant past
(pre-2012 where the svn history ends) added the mouse copy-paste
functionality, but only added it in MouseHandler. In fact, as it stands
TextAreaMouseHandler's mouseClicked and mouseReleased are just outdated
versions of those in MouseHandler. They are nearly identical, except for
the copy-paste functionality and some better error checking.

The attached patch updates the TextAreaMouseHandler mouseClicked and
mouseReleased actions to contain all the updated functionality of
MouseHandler, making embedded text areas behave like the main text area
for all mouse selection purposes.
I did leave one difference in: embedded text areas don't send out
anything on the EditBus by default. That should be up to the plugin
authors to do.

General observation: JEditEmbeddedTextArea appears to be a second-class citizen. If you use it in your plugin, even if you enable the caret and set the buffer to writeable, pressing the keybinding for "next-char" will send that message to the last focused text area that has an edit pane (as per the beanshell code that gets executed). Consider if the register viewer used JEditEmbeddedTextArea for its register values editor: you couldn't scroll with your cursor keys, copy/paste/etc. That leaves people using JEditEmbeddedTextArea for their plugins having to guess at and implement their own key bindings, e.g. ctrl+c to copy, even if someone rebound that for the rest of JEdit.


Sent from sourceforge.net because [hidden email] is subscribed to https://sourceforge.net/p/jedit/patches/

To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/jedit/admin/patches/options. Or, if this is a mailing list, you can unsubscribe from the mailing list.


------------------------------------------------------------------------------

--
-----------------------------------------------
jEdit Developers' List
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jedit-devel
Reply | Threaded
Open this post in threaded view
|

[ jEdit-devel ] [jedit:patches] #568 Consolidate mouse input handler of JEditTextArea and JEditEmbeddedTextArea

Alan Ezust-2
  • assigned_to: Matthieu Casanova
  • Group: -->

[patches:#568] Consolidate mouse input handler of JEditTextArea and JEditEmbeddedTextArea

Status: open
Group:
Created: Fri Aug 28, 2015 07:41 PM UTC by Rafal Kolanski
Last Updated: Fri Aug 28, 2015 07:41 PM UTC
Owner: Matthieu Casanova
Attachments:

Issue: Cannot copy with mouse from JEditEmbeddedText area into '%' register, but can with JEditTextArea. For the Isabelle plugin, this means copying of goals from the prover output is inconvenient.

JEdit code instructs plugin authors to use JEditEmbeddedTextArea
(superclass: TextArea). For the main text area, JEdit uses
JEditTextArea (superclass: TextArea).

JEditEmbeddedTextArea uses TextAreaMouseHandler for its mouse setup.
JEditTextArea uses MouseHandler (superclass: TextAreaMouseHandler)for
its mouse setup.

Now here's where it goes wrong: someone in the distant past
(pre-2012 where the svn history ends) added the mouse copy-paste
functionality, but only added it in MouseHandler. In fact, as it stands
TextAreaMouseHandler's mouseClicked and mouseReleased are just outdated
versions of those in MouseHandler. They are nearly identical, except for
the copy-paste functionality and some better error checking.

The attached patch updates the TextAreaMouseHandler mouseClicked and
mouseReleased actions to contain all the updated functionality of
MouseHandler, making embedded text areas behave like the main text area
for all mouse selection purposes.
I did leave one difference in: embedded text areas don't send out
anything on the EditBus by default. That should be up to the plugin
authors to do.

General observation: JEditEmbeddedTextArea appears to be a second-class citizen. If you use it in your plugin, even if you enable the caret and set the buffer to writeable, pressing the keybinding for "next-char" will send that message to the last focused text area that has an edit pane (as per the beanshell code that gets executed). Consider if the register viewer used JEditEmbeddedTextArea for its register values editor: you couldn't scroll with your cursor keys, copy/paste/etc. That leaves people using JEditEmbeddedTextArea for their plugins having to guess at and implement their own key bindings, e.g. ctrl+c to copy, even if someone rebound that for the rest of JEdit.


Sent from sourceforge.net because [hidden email] is subscribed to https://sourceforge.net/p/jedit/patches/

To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/jedit/admin/patches/options. Or, if this is a mailing list, you can unsubscribe from the mailing list.


------------------------------------------------------------------------------
Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
--
-----------------------------------------------
jEdit Developers' List
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jedit-devel
Reply | Threaded
Open this post in threaded view
|

[ jEdit-devel ] [jedit:patches] #568 Consolidate mouse input handler of JEditTextArea and JEditEmbeddedTextArea

Rafal Kolanski
In reply to this post by Rafal Kolanski

Given that is has been over a year and I'm still happily using this patch. Currently it's rebased onto the version I'm using (r24302), but I can rebase again without too many issues. Would feel more comfortable updating this if given any feedback whatsoever.


[patches:#568] Consolidate mouse input handler of JEditTextArea and JEditEmbeddedTextArea

Status: open
Group:
Created: Fri Aug 28, 2015 07:41 PM UTC by Rafal Kolanski
Last Updated: Sun Jul 10, 2016 07:49 PM UTC
Owner: Matthieu Casanova
Attachments:

Issue: Cannot copy with mouse from JEditEmbeddedText area into '%' register, but can with JEditTextArea. For the Isabelle plugin, this means copying of goals from the prover output is inconvenient.

JEdit code instructs plugin authors to use JEditEmbeddedTextArea
(superclass: TextArea). For the main text area, JEdit uses
JEditTextArea (superclass: TextArea).

JEditEmbeddedTextArea uses TextAreaMouseHandler for its mouse setup.
JEditTextArea uses MouseHandler (superclass: TextAreaMouseHandler)for
its mouse setup.

Now here's where it goes wrong: someone in the distant past
(pre-2012 where the svn history ends) added the mouse copy-paste
functionality, but only added it in MouseHandler. In fact, as it stands
TextAreaMouseHandler's mouseClicked and mouseReleased are just outdated
versions of those in MouseHandler. They are nearly identical, except for
the copy-paste functionality and some better error checking.

The attached patch updates the TextAreaMouseHandler mouseClicked and
mouseReleased actions to contain all the updated functionality of
MouseHandler, making embedded text areas behave like the main text area
for all mouse selection purposes.
I did leave one difference in: embedded text areas don't send out
anything on the EditBus by default. That should be up to the plugin
authors to do.

General observation: JEditEmbeddedTextArea appears to be a second-class citizen. If you use it in your plugin, even if you enable the caret and set the buffer to writeable, pressing the keybinding for "next-char" will send that message to the last focused text area that has an edit pane (as per the beanshell code that gets executed). Consider if the register viewer used JEditEmbeddedTextArea for its register values editor: you couldn't scroll with your cursor keys, copy/paste/etc. That leaves people using JEditEmbeddedTextArea for their plugins having to guess at and implement their own key bindings, e.g. ctrl+c to copy, even if someone rebound that for the rest of JEdit.


Sent from sourceforge.net because [hidden email] is subscribed to https://sourceforge.net/p/jedit/patches/

To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/jedit/admin/patches/options. Or, if this is a mailing list, you can unsubscribe from the mailing list.


------------------------------------------------------------------------------

--
-----------------------------------------------
jEdit Developers' List
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jedit-devel