aposin / gem

ARCHIVED: Git Environment Manager (GEM)
Apache License 2.0
1 stars 2 forks source link

Extension for sorting projects/environments #18

Closed d-gs closed 3 years ago

d-gs commented 3 years ago

Feature request

Expected Behavior - What were you expecting to happen?

A plug-in should be able to provide a extension to sort the returned lists of IEnvironment and IProject from the ICongiguration getters.

Current Behavior - What happens?

Currently the list of environments is sorted with Comparator.reverseOrder(), which is taking the comparison of the environment ID to sort them. For the projects, when loaded with a Stream, the sorted() method it is used (also using the project ID).

Possible Solution

Introduce a IGemService to perform the sorting of those objects (and maybe other in the future if required for the display of them), that should be provided only once to the gem product (e.g., on its own plug-in). By default, if not provided a default sorter should be there with the current behavior.