Catching key pressing [message #458875] |
Mon, 25 July 2005 10:11  |
Eclipse User |
|
|
|
Hello. Please, tell me, how can I catch Enter key pressing in my
TextEditor class? I'm try to add auto indent to my editor.
|
|
|
|
|
Re: Catching key pressing [message #458925 is a reply to message #458910] |
Tue, 26 July 2005 13:05  |
Eclipse User |
|
|
|
Originally posted by: sunil_kamath.nohotspammail.com
"Alex" <rashevsky@gmail.com> wrote in message
news:bc7296c2153a2994745037ace78c6597$1@www.eclipse.org...
> Tnx.
> So, I wrote XMLAutoIndentStrategy class, register it in the
> XMLSourceViewerConfiguration class:
> public IAutoIndentStrategy getAutoIndentStrategy(ISourceViewer
> sourceViewer,
> String contentType)
> {
> return new
> XMLAutoIndentStrategy(UIPlugin.getDefault().getPreferenceSto re());
> }
>
> Then, I set configuration in the Editor class:
> setSourceViewerConfiguration(new XMLConfiguration(colorManager));
>
> But when I press "Enter" key method
> XMLAutoIndentStrategy.customizeDocumentCommand does'n calls...
>
> Sorry for my english...
>
Have you set up document partitioning?
Without document partitioning, auto indent will not work.
If you have, then all I can recommend is debugging to make sure your auto
indent strategy is being installed, and then check what happens when a key
is pressed on the editor styledtext widget.
---
Sunil
|
|
|
Powered by
FUDForum. Page generated in 0.25934 seconds