Subversion Repositories eFlore/Archives.cel-v1

Compare Revisions

Ignore whitespace Rev 7 → Rev 8

/trunk/src/org/tela_botanica/client/TaxonList.java
36,6 → 36,8
import com.google.gwt.user.client.ui.ClickListener;
import com.google.gwt.user.client.ui.HasHorizontalAlignment;
import com.google.gwt.user.client.ui.HasVerticalAlignment;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.Window;
 
/*
* Le retour de getUser appelle getCount qui appelle update pour veiller à une
61,13 → 63,23
public final Button gotoEnd = new Button(">>", this);
 
public final HTML status = new HTML();
 
public NavBar() {
initWidget(bar);
bar.setStyleName("navbar");
status.setStyleName("status");
HorizontalPanel buttons = new HorizontalPanel();
buttons.add(status);
buttons.setCellHorizontalAlignment(status,
HasHorizontalAlignment.ALIGN_RIGHT);
buttons.setCellVerticalAlignment(status,
HasVerticalAlignment.ALIGN_MIDDLE);
buttons.setCellWidth(status, "100%");
 
HorizontalPanel buttons = new HorizontalPanel();
 
buttons.add(gotoFirst);
buttons.add(gotoPrev);
buttons.add(gotoNext);
74,14 → 86,82
buttons.add(gotoEnd);
bar.add(buttons, DockPanel.EAST);
bar.setCellHorizontalAlignment(buttons, DockPanel.ALIGN_RIGHT);
bar.add(status, DockPanel.CENTER);
 
 
 
VerticalPanel actions = new VerticalPanel();
HorizontalPanel actionButton = new HorizontalPanel();
/*
actionButton.add(new Button("Ajout",
new ClickListener() {
public void onClick(Widget sender) {
deleteElement();
}
}
));
 
*/
actionButton.add(new Button("Suppression",
new ClickListener() {
public void onClick(Widget sender) {
deleteElement();
}
}
));
 
actionButton.add(new Button("Tout exporter",
new ClickListener() {
public void onClick(Widget sender) {
exportAll();
}
}
));
 
actions.add(actionButton);
HorizontalPanel selections = new HorizontalPanel();
selections.setSpacing(3);
actions.add(selections);
 
selections.add(new HTML("Sélection : "));
Label all = new Label("Tous,");
Label none = new Label("Aucun");
selections.add(all);
all.addClickListener(
new ClickListener() {
public void onClick(Widget sender) {
selectAll();
}
}
);
selections.add(none);
none.addClickListener(
new ClickListener() {
public void onClick(Widget sender) {
deselectAll();
}
}
);
bar.add(actions, DockPanel.WEST);
bar.setCellHorizontalAlignment(buttons, DockPanel.ALIGN_LEFT);
 
bar.setVerticalAlignment(DockPanel.ALIGN_MIDDLE);
bar.setCellHorizontalAlignment(status,
HasHorizontalAlignment.ALIGN_RIGHT);
bar.setCellVerticalAlignment(status,
HasVerticalAlignment.ALIGN_MIDDLE);
bar.setCellWidth(status, "100%");
 
}
 
public void onClick(Widget sender) {
305,7 → 385,27
setStatusEnabled();
}
}
/**
* Selection de l'ensemble des elements affichés
*
*/
 
public void selectAll() {
 
for (int i = table.getRowCount() - 1; i >= 0; i--) {
((CheckBox) table.getWidget(i, 0)).setChecked(true);
}
}
 
public void deselectAll() {
for (int i = table.getRowCount() - 1; i >= 0; i--) {
((CheckBox) table.getWidget(i, 0)).setChecked(false);
}
}
 
 
/**
*
* Lancement des initialisations dependantes de réponses asynchrones : le
497,9 → 597,9
navBar.gotoNext.setEnabled(true);
navBar.gotoEnd.setEnabled(true);
setStatusText((startIndex + 1) + " - "
+ (startIndex + VISIBLE_TAXON_COUNT));
+ (startIndex + VISIBLE_TAXON_COUNT) + " sur " + count );
} else { // Derniere page
setStatusText((startIndex + 1) + " - " + count);
setStatusText((startIndex + 1) + " - " + count + " sur " + count );
}
} else { // Premiere page
if (count > VISIBLE_TAXON_COUNT) { // Des pages derrieres
506,19 → 606,19
navBar.gotoNext.setEnabled(true);
navBar.gotoEnd.setEnabled(true);
setStatusText((startIndex + 1) + " - "
+ (startIndex + VISIBLE_TAXON_COUNT));
+ (startIndex + VISIBLE_TAXON_COUNT) + " sur " + count);
} else {
setStatusText((startIndex + 1) + " - " + count);
setStatusText((startIndex + 1) + " - " + count + " sur " + count);
}
}
}
 
else { // Pas d'inventaire, pas de navigation
setStatusText(0 + " - " + 0);
setStatusText("0 - 0 sur 0");
}
}
 
/**
/*
* Positionnement index de parcours (this.startIndex) pour affichage de la
* dernière page
*
536,4 → 636,17
 
}
 
/*
* Export du releve affiche dans un format tableur
*
* @param
* @return void
*/
 
private void exportAll() {
Window.open(serviceBaseUrl+"/InventoryExport/" +user + "/","_self","");
}
 
}