Completions for Jython code. The completion task is created with the editor configured for completions (code and caret position within code), and "query" is called which will fill a CompletionResultSet.
create the completion task on the text component, using its content and caret position.
perform the completions query.
sorts all the lists by the first list. See http://stackoverflow.com/questions/15400514/syncronized-sorting-between-two-arraylists/24688828#24688828 Note the key list must be repeated for it to be sorted as well!