/trunk/src/org/tela_botanica/client/Cel.java |
---|
23,6 → 23,7 |
private EntryPanel entryPanel = null; |
private ActionPanel actionPanel = null; |
private SearchPanel searchPanel = null; |
private InfoPopup infoPopup = null; |
private VerticalPanel rightPanel = null; |
private Mediator mediator = null; |
47,6 → 48,7 |
centerPanel = new CenterPanel(mediator); |
topPanel = new TopPanel(mediator); |
leftPanel = new LeftPanel(mediator); |
55,7 → 57,9 |
actionPanel = new ActionPanel(mediator); |
searchPanel = new SearchPanel(mediator); |
rightPanel = new VerticalPanel(); |
infoPopup = new InfoPopup(mediator); |
// Information haut de page (nom application, connexion ... etc). |
// A regler |
100,7 → 104,6 |
mediator.onInit(); |
RootPanel.get().add(outer); |
/trunk/src/org/tela_botanica/client/Mediator.java |
---|
27,7 → 27,10 |
private LocationAssistant locationAssistant=null; |
private InventoryItem inventoryItem=null; |
private EntryPanel entryPanel=null; |
private ActionPanel actionPanel=null; |
private TopPanel topPanel=null; |
private LeftPanel leftPanel=null; |
private InfoPopup infoPopup=null; |
private TextBox date = null; |
private TextBox complementLocation = null; |
124,15 → 127,17 |
public void onLocationSelected(String loc) { |
inventoryItemList.setLocation(loc); |
inventoryItemList.setDate("all"); |
inventoryItemList.setStation("all"); |
// inventoryItemList.setDate("all"); |
// inventoryItemList.setStation("all"); |
inventoryItemList.updateCount(); |
// nameAssistant.setValue(null); |
dateList.setLocation(loc); |
dateList.setDate("all"); |
// dateList.setDate("all"); |
dateList.updateCount(); |
stationList.setLocation(loc); |
stationList.setStation("all"); |
// stationList.setStation("all"); |
stationList.updateCount(); |
} |
185,7 → 190,9 |
inventoryItemList.setStation(station); |
inventoryItemList.updateCount(); |
// nameAssistant.setValue(null); |
} |
199,10 → 206,19 |
inventoryItemList.setDate(date); |
inventoryItemList.updateCount(); |
// nameAssistant.setValue(null); |
} |
/** |
* Action suivant la complétion d'un nom |
* |
*/ |
public void onNameCompleted(String value) { |
infoPopup.setImageUrl(value); |
} |
/** |
293,6 → 309,18 |
/** |
* Declaration InfoPopup |
* @param infoPopup |
*/ |
public void registerInfoPopup(InfoPopup infoPopup) { |
this.infoPopup=infoPopup; |
} |
/** |
* Declaration StationList |
* @param locationList |
*/ |
365,8 → 393,12 |
} |
public void registerActionPanel(ActionPanel actionPanel) { |
this.actionPanel=actionPanel; |
} |
public void registerTopPanel(TopPanel topPanel) { |
this.topPanel=topPanel; |
} |
384,8 → 416,18 |
} |
/* Panneau gauche |
* |
*/ |
public void registerLeftPanel(LeftPanel leftPanel) { |
this.leftPanel=leftPanel; |
} |
/** |
* Recherche distante et asynchrone de l'utilisateur connecté, en retour lancement methode initialisation |
* de l'appellant Cel. (initAsync) |
483,6 → 525,14 |
} |
public LeftPanel getLeftPanel() { |
return leftPanel; |
} |
public InfoPopup getInfoPopup() { |
return infoPopup; |
} |
public void setConnected(boolean connected) { |
this.connected=connected; |
494,4 → 544,9 |
} |
public ActionPanel getActionPanel() { |
return this.actionPanel; |
} |
} |
/trunk/src/org/tela_botanica/client/InventoryItemList.java |
---|
136,6 → 136,8 |
private static final int VISIBLE_TAXON_COUNT = 15; |
private Grid header = new Grid(1, 3); |
private FlexTable table = new FlexTable(); |
227,6 → 229,7 |
initWidget(panel); |
} |
254,7 → 257,23 |
/** |
* Action lancee par la completion d'un nom dans l'assistant de saisie |
* Recherche d'information complémentaires .... |
* |
* @return void |
*/ |
public void onComplete(ResponseTextHandler sender, String str, String value) { |
if (sender instanceof NameAssistant) { |
mediator.onNameCompleted(value); |
} |
} |
/** |
* Action lancee par la selection d'un nom dans l'assistant de saisie. Lance |
* la recherche d'informations complémentaires (famille, numero |
265,8 → 284,13 |
public void onValidate(SourcesAutoCompleteAsyncTextBoxEvents sender, |
String str, String value) { |
if (mediator.getEntryPanel().getOrdre()==null) { |
mediator.onAddInventoryItem(); |
} |
else { |
mediator.onModifyInventoryItem(mediator.getEntryPanel().getOrdre()); |
mediator.getEntryPanel().setOrdre(null); |
} |
} |
636,6 → 660,17 |
public void update() { |
// Mise a jour boutton export feuille de calcul |
mediator.getActionPanel().getExportButton().setHTML("<a href=\""+mediator.getServiceBaseUrl()+"/InventoryExport/" |
+ user + "/" |
+ location + "/" |
+ station + "/" |
+ search + "/" |
+ date + |
"\">"+"Export tableur</a>"); |
// table.setBorderWidth(1); |
setStatusDisabled(); |
1021,6 → 1056,4 |
} |
/trunk/src/org/tela_botanica/client/LeftPanel.java |
---|
28,9 → 28,14 |
private LocationList locationList = null; |
private DateList dateList = null; |
private StationList stationList = null; |
private Mediator mediator=null; |
public LeftPanel(Mediator mediator) { |
public LeftPanel(Mediator med) { |
mediator=med; |
mediator.registerLeftPanel(this); |
dateList = new DateList(mediator); |
locationList = new LocationList(mediator); |
stationList = new StationList(mediator); |
/trunk/src/org/tela_botanica/client/AutoCompleteAsyncTextBox.java |
---|
315,11 → 315,16 |
// add selected item to textbox |
protected void complete() |
{ |
if(choices.getItemCount() > 0) |
{ |
this.setText(choices.getItemText(choices.getSelectedIndex())); |
currentValue=choices.getValue(choices.getSelectedIndex()); |
if (autoCompleteAsyncTextBoxListeners!= null) { |
autoCompleteAsyncTextBoxListeners.fireTextBoxComplete(responseTextHandler,this.getText(),currentValue); |
} |
} |
visible=false; |
items.clear(); |
354,6 → 359,5 |
} |
} |
/trunk/src/org/tela_botanica/client/InfoPopup.java |
---|
New file |
0,0 → 1,84 |
/* |
* Copyright 2006 Google Inc. |
* |
* Licensed under the Apache License, Version 2.0 (the "License"); you may not |
* use this file except in compliance with the License. You may obtain a copy of |
* the License at |
* |
* http://www.apache.org/licenses/LICENSE-2.0 |
* |
* Unless required by applicable law or agreed to in writing, software |
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
* License for the specific language governing permissions and limitations under |
* the License. |
*/ |
package org.tela_botanica.client; |
import com.google.gwt.json.client.JSONArray; |
import com.google.gwt.json.client.JSONParser; |
import com.google.gwt.json.client.JSONString; |
import com.google.gwt.json.client.JSONValue; |
import com.google.gwt.user.client.HTTPRequest; |
import com.google.gwt.user.client.ResponseTextHandler; |
import com.google.gwt.user.client.ui.Image; |
import com.google.gwt.user.client.ui.PopupPanel; |
/** |
* Composite permet de wrapper des Widget pour creer un nouveau Widget cf methode initWidget() |
*/ |
public class InfoPopup extends PopupPanel { |
private Mediator mediator=null; |
private Image image = new Image(); |
public InfoPopup(final Mediator med) { |
super(true); |
mediator=med; |
mediator.registerInfoPopup(this); |
add(image); |
} |
public void setImage(String url) { |
if (url.compareTo("null")!=0) { |
setPopupPosition(mediator.getLeftPanel().getAbsoluteLeft()+10, mediator.getLeftPanel().getAbsoluteTop() + (mediator.getLeftPanel().getOffsetHeight()/2)); |
show(); |
image.setUrl(url); |
} |
else { |
hide(); |
} |
} |
public void setImageUrl(String value) { |
HTTPRequest.asyncGet(mediator.getServiceBaseUrl() + "/NameImage/" + value, |
new ResponseTextHandler() { |
public void onCompletion(String strcomplete) { |
JSONValue jsonValue = JSONParser.parse(strcomplete); |
JSONArray jsonArray; |
if ((jsonArray = jsonValue.isArray()) != null) { |
// Url Image |
setImage(((JSONString) jsonArray.get(0)).stringValue()); |
} |
} |
}); |
} |
} |
/trunk/src/org/tela_botanica/client/EntryPanel.java |
---|
94,9 → 94,14 |
private CalendarWidget calendar = null; // Lazy instantiation |
private PopupPanel choicesPopup = null; // Lazy instantiation |
public EntryPanel(final Mediator med) { |
Grid inner = new Grid(3,4); |
mediator=med; |
user=mediator.getUser(); |
113,7 → 118,6 |
outer.add(new HTML("<b>Saisir un relevé :</b>")); |
Grid inner = new Grid(3,4); |
for (int i=0; i<3;i++) { |
inner.getCellFormatter().setWidth(i, 0, "3%"); |
123,6 → 127,8 |
} |
nameAssistant = new NameAssistant(mediator); |
locationAssistant = new LocationAssistant(mediator); |
353,7 → 359,6 |
} |
initWidget(outer); |
406,7 → 411,8 |
String ann=((JSONString) jsonArray .get(3)).stringValue(); |
if (ann.compareTo("0")!=0) { |
nameAssistant.setValue(null); |
nameAssistant.setValue(ann); |
mediator.getInfoPopup().setImageUrl(ann); |
} |
else { |
nameAssistant.setValue(null); |
465,10 → 471,14 |
this.user = user; |
} |
} |
/* +--Fin du code ---------------------------------------------------------------------------------------+ |
* $Log$ |
* Revision 1.5 2007-05-22 14:27:08 ddelon |
* reglage modification |
* |
* Revision 1.4 2007-05-21 21:01:35 ddelon |
* Modification comportement boutons |
* |
/trunk/src/org/tela_botanica/client/AutoCompleteAsyncTextBoxListener.java |
---|
1,6 → 1,8 |
package org.tela_botanica.client; |
import com.google.gwt.user.client.ResponseTextHandler; |
/** |
* Event listener interface for table events. |
*/ |
13,4 → 15,13 |
* @param text : text selected |
*/ |
void onValidate(SourcesAutoCompleteAsyncTextBoxEvents sender, String text, String value); |
/** |
* Fired when a AutoCompleteBox is completed (selection) |
* |
* @param sender the widget sending the event |
* @param text : text selected |
*/ |
void onComplete(ResponseTextHandler sender, String text, String value); |
} |
/trunk/src/org/tela_botanica/client/ImportDialog.java |
---|
80,7 → 80,7 |
// Validation bouton |
HTML okButton=new HTML("Ok"); |
HTML okButton=new HTML("Oui"); |
okButton.setStyleName("html_button"); |
okButton.addClickListener( |
new ClickListener() { |
93,7 → 93,7 |
// Annulation |
HTML cancelButton=new HTML("Annuler"); |
HTML cancelButton=new HTML("Non"); |
cancelButton.setStyleName("html_button"); |
cancelButton.addClickListener( |
new ClickListener() { |
160,6 → 160,9 |
/* +--Fin du code ---------------------------------------------------------------------------------------+ |
* $Log$ |
* Revision 1.1 2007-05-21 18:14:06 ddelon |
* Gestion importation releve locaux |
* |
* Revision 1.7 2007-05-21 11:47:30 ddelon |
* meta cvs |
* |
/trunk/src/org/tela_botanica/client/ActionPanel.java |
---|
30,14 → 30,16 |
public class ActionPanel extends Composite { |
Mediator mediator=null; |
private Mediator mediator=null; |
private HTML exportButton=null; |
public ActionPanel(final Mediator med) { |
mediator=med; |
mediator.registerActionPanel(this); |
HorizontalPanel outer = new HorizontalPanel(); |
HorizontalPanel buttons = new HorizontalPanel(); |
buttons.setSpacing(3); |
80,12 → 82,13 |
// Export de la totalité |
HTML exportButton=new HTML("<a href=\""+mediator.getServiceBaseUrl()+"/InventoryExport/" +mediator.getUser()+"\">"+"Tout exporter</a>"); |
exportButton=new HTML("<a href=\""+mediator.getServiceBaseUrl()+"/InventoryExport/" |
+ mediator.getUser() + |
"\">"+"Export tableur</a>"); |
buttons.add(exportButton); |
exportButton.setStyleName("html_button"); |
// Selections de l'affichage |
HorizontalPanel selections = new HorizontalPanel(); |
133,4 → 136,9 |
} |
public HTML getExportButton() { |
return exportButton; |
} |
} |
/trunk/src/org/tela_botanica/client/AutoCompleteAsyncTextBoxListenerCollection.java |
---|
3,11 → 3,13 |
import java.util.Iterator; |
import java.util.Vector; |
import com.google.gwt.user.client.ResponseTextHandler; |
public class AutoCompleteAsyncTextBoxListenerCollection extends Vector { |
private static final long serialVersionUID = -2767605614048989439L; |
/** |
* Fires a cellClicked event to all listeners. |
* Fires a Text enter event to all listeners. |
* |
* @param sender the widget sending the event |
* @param text the text sent |
18,4 → 20,19 |
listener.onValidate(sender, text, value); |
} |
} |
/** |
* Fires a Text complete event to all listeners. |
* |
* @param sender the widget sending the event |
* @param text the text sent |
*/ |
public void fireTextBoxComplete(ResponseTextHandler sender, String text, String value) { |
for (Iterator it = iterator(); it.hasNext();) { |
AutoCompleteAsyncTextBoxListener listener = (AutoCompleteAsyncTextBoxListener) it.next(); |
listener.onComplete(sender, text, value); |
} |
} |
} |