﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
21240	[PATCH] [RFC] Refactoring of UploadDialog, HistoryComboBox and AutoCompletingComboBox	marcello@…	Don-vip	"This is quite a patch so it should be reviewed before applying.  

I started trying to fix the long-standing upload comment off-by-one error.  I found that `UploadDialog` was more complex that it needed to be and too many things could go wrong, see the many unsuccessful attempts to fix the off-by-one error.  So I rewrote and simplified it.  In the course I found that `HistoryComboBox` was buggy and could contribute to the error, and its class hierarchy with `AutoCompletingComboBox` was in need of refactoring. 

Salient points:

* Refactoring of `AutoCompletingComboBox`
  * new `AutoCompComboBox<E>` is a generic `AutoCompletingComboBox`
    * you can put any object into it and get it out again unchanged
    * the combobox will display the object's `toString()`
    * the combobox will autocomplete on all the objects' `toString()`
    * autocomplete can use `String` compare or custom comparators to find the best item
  * `HistoryComboBox` now extends `AutoCompComboBox<String>`
    * no more `AutoCompletionItems` used in `HistoryComboBox`
    * interface has been cleaned up (functions deprecated)
  * deprecated `AutoCompletingComboBox` now is a stub that extends `AutoCompComboBox<AutoCompletionItem>`
  * new `AutoCompComboBoxModel<E>` and `HistoryComboBoxModel` have been provided
    * non-UI functions have been moved to the models
  * autocomplete now implemented as key listener
    * not overriding internal document functions (no more risk of loops)
  * added tests

* Refactoring of `UploadDialog`
  * Fixes the long-standing upload comment off-by-one bug
  * Four models (2 combobox, 1 checkbox, 1 tageditor) have been consolidated into one model
  * Made sure all controls update their models before uploading (eg. Ctrl-Enter shortcut)
  * Added tests

Probably more rewriting of `UploadDialog` is needed to make it clean.  

Comments are welcome."	enhancement	closed	major	21.08	Core		fixed		
