OpenConcerto

Dépôt officiel du code source de l'ERP OpenConcerto
sonarqube

svn://code.openconcerto.org/openconcerto

Compare Revisions

Regard whitespace Rev 141 → Rev 142

/trunk/OpenConcerto/src/org/openconcerto/ui/component/ITextCombo.java
18,6 → 18,7
 
import static org.openconcerto.ui.component.ComboLockedMode.LOCKED;
import static org.openconcerto.ui.component.ComboLockedMode.UNLOCKED;
 
import org.openconcerto.ui.component.InteractionMode.InteractionComponent;
import org.openconcerto.ui.component.combo.ISearchableComboPopup;
import org.openconcerto.ui.component.text.TextComponent;
492,12 → 493,20
* @return <code>true</code> if s is really added.
*/
private final boolean addToCache(String s) {
if (s != null && s.length() > 0 && this.getListModel().getList().indexOf(s) < 0) {
this.addItem(makeObj(s));
return true;
} else
return false;
final boolean added = s != null && s.length() > 0 && this.getListModel().getList().indexOf(s) < 0;
if (added) {
final Object obj = makeObj(s);
// BasicComboBoxUI$Handler.intervalAdded(ListDataEvent) calls contentsChanged() which
// calls JComboBox.configureEditor() with the current selection. But the selection is
// only set by BasicComboBoxUI.Handler.focusLost() so this.addItem() replaces the
// current editor value by the current selection.
this.completing = true;
this.setSelectedItem(obj);
this.completing = false;
this.addItem(obj);
}
return added;
}
 
private final void removeCurrentText() {
final String t = this.getTextComp().getText();