Subversion Repositories eFlore/Archives.cel-v1

Compare Revisions

Ignore whitespace Rev 10 → Rev 11

/trunk/src/org/tela_botanica/client/LocationAssistant.java
5,7 → 5,6
import java.util.EventListener;
 
 
import com.google.gwt.i18n.client.Dictionary;
import com.google.gwt.json.client.JSONArray;
import com.google.gwt.json.client.JSONParser;
import com.google.gwt.json.client.JSONString;
18,7 → 17,9
import org.tela_botanica.client.AutoCompleteAsyncTextBox;
 
/**
* A composite that displays a list of locations that can be selected.
* Affiche une liste de localite qui peuvent être selectionnées, retourne la valeur de la localité selectionne et une code associé
* (gettext et getvalue pour le code associé)
* Utilise un assistant de saisie asynchrone.
*/
 
public class LocationAssistant extends Composite implements EventListener, ResponseTextHandler {
26,16 → 27,21
private AutoCompleteAsyncTextBox autoCompletebox = new AutoCompleteAsyncTextBox(this);
private HorizontalPanel panel = new HorizontalPanel();
public LocationAssistant(AutoCompleteAsyncTextBoxListener listener) {
private Mediator mediator = null;
public LocationAssistant(Mediator med) {
 
mediator=med;
mediator.registerLocationAssistant(this);
// autoCompletebox.setFocus(true);
autoCompletebox.setSearchUrl(getServiceBaseUrl()+"/LocationSearch/");
autoCompletebox.setSearchUrl(mediator.getServiceBaseUrl()+"/LocationSearch/");
panel.add(autoCompletebox);
 
autoCompletebox.setWidth("100%");
initWidget(panel);
autoCompletebox.addAutoCompleteAsyncTextBoxListener(listener);
autoCompletebox.addAutoCompleteAsyncTextBoxListener(mediator.getInventoryItemList());
 
}
 
63,18 → 69,14
}
 
 
public void setText(String str) {
autoCompletebox.setText(str);
}
 
 
public String getValue() {
return autoCompletebox.getValue();
}
 
 
public String getServiceBaseUrl() {
Dictionary theme = Dictionary.getDictionary("Parameters");
return theme.get("serviceBaseUrl");
 
}
}