SourceViewer and Document [message #452790] |
Fri, 14 July 2006 22:02 |
Eclipse User |
|
|
|
Originally posted by: florianwendland.freenet.de
Hello all,
i'm new in RCP programming and i've got a simple problem, imho.
I want to maipulate the SourceViewer by turning VerifyEvent.doit to false.
After that, i delegate a String to a method, which should insert the string
into the SourceViewer or Document. But after that, the Cursos still hooks on
his old position.
For example:
After inserting an 'a' into the following text: "Hello" at the end of the
word. It looks like "Helloa". But the Cursor remains between the 'o' and
'a', so that it is not possible to write a normal text.
Does anyone know, how to move the cursor explicit in SWT?
Thanks for all
Florian
|
|
|
|
Re: SourceViewer and Document [message #452937 is a reply to message #452816] |
Wed, 19 July 2006 09:18 |
Eclipse User |
|
|
|
Originally posted by: florianwendland.freenet.de
Well Tom, thanks for this hint,
but I try to manipulate the Caret in a SourceViewer, not in a
StyledText-Widget.
Any ideas?
"Tom Eicher" <tom_eicher@ch.ibm.com> schrieb im Newsbeitrag
news:e9fkjr$2cm$1@utils.eclipse.org...
> Florian Wendland wrote:
> > Does anyone know, how to move the cursor explicit in SWT?
>
> @see StyledText::setSelection(int)
>
> -tom
|
|
|
|
Re: SourceViewer and Document [message #452995 is a reply to message #452940] |
Wed, 19 July 2006 14:40 |
Eclipse User |
|
|
|
Originally posted by: florianwendland.freenet.de
Oh, okay, that is really as simple as possible...
I didn't expect, that a SytledText-Widget is the base of a SourceViewer...
Very easy. Thx
"Daniel Megert" <daniel_megert@ch.ibm.com> schrieb im Newsbeitrag
news:e9kv7d$gl7$1@utils.eclipse.org...
> Florian Wendland wrote:
>
> >Well Tom, thanks for this hint,
> >but I try to manipulate the Caret in a SourceViewer, not in a
> >StyledText-Widget.
> >
> >
> Well, TextViewer and SourceViewer are not SWT but you explicitly asked
> for an SWT solution:
> >Does anyone know, how to move the cursor explicit in SWT?
>
> >Any ideas?
> >
> >
> You might want to take a look at IAutoEditStrategy and DocumentCommand.
> If this does not fit your needs then simply use:
> yourViewer.getTextWidget().setCaretOffset(widgetCaret)
>
> Dani
>
> >
> >"Tom Eicher" <tom_eicher@ch.ibm.com> schrieb im Newsbeitrag
> >news:e9fkjr$2cm$1@utils.eclipse.org...
> >
> >
> >>Florian Wendland wrote:
> >>
> >>
> >>>Does anyone know, how to move the cursor explicit in SWT?
> >>>
> >>>
> >>@see StyledText::setSelection(int)
> >>
> >>-tom
> >>
> >>
> >
> >
> >
> >
|
|
|
Powered by
FUDForum. Page generated in 0.03515 seconds