Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Editor and Outline view integration
Editor and Outline view integration [message #331656] Mon, 15 September 2008 18:38 Go to next message
Nikola Borisov is currently offline Nikola BorisovFriend
Messages: 10
Registered: July 2009
Junior Member
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
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.

Nikola
Re: Editor and Outline view integration [message #331669 is a reply to message #331656] Tue, 16 September 2008 07:33 Go to previous messageGo to next message
Dani Megert is currently offline Dani MegertFriend
Messages: 3802
Registered: July 2009
Senior Member
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 Go to previous message
Nikola Borisov is currently offline Nikola BorisovFriend
Messages: 10
Registered: July 2009
Junior Member
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
>>
Previous Topic:Export-Package version when creating Plug-in from existing JAR archives
Next Topic:CNF interceptRefresh method
Goto Forum:
  


Current Time: Wed Jul 17 19:36:44 GMT 2024

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

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

Back to the top