Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » KeyListener
KeyListener [message #185462] Tue, 27 January 2004 15:21 Go to next message
Eclipse UserFriend
Originally posted by: mckeoghjohn.hotmail.com

Hi,

Does anyone know how to add a KeyListener to an
AbstractTextEditor or is there another level where
it can be done?

Thanks,
John.
Re: KeyListener [message #185490 is a reply to message #185462] Tue, 27 January 2004 15:55 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: daniel.megert.gmx.net

john mckeogh wrote:

>Hi,
>
>Does anyone know how to add a KeyListener to an
>AbstractTextEditor or is there another level where
>it can be done?
>
>
You can append it to its viewer (see ITextViewerExtension for more info)
but this is only possible inside a subclass i.e. it's not public.

Dani

>Thanks,
>John.
>
>
>
Re: KeyListener [message #185506 is a reply to message #185490] Tue, 27 January 2004 16:06 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mckeoghjohn.hotmail.com

Daniel Megert wrote:

> john mckeogh wrote:

> >Hi,
> >
> >Does anyone know how to add a KeyListener to an
> >AbstractTextEditor or is there another level where
> >it can be done?
> >
> >
> You can append it to its viewer (see ITextViewerExtension for more info)
> but this is only possible inside a subclass i.e. it's not public.

> Dani

> >Thanks,
> >John.
> >
> >
> >

Thanks Dani,
I got an AbstractTextEditor with the following code:

theEd =(AbstractTextEditor) window.getActivePage().getActiveEditor();

I tried to get the viewer but it keeps coming up null.
theViewer = (ITextViewer)
window.getActivePage().getActivePart().getAdapter(ITextViewe r.class);

Am I doing something wrong.
Your help is greatly appreciated.

Thanks again,
John.
Re: KeyListener [message #185592 is a reply to message #185506] Tue, 27 January 2004 18:00 Go to previous message
Eclipse UserFriend
Originally posted by: daniel.megert.gmx.net

John McKeogh wrote:

>Daniel Megert wrote:
>
>
>
>>john mckeogh wrote:
>>
>>
>
>
>
>>>Hi,
>>>
>>>Does anyone know how to add a KeyListener to an
>>>AbstractTextEditor or is there another level where
>>>it can be done?
>>>
>>>
>>>
>>>
>>You can append it to its viewer (see ITextViewerExtension for more info)
>>but this is only possible inside a subclass i.e. it's not public.
>>
>>
>
>
>
>>Dani
>>
>>
>
>
>
>>>Thanks,
>>>John.
>>>
>>>
>>>
>>>
>>>
>
>Thanks Dani,
>I got an AbstractTextEditor with the following code:
>
> theEd =(AbstractTextEditor) window.getActivePage().getActiveEditor();
>
>I tried to get the viewer but it keeps coming up null.
>theViewer = (ITextViewer)
> window.getActivePage().getActivePart().getAdapter(ITextViewe r.class);
>
>Am I doing something wrong.
>
>
Yes ;-)
As said before, you can only do this inside subclasses of
AbstractTextEditor, e.g. in your own editor. You cannot do this from
outside.

Dani

>Your help is greatly appreciated.
>
>Thanks again,
>John.
>
>
>
Previous Topic:Java Editor & Non- .java file extensions
Next Topic:Problems Debugging GUI Application.
Goto Forum:
  


Current Time: Wed Jul 24 13:15:53 GMT 2024

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

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

Back to the top