bobbylight / AutoComplete

A code completion library for Swing text components, with special support for RSyntaxTextArea.
BSD 3-Clause "New" or "Revised" License
165 stars 55 forks source link

No callback for AutoCompletionListener if only single choice and flag setAutoCompleteSingleChoices(true) is set #31

Open eitzenbe opened 7 years ago

eitzenbe commented 7 years ago

I am using RoundRobinAutocompleter with some DefaultAutocompletions, whereas one of them has alistener attached to it. Now when i perform a autocompletion with multiple possible solution the popup window is shown an dhidden, allowing me to react to the autocompletion finally choosen (attaching my callbackk to the HIDE Event). When the flag mentioned in the subject is set, of course for single choices no popup ishsown and thus not hidden...

Any hint / proposal how to achieve this ?

It would be cool to have a new callback type maybe called COMPLETE that allows to act on a completion being finalized independently if a popup is shown or not

br Thomas

bobbylight commented 7 years ago

Since there is no HIDE event (as in java.util.EventObject subclass), how are you accomplishing what you describe? Are you overriding the AutoCompletion.hidePopupWindow() method?

If so, you can extend RoundRobinAutoCompletion and override the insertCompletion(Completion, boolean) method to be notified of whenever an completion is about to be physically inserted into the document.