AbstractRichPlugin: improve sorting behavior

It now more closely resembles AbstractUIDetails. However, we may want to
factor this sort of logic into a shared method somewhere, since it
currently is not very DRY.