Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » JFace » TextViewer and revealRange
TextViewer and revealRange [message #24028] Sat, 25 July 2009 01:01 Go to next message
Kai Schlamp is currently offline Kai SchlampFriend
Messages: 344
Registered: July 2009
Senior Member
Hello.

I want to make a selection in a text viewer visible. The selection itself works fine, but the reveal
not.

I set up my text viewer with textViewer = new TextViewer(form.getBody(), SWT.WRAP | SWT.V_SCROLL);
and then just call textViewer().revealRange(600, 5); (the text has more than 3000 chars), but
nothing happen. I want that the viewer automatically scrolls to that 600 offset.
Do I need to do something further to accomplish that?

Regards,
Kai
Re: TextViewer and revealRange [message #24059 is a reply to message #24028] Sat, 25 July 2009 01:16 Go to previous message
Kai Schlamp is currently offline Kai SchlampFriend
Messages: 344
Registered: July 2009
Senior Member
My text consists of two lines (one line break), but is quite long and is wrapped multiple times by
the text widget. If I try to reveal a range in the first line everything works fine. If I try to
reveal a range in the second it fails. Maybe because the revealRange of the TextViewer doesn't pay
attention to wrapped only lines?

Kai Schlamp wrote:
> Hello.
>
> I want to make a selection in a text viewer visible. The selection
> itself works fine, but the reveal not.
>
> I set up my text viewer with textViewer = new TextViewer(form.getBody(),
> SWT.WRAP | SWT.V_SCROLL);
> and then just call textViewer().revealRange(600, 5); (the text has more
> than 3000 chars), but nothing happen. I want that the viewer
> automatically scrolls to that 600 offset.
> Do I need to do something further to accomplish that?
>
> Regards,
> Kai
Previous Topic:CheckboxTreeViewer - correct CellEditor and Checkbox only at root elements?
Next Topic:TableViewer and native looking widgets
Goto Forum:
  


Current Time: Thu Apr 25 10:44:42 GMT 2024

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

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

Back to the top