/trunk/src/org/tela_botanica/del/client/vues/identiplante/resultats/observations/ObservationVue.ui.xml |
---|
30,7 → 30,7 |
text="{constants.proposerSaDetermination}" /> |
<g:Button ui:field="boutonAjoutCommentaire" styleName="bouton-petit" |
text="{constants.ajouterCommentaire}" /> |
<g:Button ui:field="boutonPlusDeDetails" styleName="bouton-petit {style.ajouterProposition}" |
<g:Button ui:field="boutonPlusDeDetails" styleName="bouton-petit {style.ajouterProposition} {style.plusDeDetails}" |
text="Voir tous les commentaires" /> |
</g:HTMLPanel> |
</g:HTMLPanel> |
/trunk/src/org/tela_botanica/del/client/vues/identiplante/resultats/observations/ObservationPresenteur.java |
---|
33,6 → 33,7 |
import com.google.gwt.event.dom.client.ClickEvent; |
import com.google.gwt.event.dom.client.ClickHandler; |
import com.google.gwt.event.dom.client.HasClickHandlers; |
import com.google.gwt.user.client.Window; |
import com.google.gwt.user.client.ui.HasWidgets; |
import com.google.gwt.user.client.ui.IsWidget; |
51,6 → 52,8 |
public void setNomEspece(String nomEspece); |
public void setNbCommentaires(String nbCommentaires); |
public HasClickHandlers getBoutonAjoutCommentaire(); |
public HasClickHandlers getBoutonPlusDeDetails(); |
} |
78,6 → 81,7 |
observationDeterminationPresenteur = new ObservationDeterminationPresenteur(new ObservationDeterminationVue(), observation.getPropositionDeterminations()); |
observationDeterminationPresenteur.go(vue.getDeterminationsPanel()); |
vue.setNomEspece(observation.getNomRetenu()); |
vue.setNbCommentaires(observation.getNbCommentaires()); |
gererEvenements(); |
} |
/trunk/src/org/tela_botanica/del/client/vues/identiplante/resultats/observations/ObservationVue.java |
---|
73,4 → 73,9 |
this.nomEspece.setText(nomEspece); |
} |
@Override |
public void setNbCommentaires(String nbCommentaires) { |
boutonPlusDeDetails.setText(boutonPlusDeDetails.getText()+" ("+nbCommentaires+")"); |
} |
} |
/trunk/src/org/tela_botanica/del/client/vues/identiplante/resultats/observations/observation.css |
---|
95,4 → 95,7 |
} |
.ajouterProposition { |
margin-top:10px; |
} |
.plusDeDetails { |
width: 130px; |
} |
/trunk/src/org/tela_botanica/del/client/vues/identiplante/resultats/ResultatsIdentiplanteVue.ui.xml |
---|
13,9 → 13,15 |
<g:HTMLPanel ui:field="zoneTri" styleName="droite {style.zoneTri} petit"> |
<g:Label text="{constants.tri}" styleName="gauche"/> |
<g:HTMLPanel ui:field="triParDate" styleName="gauche"> |
<g:Label text="{constants.triParDate}" title="{constants.triParDateObsTooltip}" styleName="gauche {style.date}" ui:field="labelDate"/> |
<g:Button title="{constants.triParDateObsAscendant}" ui:field="triParDateAscendant" styleName="{style.boutonTriAsc} gauche" /> |
<g:Button title="{constants.triParDateObsDescendant}" ui:field="triParDateDescendant" styleName="{style.boutonTriDesc} gauche" /> |
<g:Label text="{constants.triParDateObs}" title="{constants.triParDateObsTooltip}" styleName="gauche {style.date}" ui:field="labelDateObservation"/> |
<g:Button title="{constants.triParDateObsAscendant}" ui:field="triParDateObservationAscendant" styleName="{style.boutonTriAsc} gauche" /> |
<g:Button title="{constants.triParDateObsDescendant}" ui:field="triParDateObservationDescendant" styleName="{style.boutonTriDesc} gauche" /> |
<g:Label text="{constants.triParDatePubli}" title="{constants.triParDatePubliTooltip}" styleName="gauche {style.date}" ui:field="labelDatePublication"/> |
<g:Button title="{constants.triParDatePubliAscendant}" ui:field="triParDatePublicationAscendant" styleName="{style.boutonTriAsc} gauche" /> |
<g:Button title="{constants.triParDatePubliDescendant}" ui:field="triParDatePublicationDescendant" styleName="{style.boutonTriDesc} gauche" /> |
<g:Label text="{constants.triParNbCommentaires}" title="{constants.triParDatePubliTooltip}" styleName="gauche {style.date}" ui:field="labelNbCommentaires"/> |
<g:Button title="{constants.triParDatePubliAscendant}" ui:field="triParNbCommentairesAscendant" styleName="{style.boutonTriAsc} gauche" /> |
<g:Button title="{constants.triParDatePubliDescendant}" ui:field="triParNbCommentairesDescendant" styleName="{style.boutonTriDesc} gauche" /> |
</g:HTMLPanel> |
</g:HTMLPanel> |
</g:HTMLPanel> |
/trunk/src/org/tela_botanica/del/client/vues/identiplante/resultats/ResultatsIdentiplantePresenteur.java |
---|
22,6 → 22,7 |
import com.google.gwt.user.client.Window; |
import com.google.gwt.user.client.ui.HasWidgets; |
import com.google.gwt.user.client.ui.IsWidget; |
import com.google.gwt.user.client.ui.Label; |
public class ResultatsIdentiplantePresenteur extends Presenteur { |
41,22 → 42,40 |
public void nettoyer(); |
public HasClickHandlers getTriParDateAscendant(); |
public HasClickHandlers getTriParDateObservationAscendant(); |
public HasClickHandlers getTriParDateDescendant(); |
public HasClickHandlers getTriParDateObservationDescendant(); |
public HasClickHandlers getTriParDatePublicationAscendant(); |
public HasClickHandlers getTriParDatePublicationDescendant(); |
public HasClickHandlers getTriParNbCommentairesAscendant(); |
public HasClickHandlers getTriParNbCommentairesDescendant(); |
public void afficherElementsAucunResultatTrouve(); |
public void afficherElementsResultatsTrouves(); |
public HasClickHandlers getLabelDate(); |
public HasClickHandlers getLabelDateObservation(); |
public HasClickHandlers getLabelDatePublication(); |
public HasClickHandlers getLabelNbCommentaires(); |
public void setModeTri(ModeTri mode); |
void setModeTriPublication(ModeTri mode); |
void setModeTriObservation(ModeTri mode); |
void setModeTriNbCommentaires(ModeTri mode); |
} |
private Vue vue; |
private ObservationService serviceObs; |
private ModeTri triCourantDate = ModeTri.TRI_DESCENDANT; |
private ModeTri triCourantDatePublication = ModeTri.TRI_DESCENDANT; |
private ModeTri triCourantDateObservation = ModeTri.PAS_DE_TRI; |
private ModeTri triCourantNbCommentaires = ModeTri.PAS_DE_TRI; |
private CacheClient cache = CacheClient.getInstance(); |
private String statut; |
70,10 → 89,23 |
public ResultatsIdentiplantePresenteur(ObservationService serviceObs, Vue vue) { |
String statut = CacheClient.getInstance().getFiltreStatut(); |
this.vue = vue; |
ModeTri initTriCourantDate = CacheClient.getInstance().getInformationsRechercheObservation().getTriParDate(); |
initTriCourantDate = (initTriCourantDate == null) ? triCourantDate : initTriCourantDate; |
triCourantDate = initTriCourantDate; |
vue.setModeTri(triCourantDate); |
InformationsRecherche infos = CacheClient.getInstance().getInformationsRechercheObservation(); |
if (infos.getTriParDatePublication() != ModeTri.PAS_DE_TRI) { |
triCourantDatePublication = infos.getTriParDatePublication(); |
vue.setModeTriPublication(triCourantDatePublication); |
} |
if (infos.getTriParDateObservation() != ModeTri.PAS_DE_TRI) { |
triCourantDateObservation = infos.getTriParDateObservation(); |
vue.setModeTriObservation(triCourantDatePublication); |
} |
if (infos.getTriParNbCommentaires() != ModeTri.PAS_DE_TRI) { |
triCourantNbCommentaires = infos.getTriParNbCommentaires(); |
vue.setModeTriNbCommentaires(triCourantNbCommentaires); |
} |
this.serviceObs = serviceObs; |
this.statut = statut; |
} |
162,39 → 194,118 |
* */ |
protected void gererEvenements() { |
ClickHandler surClicDate = new ClickHandler() { |
ClickHandler surClicDateObservation = new ClickHandler() { |
/** |
* Gestion du clic sur l'option de tri par date d'observation Masque |
* les éléments de tri qui sont en cours et affiche les autres |
* */ |
public void onClick(ClickEvent event) { |
toggleModeTri(); |
toggleModeTriObservation(); |
InformationsRecherche informationsRechercheObservations = cache.getInformationsRechercheObservation(); |
informationsRechercheObservations.setTriParDate(triCourantDate); |
informationsRechercheObservations.setTriParDatePublication(ModeTri.PAS_DE_TRI); |
informationsRechercheObservations.setTriParNbCommentaires(ModeTri.PAS_DE_TRI); |
informationsRechercheObservations.setTriParDateObservation(triCourantDateObservation); |
chercherEtAfficherObservationsPageEnCours(); |
} |
}; |
ClickHandler surClicDatePublication = new ClickHandler() { |
/** |
* Gestion du clic sur l'option de tri par date d'observation Masque |
* les éléments de tri qui sont en cours et affiche les autres |
* */ |
public void onClick(ClickEvent event) { |
toggleModeTriPublication(); |
vue.getLabelDate().addClickHandler(surClicDate); |
vue.getTriParDateAscendant().addClickHandler(surClicDate); |
vue.getTriParDateDescendant().addClickHandler(surClicDate); |
InformationsRecherche informationsRechercheObservations = cache.getInformationsRechercheObservation(); |
informationsRechercheObservations.setTriParDateObservation(ModeTri.PAS_DE_TRI); |
informationsRechercheObservations.setTriParNbCommentaires(ModeTri.PAS_DE_TRI); |
informationsRechercheObservations.setTriParDatePublication(triCourantDatePublication); |
chercherEtAfficherObservationsPageEnCours(); |
} |
}; |
ClickHandler surClicNbCommentaires = new ClickHandler() { |
/** |
* Même comportement qu'au dessus mais pour le tri par nb de commentaires |
*/ |
public void onClick(ClickEvent event) { |
toggleModeTriNbCommentaires(); |
InformationsRecherche informationsRechercheObservations = cache.getInformationsRechercheObservation(); |
informationsRechercheObservations.setTriParDateObservation(ModeTri.PAS_DE_TRI); |
informationsRechercheObservations.setTriParDatePublication(ModeTri.PAS_DE_TRI); |
informationsRechercheObservations.setTriParNbCommentaires(triCourantNbCommentaires); |
chercherEtAfficherObservationsPageEnCours(); |
} |
}; |
vue.getLabelDateObservation().addClickHandler(surClicDateObservation); |
vue.getTriParDateObservationAscendant().addClickHandler(surClicDateObservation); |
vue.getTriParDateObservationDescendant().addClickHandler(surClicDateObservation); |
vue.getLabelDatePublication().addClickHandler(surClicDatePublication); |
vue.getTriParDatePublicationAscendant().addClickHandler(surClicDatePublication); |
vue.getTriParDatePublicationDescendant().addClickHandler(surClicDatePublication); |
vue.getLabelNbCommentaires().addClickHandler(surClicNbCommentaires); |
vue.getTriParNbCommentairesAscendant().addClickHandler(surClicNbCommentaires); |
vue.getTriParNbCommentairesDescendant().addClickHandler(surClicNbCommentaires); |
} |
/** |
* Inverser le mode de tri en fonction du précédent |
* */ |
public void toggleModeTri() { |
if (triCourantDate == ModeTri.TRI_ASCENDANT) { |
triCourantDate = ModeTri.TRI_DESCENDANT; |
public void toggleModeTriPublication() { |
if (triCourantDatePublication == ModeTri.TRI_ASCENDANT) { |
triCourantDatePublication = ModeTri.TRI_DESCENDANT; |
} else { |
triCourantDate = ModeTri.TRI_ASCENDANT; |
triCourantDatePublication = ModeTri.TRI_ASCENDANT; |
} |
triCourantDateObservation = ModeTri.PAS_DE_TRI; |
triCourantNbCommentaires = ModeTri.PAS_DE_TRI; |
vue.setModeTri(triCourantDate); |
vue.setModeTriPublication(triCourantDatePublication); |
} |
/** |
* Inverser le mode de tri en fonction du précédent |
* */ |
public void toggleModeTriObservation() { |
if (triCourantDateObservation == ModeTri.TRI_ASCENDANT) { |
triCourantDateObservation = ModeTri.TRI_DESCENDANT; |
} else { |
triCourantDateObservation = ModeTri.TRI_ASCENDANT; |
} |
triCourantDatePublication = ModeTri.PAS_DE_TRI; |
triCourantNbCommentaires = ModeTri.PAS_DE_TRI; |
vue.setModeTriObservation(triCourantDateObservation); |
} |
/** |
* Inverser le mode de tri en fonction du précédent |
* */ |
public void toggleModeTriNbCommentaires() { |
if (triCourantNbCommentaires == ModeTri.TRI_ASCENDANT) { |
triCourantNbCommentaires = ModeTri.TRI_DESCENDANT; |
} else { |
triCourantNbCommentaires = ModeTri.TRI_ASCENDANT; |
} |
System.out.println(triCourantNbCommentaires); |
triCourantDateObservation = ModeTri.PAS_DE_TRI; |
triCourantDatePublication = ModeTri.PAS_DE_TRI; |
vue.setModeTriNbCommentaires(triCourantNbCommentaires); |
} |
/** |
* Initialiser les variable de début et fin et lancer le chargement des |
* observations |
* */ |
/trunk/src/org/tela_botanica/del/client/vues/identiplante/resultats/ResultatsIdentiplanteVue.java |
---|
3,6 → 3,7 |
import org.tela_botanica.del.client.modeles.ModeTri; |
import com.google.gwt.core.client.GWT; |
import com.google.gwt.event.dom.client.HasClickHandlers; |
import com.google.gwt.uibinder.client.UiBinder; |
import com.google.gwt.uibinder.client.UiField; |
import com.google.gwt.user.client.ui.Button; |
27,10 → 28,12 |
Panel zoneObservations, zonePaginationHaut, zonePaginationBas, zoneTri; |
@UiField |
Button triParDateAscendant, triParDateDescendant; |
Button triParDateObservationAscendant, triParDateObservationDescendant, |
triParDatePublicationAscendant, triParDatePublicationDescendant, |
triParNbCommentairesAscendant, triParNbCommentairesDescendant; |
@UiField |
Label aucunResultat, labelDate; |
Label aucunResultat, labelDateObservation, labelDatePublication, labelNbCommentaires; |
// Constructeur de la vue |
87,32 → 90,102 |
zoneTri.setVisible(true); |
} |
public Button getTriParDateAscendant() { |
return triParDateAscendant; |
public Button getTriParDateObservationAscendant() { |
return triParDateObservationAscendant; |
} |
public Button getTriParDateDescendant() { |
return triParDateDescendant; |
public Button getTriParDateObservationDescendant() { |
return triParDateObservationDescendant; |
} |
public Button getTriParDatePublicationAscendant() { |
return triParDatePublicationAscendant; |
} |
public Button getTriParDatePublicationDescendant() { |
return triParDatePublicationDescendant; |
} |
@Override |
public Label getLabelDate() { |
return labelDate; |
public Label getLabelDateObservation() { |
return labelDateObservation; |
} |
@Override |
public Label getLabelDatePublication() { |
return labelDatePublication; |
} |
@Override |
public Label getLabelNbCommentaires() { |
return labelNbCommentaires; |
} |
@Override |
public HasClickHandlers getTriParNbCommentairesAscendant() { |
return triParNbCommentairesAscendant; |
} |
@Override |
public HasClickHandlers getTriParNbCommentairesDescendant() { |
return triParNbCommentairesDescendant; |
} |
private void cacherTris() { |
triParDateObservationAscendant.setVisible(false); |
triParDateObservationDescendant.setVisible(false); |
triParDatePublicationDescendant.setVisible(false); |
triParDatePublicationAscendant.setVisible(false); |
triParNbCommentairesAscendant.setVisible(false); |
triParNbCommentairesDescendant.setVisible(false); |
} |
/** |
* En fonction du sens du tri (ascendant ou descendant), on change l'affichage des |
* boutons de tri pour masquer que celui qui doit être cliquable. |
* @param ModeTri le mode Ascendant ou Descendant |
* */ |
public void setModeTri(ModeTri mode) { |
@Override |
public void setModeTriPublication(ModeTri mode) { |
cacherTris(); |
if (mode == ModeTri.TRI_ASCENDANT) { |
triParDateAscendant.setVisible(true); |
triParDateDescendant.setVisible(false); |
triParDatePublicationAscendant.setVisible(true); |
triParDatePublicationDescendant.setVisible(false); |
} else { |
triParDateDescendant.setVisible(true); |
triParDateAscendant.setVisible(false); |
triParDatePublicationDescendant.setVisible(true); |
triParDatePublicationAscendant.setVisible(false); |
} |
} |
/** |
* En fonction du sens du tri (ascendant ou descendant), on change l'affichage des |
* boutons de tri pour masquer que celui qui doit être cliquable. |
* @param ModeTri le mode Ascendant ou Descendant |
* */ |
@Override |
public void setModeTriObservation(ModeTri mode) { |
cacherTris(); |
if (mode == ModeTri.TRI_ASCENDANT) { |
triParDateObservationAscendant.setVisible(true); |
triParDateObservationDescendant.setVisible(false); |
} else { |
triParDateObservationDescendant.setVisible(true); |
triParDateObservationAscendant.setVisible(false); |
} |
} |
@Override |
public void setModeTriNbCommentaires(ModeTri mode) { |
cacherTris(); |
if (mode == ModeTri.TRI_ASCENDANT) { |
triParNbCommentairesAscendant.setVisible(true); |
triParNbCommentairesDescendant.setVisible(false); |
} else { |
triParNbCommentairesDescendant.setVisible(true); |
triParNbCommentairesAscendant.setVisible(false); |
} |
} |
} |