Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Attaching KeyListener (or some such) to AbstractTextEditor
Attaching KeyListener (or some such) to AbstractTextEditor [message #280074] Fri, 28 January 2005 05:42 Go to next message
Eclipse UserFriend
Originally posted by: iwan.global.co.za

Hello,

I need a way to intercept each key press (or change in the unsaved text of
the editor) in a subclass of AbstractTextEditor.

Any pointers as to how I can do that?

Context: I have an editor that edits a string buffer, and I do not want to
save in the editor in order to update the string buffer - I want to keep
the buffer in synch with the unsaved buffer in the editor.

Thanks
-i
Re: Attaching KeyListener (or some such) to AbstractTextEditor [message #280083 is a reply to message #280074] Fri, 28 January 2005 09:31 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: daniel.megert.gmx.net

Iwan Vosloo wrote:

> Hello,
>
> I need a way to intercept each key press (or change in the unsaved
> text of the editor) in a subclass of AbstractTextEditor.
>
> Any pointers as to how I can do that?
>
> Context: I have an editor that edits a string buffer, and I do not
> want to save in the editor in order to update the string buffer - I
> want to keep the buffer in synch with the unsaved buffer in the editor.

You mean you want to keep the buffer up to date while typing?

Dani

>
> Thanks
> -i
>
Re: Attaching KeyListener (or some such) to AbstractTextEditor [message #280116 is a reply to message #280083] Sat, 29 January 2005 05:54 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: iwan.global.co.za

Daniel Megert wrote:

>> Context: I have an editor that edits a string buffer, and I do not
>> want to save in the editor in order to update the string buffer - I
>> want to keep the buffer in synch with the unsaved buffer in the editor.

> You mean you want to keep the buffer up to date while typing?
> Dani

Yes, exactly.

-i
Re: Attaching KeyListener (or some such) to AbstractTextEditor [message #280156 is a reply to message #280116] Mon, 31 January 2005 09:31 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: daniel.megert.gmx.net

Iwan Vosloo wrote:

> Daniel Megert wrote:
>
>>> Context: I have an editor that edits a string buffer, and I do not
>>> want to save in the editor in order to update the string buffer - I
>>> want to keep the buffer in synch with the unsaved buffer in the editor.
>>
>
>> You mean you want to keep the buffer up to date while typing?
>> Dani
>
>
> Yes, exactly.

If you type the underlying document / buffer gets updated automatically.

Dani

>
> -i
>
Re: Attaching KeyListener (or some such) to AbstractTextEditor [message #280204 is a reply to message #280156] Mon, 31 January 2005 18:03 Go to previous message
Eclipse UserFriend
Originally posted by: Chris_Laffra.ca.ibm.com

See org.eclipse.swt.custom.StyledText.modifyContent

If you register a document listener you will be called when the document
changes.

See
org.eclipse.jface.text.presentation.PresentationReconciler$I nternalListener.
documentChanged
for an example.

--
Chris Laffra, http://eclipsefaq.org


"Daniel Megert" <daniel.megert@gmx.net> wrote in message
news:ctlfff$k4$1@www.eclipse.org...
> Iwan Vosloo wrote:
>
> > Daniel Megert wrote:
> >
> >>> Context: I have an editor that edits a string buffer, and I do not
> >>> want to save in the editor in order to update the string buffer - I
> >>> want to keep the buffer in synch with the unsaved buffer in the
editor.
> >>
> >
> >> You mean you want to keep the buffer up to date while typing?
> >> Dani
> >
> >
> > Yes, exactly.
>
> If you type the underlying document / buffer gets updated automatically.
>
> Dani
>
> >
> > -i
> >
Previous Topic:javax.comm, commapi, serial ports within eclipse
Next Topic:[ANN] The Java Developer's Guide to Eclipse: CD-ROM preview at www.jdg2e.com
Goto Forum:
  


Current Time: Tue May 06 13:46:04 EDT 2025

Powered by FUDForum. Page generated in 0.05761 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top