Partial elements placed at the end in selectors

Issue #338 new
Cécile Camillieri created an issue

The RamSelector sorts its elements by name. So because of the '|' symbol in front of the name for partial elements, the selector places them at the bottom. This is really annoying when creating mapping because most of the time partial elements are the one we want to map in priority.

We should probably change the comparator used in the selector the make partial elements more important in some cases. Or maybe we can just ignore the '|' symbol when ordering elements.

Comments (5)

  1. Jörg Kienzle

    Yes, your suggestion of making them more important is good, since 99% of the time we want to map the partial elements.

    • J
  2. Matthias Schoettle

    Perhaps we could add a comparator that places special charactors before alphanumeric characters. In EMF.UI it seems like the sorting is performed at the UI level and I think I just forgot to consider that in the SelectorView (the property descriptor has isSortChoices()), so we should be able to add that.

    But do we want this ordering in all cases? For example, when selecting the return type or the type of a parameter?

  3. Cécile Camillieri reporter

    I think most of the time we want to "ignore" the '|' symbols, but when mapping we may want to put partial elements first.

    Also the selectorView is based on RamListComponent and we can set a new Comparator for the list. Or to ignore the symbols we could just change the getSortingName() we have to define in namers for the list so that symbol is left out.

    I don't really know which solution is the best.

  4. Matthias Schoettle

    The genmodel has a property called "sort choices", it would be nice to use that. But I guess there will be no generic solution (since SelectorView is automatically used) if we want partial elements be prioritized only in certain cases. Unless we somehow add information to a TextView, i.e., it is possible to set a custom comparator :)

  5. Matthias Schoettle

    I thought about adjusting the getSortingName in SelectorView's namer. However, I think it's too specific, since it only relates to specific objects and their properties.

    So either we make it use EMFEditUtil.getFeatureText instead of EMFEditUtil.getPropertyText or we need to use a custom namer (or comparator) for these. However, classes appear in several places (e.g., operation return type) and we might want to have the same ordering in all those places.

  6. Log in to comment