Subversion Repositories eFlore/Archives.cel-v1

Compare Revisions

Ignore whitespace Rev 5 → Rev 6

/trunk/src/org/tela_botanica/client/AutoCompleteAsyncTextBox.java
55,7 → 55,7
protected Vector items = new Vector();
protected boolean popupAdded = false;
protected boolean visible = false;
protected int current = -1;
protected String currentValue = null;
/**
176,9 → 176,9
else {
// Validation de l'entree :
if (autoCompleteAsyncTextBoxListeners!= null) {
autoCompleteAsyncTextBoxListeners.fireTextBoxEnter(this,current, this.getText());
autoCompleteAsyncTextBoxListeners.fireTextBoxEnter(this,this.getText(),currentValue);
}
current=-1;
currentValue=null;
this.setText("");
}
228,13 → 228,13
for(int i = 0; i < items.size(); i++)
{
choices.addItem((String) items.get(i));
choices.addItem(((String [])items.get(i))[0],((String [])items.get(i))[1]);
}
// if there is only one match and it is what is in the
// text field anyways there is no need to show autocompletion
if(items.size() == 1 && ((String) items.get(0)).compareTo(this.getText()) == 0)
if(items.size() == 1 && (((String []) items.get(0))[0]).compareTo(this.getText()) == 0)
{
choicesPopup.hide();
} else {
277,7 → 277,7
if(choices.getItemCount() > 0)
{
this.setText(choices.getItemText(choices.getSelectedIndex()));
current=choices.getSelectedIndex();
currentValue=choices.getValue(choices.getSelectedIndex());
}
 
visible=false;
287,8 → 287,8
}
public void addItem(String item) {
items.add(item);
public void addItem(String item, String value) {
items.add(new String [] {item, value});
}
private void addToCache (String query, Vector result)