[prev in list] [next in list] [prev in thread] [next in thread] 

List:       jedit-devel
Subject:    [ jEdit-devel ] [jedit:patches] #568 Consolidate mouse input handler of JEditTextArea and JEditEmbed
From:       Matthieu Casanova via jEdit-devel <jedit-devel () lists ! sourceforge ! net>
Date:       2020-03-28 16:33:57
Message-ID: /p/jedit/patches/568/ef2590cb1df76b279cddc198109a4d9f428a5158.patches () jedit ! p ! sourceforge ! net
[Download RAW message or body]

[Attachment #2 (multipart/related)]


--===============7350634363692708367==
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit

- **status**: open --> pending
- **Comment**:

Hey, sorry it's really late, but it seems Vampire01 did a commit last year that seems \
to match your needs. Is that patch still useful ?



---

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

**Status:** pending
**Group:** 
**Created:** Fri Aug 28, 2015 07:41 PM UTC by Rafal Kolanski
**Last Updated:** Mon Nov 21, 2016 04:38 PM UTC
**Owner:** Matthieu Casanova
**Attachments:**

- [jedit-svn_textarea_mousehandler_consolidate.patch](https://sourceforge.net/p/jedit/patches/568/attachment/jedit-svn_textarea_mousehandler_consolidate.patch) \
(7.4 kB; text/x-patch)


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 jedit-devel@lists.sourceforge.net 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.
--===============7350634363692708367==
MIME-Version: 1.0
Content-Type: text/html; charset="us-ascii"
Content-Transfer-Encoding: 7bit

<div class="markdown_content"><ul>
<li><strong>status</strong>: open --&gt; pending</li>
<li><strong>Comment</strong>:</li>
</ul>
<p>Hey, sorry it's really late, but it seems Vampire01 did a commit last year that \
seems to match your needs. Is that patch still useful ?</p> <hr/>
<p><strong> <a class="alink" \
href="https://sourceforge.net/p/jedit/patches/568/">[patches:#568]</a> Consolidate \
mouse input handler of JEditTextArea and JEditEmbeddedTextArea</strong></p> \
<p><strong>Status:</strong> pending<br/> <strong>Group:</strong> <br/>
<strong>Created:</strong> Fri Aug 28, 2015 07:41 PM UTC by Rafal Kolanski<br/>
<strong>Last Updated:</strong> Mon Nov 21, 2016 04:38 PM UTC<br/>
<strong>Owner:</strong> Matthieu Casanova<br/>
<strong>Attachments:</strong></p>
<ul>
<li><a class="" href="https://sourceforge.net/p/jedit/patches/568/attachment/jedit-svn \
_textarea_mousehandler_consolidate.patch">jedit-svn_textarea_mousehandler_consolidate.patch</a> \
(7.4 kB; text/x-patch)</li> </ul>
<p>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.</p> <p>JEdit code instructs plugin authors to use \
JEditEmbeddedTextArea<br/> (superclass: TextArea). For the main text area, JEdit \
uses<br/> JEditTextArea (superclass: TextArea).</p>
<p>JEditEmbeddedTextArea uses TextAreaMouseHandler for its mouse setup.<br/>
JEditTextArea uses MouseHandler (superclass: TextAreaMouseHandler)for<br/>
its mouse setup.</p>
<p>Now here's where it goes wrong: someone in the distant past<br/>
(pre-2012 where the svn history ends) added the mouse copy-paste<br/>
functionality, but only added it in MouseHandler. In fact, as it stands<br/>
TextAreaMouseHandler's mouseClicked and mouseReleased are just outdated<br/>
versions of those in MouseHandler. They are nearly identical, except for<br/>
the copy-paste functionality and some better error checking.</p>
<p>The attached patch updates the TextAreaMouseHandler mouseClicked and<br/>
mouseReleased actions to contain all the updated functionality of<br/>
MouseHandler, making embedded text areas behave like the main text area<br/>
for all mouse selection purposes.<br/>
I did leave one difference in: embedded text areas don't send out<br/>
anything on the EditBus by default. That should be up to the plugin<br/>
authors to do.</p>
<p>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.</p> <hr/>
<p>Sent from sourceforge.net because jedit-devel@lists.sourceforge.net is subscribed \
to <a href="https://sourceforge.net/p/jedit/patches/">https://sourceforge.net/p/jedit/patches/</a></p>
 <p>To unsubscribe from further messages, a project admin can change settings at <a \
href="https://sourceforge.net/p/jedit/admin/patches/options.">https://sourceforge.net/p/jedit/admin/patches/options.</a> \
                Or, if this is a mailing list, you can unsubscribe from the mailing \
                list.</p></div>
--===============7350634363692708367==--





-- 
-----------------------------------------------
jEdit Developers' List
jEdit-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jedit-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic