contributed vertical ruler as selection provider (IStructeredSelection) [message #462171] |
Wed, 24 January 2007 08:13 |
Eclipse User |
|
|
|
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 (IStructuredSelection) [message #462178 is a reply to message #462174] |
Wed, 24 January 2007 10:30 |
Eclipse User |
|
|
|
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 |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.04720 seconds