| 28 |
ddelon |
1 |
/**
|
|
|
2 |
David Delon david.delon@clapas.net 2007
|
|
|
3 |
|
|
|
4 |
*/
|
|
|
5 |
|
|
|
6 |
/*
|
|
|
7 |
* ActionView.java : affichage actions sur releves saisie ou affiches (suppression, export etc...)
|
|
|
8 |
*
|
|
|
9 |
* TODO : appel de fonction du mediator, au lieu de passer par les methode de la classe de gestion d'affichage des releves (voir les TODO dans le
|
|
|
10 |
* corps de ce programme)
|
|
|
11 |
*
|
|
|
12 |
* 1: Le programme affiche les boutons commandant les actions sur les releves et arme les actions correspondantes
|
|
|
13 |
* - Transmission d'elements (vers tela botanica)
|
|
|
14 |
* - Suppression d'elements selectionnes
|
|
|
15 |
* - Export vers tableur
|
|
|
16 |
* - Selection / Deselection des releves affiches
|
|
|
17 |
*/
|
|
|
18 |
|
|
|
19 |
package org.tela_botanica.client;
|
|
|
20 |
|
|
|
21 |
|
|
|
22 |
import net.mygwt.ui.client.Style;
|
| 29 |
ddelon |
23 |
import net.mygwt.ui.client.event.BaseEvent;
|
|
|
24 |
import net.mygwt.ui.client.event.SelectionListener;
|
|
|
25 |
import net.mygwt.ui.client.widget.Button;
|
| 30 |
ddelon |
26 |
import net.mygwt.ui.client.widget.IconButton;
|
| 28 |
ddelon |
27 |
import net.mygwt.ui.client.widget.WidgetContainer;
|
|
|
28 |
import net.mygwt.ui.client.widget.layout.BorderLayoutData;
|
|
|
29 |
|
|
|
30 |
import com.google.gwt.user.client.Window;
|
|
|
31 |
import com.google.gwt.user.client.ui.HTML;
|
|
|
32 |
import com.google.gwt.user.client.ui.HorizontalPanel;
|
| 29 |
ddelon |
33 |
|
| 28 |
ddelon |
34 |
public class ActionView {
|
|
|
35 |
|
|
|
36 |
private Mediator mediator=null;
|
|
|
37 |
private HTML exportButton=null;
|
|
|
38 |
|
|
|
39 |
|
|
|
40 |
public ActionView(final Mediator med) {
|
|
|
41 |
|
|
|
42 |
mediator=med;
|
|
|
43 |
|
|
|
44 |
HorizontalPanel panel = new HorizontalPanel();
|
|
|
45 |
HorizontalPanel buttons = new HorizontalPanel();
|
|
|
46 |
buttons.setSpacing(3);
|
|
|
47 |
|
|
|
48 |
|
|
|
49 |
// Transmission d'elements
|
| 29 |
ddelon |
50 |
|
|
|
51 |
Button transButton= new Button("Transmettre Tela Botanica",
|
|
|
52 |
new SelectionListener() {
|
|
|
53 |
public void widgetSelected(BaseEvent be) {
|
| 28 |
ddelon |
54 |
if (mediator.getConnected()) {
|
|
|
55 |
mediator.getInventoryListView().transmitElement();
|
|
|
56 |
}
|
|
|
57 |
else {
|
|
|
58 |
Window.alert("Identifiez-vous pour transmettre");
|
|
|
59 |
}
|
|
|
60 |
}
|
|
|
61 |
}
|
|
|
62 |
);
|
|
|
63 |
|
|
|
64 |
buttons.add(transButton);
|
|
|
65 |
|
| 30 |
ddelon |
66 |
|
| 28 |
ddelon |
67 |
// Suppression d'elements
|
| 29 |
ddelon |
68 |
|
|
|
69 |
Button delButton = new Button("Suppression",
|
|
|
70 |
new SelectionListener() {
|
|
|
71 |
public void widgetSelected(BaseEvent be) {
|
| 28 |
ddelon |
72 |
// TODO : une action dans le mediator
|
|
|
73 |
mediator.getInventoryListView().deleteElement();
|
|
|
74 |
}
|
|
|
75 |
}
|
|
|
76 |
);
|
|
|
77 |
|
|
|
78 |
buttons.add(delButton);
|
|
|
79 |
|
|
|
80 |
// Export (renseigne lors de l'affichage des releves )
|
|
|
81 |
|
|
|
82 |
exportButton=new HTML();
|
|
|
83 |
buttons.add(exportButton);
|
|
|
84 |
|
|
|
85 |
panel.add(buttons);
|
|
|
86 |
|
|
|
87 |
WidgetContainer center=mediator.getCenterContainer();
|
|
|
88 |
BorderLayoutData centerData = new BorderLayoutData(Style.SOUTH, .05f, 100, 300);
|
|
|
89 |
center.add(panel,centerData);
|
|
|
90 |
|
|
|
91 |
|
|
|
92 |
}
|
|
|
93 |
|
|
|
94 |
|
|
|
95 |
public HTML getExportButton() {
|
|
|
96 |
return exportButton;
|
|
|
97 |
}
|
|
|
98 |
}
|
|
|
99 |
|
|
|
100 |
|
|
|
101 |
|
|
|
102 |
/* +--Fin du code ---------------------------------------------------------------------------------------+
|
|
|
103 |
* $Log$
|
| 30 |
ddelon |
104 |
* Revision 1.2 2008-01-30 08:55:40 ddelon
|
|
|
105 |
* fin mise en place mygwt
|
|
|
106 |
*
|
| 29 |
ddelon |
107 |
* Revision 1.1 2008-01-02 21:26:05 ddelon
|
|
|
108 |
* mise en place mygwt
|
|
|
109 |
*
|
| 28 |
ddelon |
110 |
* Revision 1.5 2007-12-22 14:48:53 ddelon
|
|
|
111 |
* Documentation et refactorisation
|
|
|
112 |
*
|
|
|
113 |
* Revision 1.5 2007-09-17 19:25:34 ddelon
|
|
|
114 |
* Documentation
|
|
|
115 |
*
|
|
|
116 |
*
|
|
|
117 |
*/
|