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); |
} |
} |
} |