Subversion Repositories eFlore/Archives.cel-v1

Compare Revisions

Ignore whitespace Rev 10 → Rev 11

/trunk/src/org/tela_botanica/client/NameAssistant.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,7
import org.tela_botanica.client.AutoCompleteAsyncTextBox;
 
/**
* A composite that displays a list of names that can be selected.
* Affiche une liste de nom pour selection. Son retournés le nom selectionné (gettext()) et un code associé (getvalue()).
*/
 
public class NameAssistant extends Composite implements EventListener, ResponseTextHandler {
26,16 → 25,23
private AutoCompleteAsyncTextBox autoCompletebox = new AutoCompleteAsyncTextBox(this);
private HorizontalPanel panel = new HorizontalPanel();
public NameAssistant(AutoCompleteAsyncTextBoxListener listener) {
private Mediator mediator = null;
public NameAssistant(Mediator med) {
 
mediator=med;
mediator.registerNameAssistant(this);
// autoCompletebox.setFocus(true);
autoCompletebox.setSearchUrl(getServiceBaseUrl()+"/NameSearch/");
autoCompletebox.setSearchUrl(mediator.getServiceBaseUrl()+"/NameSearch/");
panel.add(autoCompletebox);
 
autoCompletebox.setWidth("100%");
initWidget(panel);
autoCompletebox.addAutoCompleteAsyncTextBoxListener(listener);
autoCompletebox.addAutoCompleteAsyncTextBoxListener(mediator.getInventoryItemList());
 
}
 
69,15 → 75,6
return autoCompletebox.getValue();
}
 
 
public String getServiceBaseUrl() {
Dictionary theme = Dictionary.getDictionary("Parameters");
return theme.get("serviceBaseUrl");
 
}
}