Subversion Repositories eFlore/Applications.del

Compare Revisions

Ignore whitespace Rev 123 → Rev 124

/src/org/tela_botanica/del/client/vues/rechercheobservations/ObservationRecherchePresenteur.java
5,9 → 5,9
import java.util.List;
 
import org.tela_botanica.del.client.modeles.Observation;
import org.tela_botanica.del.client.pagination.PaginationPresenteur;
import org.tela_botanica.del.client.utils.KeyboardKeyListener;
import org.tela_botanica.del.client.utils.MockDatasource;
import org.tela_botanica.del.client.vues.rechercheobservations.pagination.NumeroPagePresenteur;
 
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
34,9 → 34,9
@SuppressWarnings("deprecation")
public void gererEvenements() {
// FIXME : temporaire, juste pour débug
chargerObservations();
// chargerObservations();
 
vue.getLabelChercher().addClickHandler(new ClickHandler() {
vue.getBoutonChercher().addClickHandler(new ClickHandler() {
 
@Override
public void onClick(ClickEvent event) {
83,7 → 83,7
vue.stopChargement();
 
}
 
public void fermerTousPanneauxDetailsObservations(){
for(ObservationPresenteur observationPresenteur: observationPresenteurs){
if(observationPresenteur.isDetailsOpen()){
91,16 → 91,21
}
}
}
 
private void createPaginationWidget(int nbImages) {
 
int nbPages = nbImages / vue.getNbImagesPerPage();
if (nbImages % vue.getNbImagesPerPage() == 0) {
nbPages--;
}
for (int i = 0; i <= nbPages; i++) {
new NumeroPagePresenteur(i + 1).go(vue.getPanneauPagination());
}
new PaginationPresenteur(nbImages) {
 
@Override
public void changerPage(int debut, int fin) {
ObservationRecherchePresenteur.getInstance().showImagePanels(debut, fin);
}
}.go(vue.getPanneauPagination());
/*
* int nbPages = nbImages / vue.getNbImagesPerPage(); if (nbImages %
* vue.getNbImagesPerPage() == 0) { nbPages--; } for (int i = 0; i <=
* nbPages; i++) { new NumeroPagePresenteur(i +
* 1).go(vue.getPanneauPagination()); }
*/
}
 
public void showImagePanels(int first, int last) {
/src/org/tela_botanica/del/client/vues/rechercheobservations/ObservationRechercheVue.java
1,19 → 1,23
package org.tela_botanica.del.client.vues.rechercheobservations;
 
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
 
import org.tela_botanica.del.client.modeles.Observation;
 
import com.google.gwt.core.client.GWT;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.FlexTable;
import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.HasHorizontalAlignment;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.Panel;
import com.google.gwt.user.client.ui.TextBox;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget;
 
public class ObservationRechercheVue extends Composite {
 
20,8 → 24,6
private final VerticalPanel mainPanel = new VerticalPanel();
private final Panel panneauChargement = new FlowPanel();
private final Panel taxaPanel = new FlowPanel();
private final FlexTable imageTable = new FlexTable();
private final Panel panneauPagination = new HorizontalPanel();
private final List<Panel> panneauxImages = new ArrayList<Panel>();
private final HTML labelChargement = new HTML("<img src='img/wait.gif' />Contact du serveur du CEL...");
private final HTML labelChercher = new HTML("<img src='img/search_icon.gif' />Search &nbsp;&nbsp; taxon:");
30,36 → 32,30
private int numImage = 0;
private final TextBox textBox = new TextBox();
 
// Constructeur
protected ObservationRechercheVue() {
// Annotation can be used to change the name of the associated xml file
// @UiTemplate("ObservationRechercheVue.ui.xml")
interface MyUiBinder extends UiBinder<Widget, ObservationRechercheVue> {
}
 
textBox.setText("apifera");
textBox.setFocus(true);
private static MyUiBinder uiBinder = GWT.create(MyUiBinder.class);
 
mainPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
mainPanel.setSize("100%", "100%");
@UiField
TextBox nomEspece;
 
Panel textBoxPanel = new HorizontalPanel();
textBoxPanel.add(labelChercher);
textBoxPanel.add(textBox);
@UiField
Panel panneauPagination;
 
Panel searchPanel = new VerticalPanel();
searchPanel.add(new HTML("Rechercher une image"));
searchPanel.add(textBoxPanel);
searchPanel.add(new HTML("Entrez un nom de genre ou d'esp&egrave;ce, un nom de commune, un num&eacute;ro de departement, l'email d'un utilisateur ou un mot-clef"));
@UiField
Button boutonChercher;
 
panneauChargement.add(labelChargement);
panneauChargement.setVisible(false);
@UiField
FlexTable imageTable;
 
mainPanel.add(panneauChargement);
// Constructeur
protected ObservationRechercheVue() {
 
taxaPanel.add(imageTable);
 
mainPanel.add(searchPanel);
mainPanel.add(panneauPagination);
mainPanel.add(taxaPanel);
 
initWidget(mainPanel);
initWidget(uiBinder.createAndBindUi(this));
nomEspece.setFocus(true);
}
 
/**
134,7 → 130,7
}
 
public TextBox getTextBox() {
return textBox;
return nomEspece;
}
 
public Panel getPanel() {
144,5 → 140,8
public List<Panel> getPanneauxImages() {
return panneauxImages;
}
 
public Button getBoutonChercher() {
return boutonChercher;
}
}