Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » contributed vertical ruler as selection provider (IStructeredSelection)
contributed vertical ruler as selection provider (IStructeredSelection) [message #462171] Wed, 24 January 2007 08:13 Go to next message
Eclipse UserFriend
Originally posted by: hkaest.mro.man.de

Hi,

i contribute existing editors (AbstractDecoratedTextEditor) with an
additional vertical ruler (new extension point in 3.3M3). In this ruler i
want to make selections of the type IStructeredSelection. But i know that
there is only one selection provider possible per editor site and changing
the selection provider is not supported well (see eclipse corner article).

Is there any way to fire selection change events out of my vertical ruler?
Is there maybe an intermediate provider i could use?

Thanks in advance
Harald
Re: contributed vertical ruler as selection provider (IStructeredSelection) [message #462174 is a reply to message #462171] Wed, 24 January 2007 09:15 Go to previous messageGo to next message
Dani Megert is currently offline Dani MegertFriend
Messages: 3802
Registered: July 2009
Senior Member
Harald Kaestel-Baumgartner wrote:

>Hi,
>
>i contribute existing editors (AbstractDecoratedTextEditor) with an
>additional vertical ruler (new extension point in 3.3M3). In this ruler i
>want to make selections of the type IStructeredSelection. But i know that
>there is only one selection provider possible per editor site and changing
>the selection provider is not supported well (see eclipse corner article).
>
>Is there any way to fire selection change events out of my vertical ruler?
>Is there maybe an intermediate provider i could use?
>
>
Let me first start with this: If the selection you send out doesn't
match with the one in the editor you will most likely run into troubles.
Now, what could work (with a little performance impact) is to resend the
same selection that is currently in the editor but with your own
selection object that inherits from IStructuredSelection and
ITextSelection. This new selection can be sent via setSelection(...) of
the editor site's selection provider.

HTH
Dani

>Thanks in advance
>Harald
>
>
>
>
>
Re: contributed vertical ruler as selection provider (IStructuredSelection) [message #462178 is a reply to message #462174] Wed, 24 January 2007 10:30 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: hkaest.mro.man.de

"Daniel Megert" wrote:
....
>>Is there any way to fire selection change events out of my vertical ruler?
>>Is there maybe an intermediate provider i could use?
....
> Let me first start with this: If the selection you send out doesn't match
> with the one in the editor you will most likely run into troubles. Now,
> what could work (with a little performance impact) is to resend the same
> selection that is currently in the editor but with your own selection
> object that inherits from IStructuredSelection and ITextSelection.

A smart solution. I will try this.

Thanks
Harald

> This new selection can be sent via setSelection(...) of the editor site's
> selection provider.
>
Re: contributed vertical ruler as selection provider (IStructeredSelection) [message #462261 is a reply to message #462174] Thu, 25 January 2007 13:26 Go to previous message
Eclipse UserFriend
Originally posted by: hkaest.mro.man.de

"Daniel Megert" wrote:

>>i contribute existing editors (AbstractDecoratedTextEditor) with an
>>additional vertical ruler (new extension point in 3.3M3). In this ruler i
>>want to make selections of the type IStructeredSelection. But i know that
>>there is only one selection provider possible per editor site and changing
>>the selection provider is not supported well (see eclipse corner article).
>>
>>Is there any way to fire selection change events out of my vertical ruler?
>>Is there maybe an intermediate provider i could use?
>>
> Let me first start with this: If the selection you send out doesn't match
> with the one in the editor you will most likely run into troubles. Now,
> what could work (with a little performance impact) is to resend the same
> selection that is currently in the editor but with your own selection
> object that inherits from IStructuredSelection and ITextSelection. This
> new selection can be sent via setSelection(...) of the editor site's
> selection provider.
>

It doesn't work.

Unfortunatly the text viewer as the selection provider doesn't fire an
selection changed event with the given Selection in setSelection(.). It uses
only the offset and length of the given selection to create a new
ITextSelection event object. My selection object get lost in the
TextViewer of the editor.

-- Harald
Previous Topic:Reclaim memory shell.setMinimized(true)..?
Next Topic:Removing a open Perspective Action
Goto Forum:
  


Current Time: Thu Sep 12 13:27:56 GMT 2024

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

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

Back to the top