Editor and Outline view integration [message #331656] |
Mon, 15 September 2008 18:38  |
Eclipse User |
|
|
|
Hi All,
I'm trying to implement the simple feature that when you select a item in
your Outline View that corresponding source code in the editor is
highlighted. I see that it has something to do with IShowInSource but
there is virtually no documentation on how to use it (at least I can't
find it). I basically want to implement:
"You will want to update the selection in your Outline view when the
cursor is moved in the editor. Similarly, if the structure of the program
changedcode added or removedthe outline has to be updated. This is
typically performed with a JFace text model reconciler.
When the user selects a node in the Outline view, the editor should change
selection to the selected element and make it visible."
http://wiki.eclipse.org/FAQ_How_do_I_create_an_Outline_view_ for_my_own_language_editor%3F
But it is not obvious at all how to do it. Any help will be great.
Nikola
|
|
|
Re: Editor and Outline view integration [message #331669 is a reply to message #331656] |
Tue, 16 September 2008 07:33   |
Eclipse User |
|
|
|
Nikola Borisov wrote:
> Hi All,
>
> I'm trying to implement the simple feature that when you select a item
> in your Outline View that corresponding source code in the editor is
> highlighted. I see that it has something to do with IShowInSource
Nope, it does not.
> but there is virtually no documentation on how to use it (at least I
> can't find it). I basically want to implement:
>
> "You will want to update the selection in your Outline view when the
> cursor is moved in the editor. Similarly, if the structure of the
> program changed�code added or removed�the outline has to be updated.
> This is typically performed with a JFace text model reconciler.
>
> When the user selects a node in the Outline view, the editor should
> change selection to the selected element and make it visible."
>
> http://wiki.eclipse.org/FAQ_How_do_I_create_an_Outline_view_ for_my_own_language_editor%3F
>
>
> But it is not obvious at all how to do it. Any help will be great.
You might find some useful information in this tutorial:
http://www.eclipse.org/eclipse/platform-text/eclipseCon/2006 /texteditorrecipes.pdf
Dani
>
> Nikola
>
|
|
|
Re: Editor and Outline view integration [message #331696 is a reply to message #331669] |
Tue, 16 September 2008 21:22  |
Eclipse User |
|
|
|
Daniel Megert wrote:
> Nikola Borisov wrote:
>> Hi All,
>>
>> I'm trying to implement the simple feature that when you select a item
>> in your Outline View that corresponding source code in the editor is
>> highlighted. I see that it has something to do with IShowInSource
> Nope, it does not.
So I figured it out myself... You are right it has nothing to do with
IShowInSource.... Instead is just the Editor detecting a selection in the
Outline View. I was confused. So if someone else is lost like me:
You just need to register a listener for the Editor on the Outline view (I
do this in getAdapter()) and basically in the View when the selection
changes i notify the Editor and he selects the appropriate code.
>> but there is virtually no documentation on how to use it (at least I
>> can't find it). I basically want to implement:
>>
>> "You will want to update the selection in your Outline view when the
>> cursor is moved in the editor. Similarly, if the structure of the
>> program changedï¿œcode added or removedï¿œthe outline has to be updated.
>> This is typically performed with a JFace text model reconciler.
>>
>> When the user selects a node in the Outline view, the editor should
>> change selection to the selected element and make it visible."
>>
>>
http://wiki.eclipse.org/FAQ_How_do_I_create_an_Outline_view_ for_my_own_language_editor%3F
>>
>>
>> But it is not obvious at all how to do it. Any help will be great.
> You might find some useful information in this tutorial:
>
http://www.eclipse.org/eclipse/platform-text/eclipseCon/2006 /texteditorrecipes.pdf
This wasn't really helpful for what i was trying to do... But otherwise it
is good source.
Thanks Dani
Nikola
> Dani
>>
>> Nikola
>>
|
|
|
Powered by
FUDForum. Page generated in 0.04911 seconds