| Line 1... |
Line 1... |
| 1 |
package org.tela_botanica.client.vues;
|
1 |
package org.tela_botanica.client.vues;
|
| Line -... |
Line 2... |
| - |
|
2 |
|
| 2 |
|
3 |
import java.util.ArrayList;
|
| 3 |
import java.util.Iterator;
|
4 |
import java.util.Iterator;
|
| - |
|
5 |
import java.util.LinkedList;
|
| Line 4... |
Line 6... |
| 4 |
import java.util.LinkedList;
|
6 |
import java.util.List;
|
| 5 |
|
7 |
|
| 6 |
import org.tela_botanica.client.Mediateur;
|
8 |
import org.tela_botanica.client.Mediateur;
|
| 7 |
import org.tela_botanica.client.i18n.Constantes;
|
9 |
import org.tela_botanica.client.i18n.Constantes;
|
| Line 17... |
Line 19... |
| 17 |
import com.extjs.gxt.ui.client.event.KeyListener;
|
19 |
import com.extjs.gxt.ui.client.event.KeyListener;
|
| 18 |
import com.extjs.gxt.ui.client.event.SelectionChangedEvent;
|
20 |
import com.extjs.gxt.ui.client.event.SelectionChangedEvent;
|
| 19 |
import com.extjs.gxt.ui.client.event.SelectionChangedListener;
|
21 |
import com.extjs.gxt.ui.client.event.SelectionChangedListener;
|
| 20 |
import com.extjs.gxt.ui.client.event.SelectionListener;
|
22 |
import com.extjs.gxt.ui.client.event.SelectionListener;
|
| 21 |
import com.extjs.gxt.ui.client.store.ListStore;
|
23 |
import com.extjs.gxt.ui.client.store.ListStore;
|
| - |
|
24 |
import com.extjs.gxt.ui.client.store.StoreEvent;
|
| - |
|
25 |
import com.extjs.gxt.ui.client.store.StoreListener;
|
| 22 |
import com.extjs.gxt.ui.client.widget.Text;
|
26 |
import com.extjs.gxt.ui.client.widget.Text;
|
| 23 |
import com.extjs.gxt.ui.client.widget.button.Button;
|
27 |
import com.extjs.gxt.ui.client.widget.button.Button;
|
| - |
|
28 |
import com.extjs.gxt.ui.client.widget.form.ComboBox.TriggerAction;
|
| 24 |
import com.extjs.gxt.ui.client.widget.form.SimpleComboBox;
|
29 |
import com.extjs.gxt.ui.client.widget.form.SimpleComboBox;
|
| - |
|
30 |
import com.extjs.gxt.ui.client.widget.form.SimpleComboValue;
|
| 25 |
import com.extjs.gxt.ui.client.widget.form.TextField;
|
31 |
import com.extjs.gxt.ui.client.widget.form.TextField;
|
| 26 |
import com.extjs.gxt.ui.client.widget.toolbar.FillToolItem;
|
32 |
import com.extjs.gxt.ui.client.widget.toolbar.FillToolItem;
|
| 27 |
import com.extjs.gxt.ui.client.widget.toolbar.SeparatorToolItem;
|
33 |
import com.extjs.gxt.ui.client.widget.toolbar.SeparatorToolItem;
|
| 28 |
import com.extjs.gxt.ui.client.widget.toolbar.ToolBar;
|
34 |
import com.extjs.gxt.ui.client.widget.toolbar.ToolBar;
|
| 29 |
import com.google.gwt.event.dom.client.KeyCodes;
|
35 |
import com.google.gwt.event.dom.client.KeyCodes;
|
| 30 |
import com.google.gwt.i18n.client.Dictionary;
|
36 |
import com.google.gwt.i18n.client.Dictionary;
|
| - |
|
37 |
import com.google.gwt.user.client.Window;
|
| Line 31... |
Line 38... |
| 31 |
|
38 |
|
| Line 32... |
Line 39... |
| 32 |
public class BarrePaginationVue extends ToolBar implements Rafraichissable {
|
39 |
public class BarrePaginationVue extends ToolBar implements Rafraichissable {
|
| 33 |
|
40 |
|
| Line 43... |
Line 50... |
| 43 |
private int taillePage = Integer.valueOf(((Dictionary) Dictionary.getDictionary("configuration")).get("nbElementsPage"));
|
50 |
private int taillePage = Integer.valueOf(((Dictionary) Dictionary.getDictionary("configuration")).get("nbElementsPage"));
|
| 44 |
private int pageTotale = 1;
|
51 |
private int pageTotale = 1;
|
| 45 |
private Text page, surTotalPage, afficherNbElem, nbElemParPage, intervalleElements;
|
52 |
private Text page, surTotalPage, afficherNbElem, nbElemParPage, intervalleElements;
|
| Line 46... |
Line 53... |
| 46 |
|
53 |
|
| 47 |
private TextField<String> champPage = new TextField<String>();
|
54 |
private TextField<String> champPage = new TextField<String>();
|
| 48 |
private SimpleComboBox selecteurTaillePage = new SimpleComboBox();
|
55 |
private SimpleComboBox<Integer> selecteurTaillePage = new SimpleComboBox<Integer>();
|
| 49 |
private Text labelFiltre;
|
56 |
private Text labelFiltre;
|
| 50 |
private TextField<String> filtre;
|
57 |
private TextField<String> filtre;
|
| 51 |
private Button annulerFiltre;
|
58 |
private Button annulerFiltre;
|
| 52 |
private boolean filtreActive = false;
|
59 |
private boolean filtreActive = false;
|
| Line 140... |
Line 147... |
| 140 |
|
147 |
|
| 141 |
afficherNbElem = new Text(i18nC.afficher());
|
148 |
afficherNbElem = new Text(i18nC.afficher());
|
| 142 |
afficherNbElem.setStyleAttribute("padding", "0 5px 0 5px");
|
149 |
afficherNbElem.setStyleAttribute("padding", "0 5px 0 5px");
|
| Line 143... |
Line -... |
| 143 |
add(afficherNbElem);
|
- |
|
| - |
|
150 |
add(afficherNbElem);
|
| - |
|
151 |
|
| - |
|
152 |
// Attention l'appel à setTriggerAction avec ALL est indispensable
|
| - |
|
153 |
// pour éviter un bug lors de la selection de la taille de page par défaut
|
| 144 |
|
154 |
selecteurTaillePage.setTriggerAction(TriggerAction.ALL);
|
| 145 |
|
155 |
selecteurTaillePage.setLazyRender(false);
|
| 146 |
selecteurTaillePage.setWidth("40px");
|
156 |
selecteurTaillePage.setWidth("40px");
|
| Line 147... |
Line 157... |
| 147 |
setIntervallesPages();
|
157 |
setIntervallesPages();
|
| Line 200... |
Line 210... |
| 200 |
intervallePages.add(taillePage);
|
210 |
intervallePages.add(taillePage);
|
| 201 |
}
|
211 |
}
|
| Line 202... |
Line 212... |
| 202 |
|
212 |
|
| 203 |
Iterator<Integer> itIntervallePages = intervallePages.iterator();
|
213 |
Iterator<Integer> itIntervallePages = intervallePages.iterator();
|
| - |
|
214 |
while (itIntervallePages.hasNext()) {
|
| 204 |
while (itIntervallePages.hasNext()) {
|
215 |
Integer intervalle = itIntervallePages.next();
|
| 205 |
selecteurTaillePage.add(itIntervallePages.next());
|
216 |
selecteurTaillePage.add(intervalle);
|
| 206 |
}
|
217 |
}
|
| 207 |
|
218 |
|
| 208 |
selecteurTaillePage.setSimpleValue(taillePage);
|
219 |
selecteurTaillePage.setSimpleValue(taillePage);
|
| Line 209... |
Line 220... |
| 209 |
}
|
220 |
}
|
| 210 |
|
221 |
|