Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Change sorting behavior of Quick Outline
Change sorting behavior of Quick Outline [message #892295] Wed, 27 June 2012 16:20 Go to next message
Timo Missing name is currently offline Timo Missing nameFriend
Messages: 12
Registered: March 2011
Junior Member
Hi there!

I just updated to Xtext 2.3 and discovered the following(don't know if it was like that before):

The outline of my DSL has a different sorting order in outline and quick outline.

I'm using a custom TreeProvider (by extending DefaultOutlineTreeProvider), generating a list of all functions within a document in the order of appearence.
In the outline, the functions are represented correctly, in the quick outline they are ordered alphabetically.
(see attached screenshot)

So after some debugging I found out that there are the classes OutlineFilterAndSorter and QuickOutlineFilterAndSorter where the second one by default always returns true in isSortingEnabled().
Is there a reason for that?

I didn't find a corresponding bind... method in the UIModule to overwrite QuickOutlineFilterAndSorter, so is there way to change this behaviour without overwriting a lot of other classes?

Thanks for your help!
Re: Change sorting behavior of Quick Outline [message #892321 is a reply to message #892295] Wed, 27 June 2012 17:37 Go to previous messageGo to next message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 3108
Registered: July 2009
Senior Member
Timo,

just add a binding on your own:

public Class<? extends QuickOutlineFilterAndSorter>
bindQuickOutlineFilterAndSorter() {
return MyQuickOutlineFilterAndSorter.class;
}

The framework will consider that one, too.

Regards,
Sebastian
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com

Am 27.06.12 18:20, schrieb Timo Mising name:
> Hi there!
>
> I just updated to Xtext 2.3 and discovered the following(don't know if it was like that before):
>
> The outline of my DSL has a different sorting order in outline and quick outline.
>
> I'm using a custom TreeProvider (by extending DefaultOutlineTreeProvider), generating a list of all functions within a document in the order of appearence.
> In the outline, the functions are represented correctly, in the quick outline they are ordered alphabetically.
> (see attached screenshot)
>
> So after some debugging I found out that there are the classes OutlineFilterAndSorter and QuickOutlineFilterAndSorter where the second one by default always returns true in isSortingEnabled().
> Is there a reason for that?
>
> I didn't find a corresponding bind... method in the UIModule to overwrite QuickOutlineFilterAndSorter, so is there way to change this behaviour without overwriting a lot of other classes?
>
> Thanks for your help!
Re: Change sorting behavior of Quick Outline [message #892414 is a reply to message #892321] Thu, 28 June 2012 07:43 Go to previous message
Timo Missing name is currently offline Timo Missing nameFriend
Messages: 12
Registered: March 2011
Junior Member
Hi Sebastian,

Perfect, didn't know that I can add bindings myself.
Thanks!
Previous Topic:Xtext support to ProjectionDocument
Next Topic:Problem when defining terminal rule
Goto Forum:
  


Current Time: Thu May 28 05:43:12 GMT 2020

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

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

Back to the top