Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » SourceViewer and Document
SourceViewer and Document [message #452790] Fri, 14 July 2006 22:02 Go to next message
Eclipse UserFriend
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 #452816 is a reply to message #452790] Mon, 17 July 2006 09:17 Go to previous messageGo to next message
Tom Eicher is currently offline Tom EicherFriend
Messages: 11
Registered: July 2009
Junior Member
Florian Wendland wrote:
> Does anyone know, how to move the cursor explicit in SWT?

@see StyledText::setSelection(int)

-tom
Re: SourceViewer and Document [message #452937 is a reply to message #452816] Wed, 19 July 2006 09:18 Go to previous messageGo to next message
Eclipse UserFriend
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 #452940 is a reply to message #452937] Wed, 19 July 2006 09:49 Go to previous messageGo to next message
Dani Megert is currently offline Dani MegertFriend
Messages: 3802
Registered: July 2009
Senior Member
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
>>
>>
>
>
>
>
Re: SourceViewer and Document [message #452995 is a reply to message #452940] Wed, 19 July 2006 14:40 Go to previous message
Eclipse UserFriend
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
> >>
> >>
> >
> >
> >
> >
Previous Topic:registry editor
Next Topic:Exception in RCP application
Goto Forum:
  


Current Time: Sun Dec 22 05:33:42 GMT 2024

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

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

Back to the top