New file |
0,0 → 1,93 |
package org.tela_botanica.del.client.vues.searchobservations; |
|
import java.util.List; |
|
import org.tela_botanica.del.client.modeles.Observation; |
import org.tela_botanica.del.client.modeles.ObservationValidationData; |
|
import com.google.gwt.user.client.ui.Composite; |
import com.google.gwt.user.client.ui.HTML; |
import com.google.gwt.user.client.ui.HorizontalPanel; |
import com.google.gwt.user.client.ui.Image; |
import com.google.gwt.user.client.ui.Panel; |
import com.google.gwt.user.client.ui.VerticalPanel; |
|
public class ObservationView extends Composite { |
|
private final Panel flowPanel = new VerticalPanel(); |
|
private final Panel detailsPanel = new VerticalPanel(); |
|
private final HTML moreDetailsHtml = new HTML( |
"<img src='img/icon_plus.gif' alig='center'>"); |
|
private final Image waitImage = new Image("img/wait.gif"); |
|
private final HTML proposeValidationDataHtml = new HTML( |
"<a>Cliquez ici pour proposer votre validation</a>"); |
|
private final HTML noValidationDataHtml = new HTML( |
"Pas de validation actuellement."); |
|
private final Panel ratePanel = new HorizontalPanel(); |
|
protected ObservationView() { |
flowPanel.add(waitImage); |
initWidget(flowPanel); |
} |
|
protected void loadImage(Observation observation) { |
|
flowPanel.clear(); |
flowPanel.add(new HTML(observation.getSpecies())); |
flowPanel.add(new HTML(observation.getAuteur())); |
flowPanel.add(new HTML( |
"<a href='http://www.tela-botanica.org/eflore/BDNFF/4.02/nn/" |
+ observation.getNumNomenclatural() |
+ "' target='_blank'><img src='" + observation.getUrl() |
+ "' /img></a>")); |
flowPanel.add(moreDetailsHtml); |
flowPanel.add(detailsPanel); |
flowPanel.add(ratePanel); |
} |
|
protected void showValidationData( |
List<ObservationValidationData> validationDatas) { |
|
if (validationDatas == null || validationDatas.size() == 0) { |
flowPanel.add(noValidationDataHtml); |
} |
flowPanel.add(proposeValidationDataHtml); |
|
} |
|
protected void clearDetails() { |
detailsPanel.clear(); |
moreDetailsHtml.setHTML("<img src='img/icon_plus.gif' >"); |
} |
|
public Panel getFlowPanel() { |
return flowPanel; |
} |
|
public Panel getDetailsPanel() { |
return detailsPanel; |
} |
|
public HTML getMoreDetailsHtml() { |
return moreDetailsHtml; |
} |
|
public HTML getNoValidationDataHtml() { |
return noValidationDataHtml; |
} |
|
public HTML getProposeValidationDataHtml() { |
return proposeValidationDataHtml; |
} |
|
public Panel getRatePanel() { |
return ratePanel; |
} |
|
} |