Line 15... |
Line 15... |
15 |
|
15 |
|
16 |
import com.extjs.gxt.ui.client.Registry;
|
16 |
import com.extjs.gxt.ui.client.Registry;
|
17 |
import com.extjs.gxt.ui.client.Style.SelectionMode;
|
17 |
import com.extjs.gxt.ui.client.Style.SelectionMode;
|
18 |
import com.extjs.gxt.ui.client.Style.SortDir;
|
18 |
import com.extjs.gxt.ui.client.Style.SortDir;
|
- |
|
19 |
import com.extjs.gxt.ui.client.binder.TableBinder;
|
19 |
import com.extjs.gxt.ui.client.binder.TableBinder;
|
20 |
import com.extjs.gxt.ui.client.event.ButtonEvent;
|
20 |
import com.extjs.gxt.ui.client.event.ComponentEvent;
|
21 |
import com.extjs.gxt.ui.client.event.ComponentEvent;
|
21 |
import com.extjs.gxt.ui.client.event.SelectionChangedEvent;
|
22 |
import com.extjs.gxt.ui.client.event.SelectionChangedEvent;
|
22 |
import com.extjs.gxt.ui.client.event.SelectionChangedListener;
|
23 |
import com.extjs.gxt.ui.client.event.SelectionChangedListener;
|
23 |
import com.extjs.gxt.ui.client.event.SelectionListener;
|
24 |
import com.extjs.gxt.ui.client.event.SelectionListener;
|
24 |
import com.extjs.gxt.ui.client.store.ListStore;
|
25 |
import com.extjs.gxt.ui.client.store.ListStore;
|
25 |
import com.extjs.gxt.ui.client.widget.ContentPanel;
|
26 |
import com.extjs.gxt.ui.client.widget.ContentPanel;
|
- |
|
27 |
import com.extjs.gxt.ui.client.widget.Info;
|
26 |
import com.extjs.gxt.ui.client.widget.Info;
|
28 |
import com.extjs.gxt.ui.client.widget.button.Button;
|
27 |
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
|
29 |
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
|
28 |
import com.extjs.gxt.ui.client.widget.table.Table;
|
30 |
import com.extjs.gxt.ui.client.widget.table.Table;
|
29 |
import com.extjs.gxt.ui.client.widget.table.TableColumn;
|
31 |
import com.extjs.gxt.ui.client.widget.table.TableColumn;
|
30 |
import com.extjs.gxt.ui.client.widget.table.TableColumnModel;
|
32 |
import com.extjs.gxt.ui.client.widget.table.TableColumnModel;
|
31 |
import com.extjs.gxt.ui.client.widget.table.TableItem;
|
- |
|
32 |
import com.extjs.gxt.ui.client.widget.toolbar.TextToolItem;
|
33 |
import com.extjs.gxt.ui.client.widget.table.TableItem;
|
33 |
import com.extjs.gxt.ui.client.widget.toolbar.ToolBar;
|
34 |
import com.extjs.gxt.ui.client.widget.toolbar.ToolBar;
|
Line 34... |
Line 35... |
34 |
import com.google.gwt.core.client.GWT;
|
35 |
import com.google.gwt.core.client.GWT;
|
Line 40... |
Line 41... |
40 |
|
41 |
|
41 |
private Table table = null;
|
42 |
private Table table = null;
|
42 |
private ListStore<Structure> store = null;
|
43 |
private ListStore<Structure> store = null;
|
Line 43... |
Line 44... |
43 |
private TableBinder<Structure> binder = null;
|
44 |
private TableBinder<Structure> binder = null;
|
44 |
|
45 |
|
45 |
private TextToolItem modifier;
|
46 |
private Button modifier;
|
Line 46... |
Line 47... |
46 |
private TextToolItem supprimer;
|
47 |
private Button supprimer;
|
47 |
private TextToolItem ajouter;
|
48 |
private Button ajouter;
|
48 |
|
49 |
|
Line 49... |
Line 50... |
49 |
public StructureListeVue(Mediateur mediateurCourant) {
|
50 |
public StructureListeVue(Mediateur mediateurCourant) {
|
Line 50... |
Line 51... |
50 |
mediateur = mediateurCourant;
|
51 |
mediateur = mediateurCourant;
|
51 |
i18nC = mediateur.i18nC;
|
52 |
i18nC = mediateur.i18nC;
|
52 |
|
53 |
|
53 |
Utilisateur utilisateur = (Utilisateur) Registry.get(RegistreId.UTILISATEUR_COURANT);
|
54 |
Utilisateur utilisateur = (Utilisateur) Registry.get(RegistreId.UTILISATEUR_COURANT);
|
54 |
|
55 |
|
55 |
ToolBar toolBar = new ToolBar();
|
56 |
ToolBar toolBar = new ToolBar();
|
56 |
ajouter = new TextToolItem(i18nC.ajouter());
|
57 |
ajouter = new Button(i18nC.ajouter());
|
57 |
ajouter.setIconStyle(ComposantClass.ICONE_AJOUTER);
|
58 |
ajouter.setIconStyle(ComposantClass.ICONE_AJOUTER);
|
58 |
ajouter.addSelectionListener(new SelectionListener<ComponentEvent>() {
|
59 |
ajouter.addSelectionListener(new SelectionListener<ButtonEvent>() {
|
Line 59... |
Line 60... |
59 |
public void componentSelected(ComponentEvent ce) {
|
60 |
public void componentSelected(ButtonEvent ce) {
|
60 |
mediateur.clicAjouterStructure();
|
61 |
mediateur.clicAjouterStructure();
|
61 |
}
|
62 |
}
|
62 |
});
|
63 |
});
|
63 |
toolBar.add(ajouter);
|
64 |
toolBar.add(ajouter);
|
64 |
|
65 |
|
65 |
modifier = new TextToolItem(i18nC.modifier());
|
66 |
modifier = new Button(i18nC.modifier());
|
66 |
modifier.setIconStyle(ComposantClass.ICONE_MODIFIER);
|
67 |
modifier.setIconStyle(ComposantClass.ICONE_MODIFIER);
|
Line 67... |
Line 68... |
67 |
modifier.addSelectionListener(new SelectionListener<ComponentEvent>() {
|
68 |
modifier.addSelectionListener(new SelectionListener<ButtonEvent>() {
|
68 |
public void componentSelected(ComponentEvent ce) {
|
69 |
public void componentSelected(ButtonEvent ce) {
|
69 |
mediateur.clicModifierStructure(binder.getSelection());
|
70 |
mediateur.clicModifierStructure(binder.getSelection());
|
70 |
}
|
71 |
}
|
71 |
});
|
72 |
});
|
72 |
toolBar.add(modifier);
|
73 |
toolBar.add(modifier);
|
73 |
|
74 |
|
74 |
supprimer = new TextToolItem(i18nC.supprimer());
|
75 |
supprimer = new Button(i18nC.supprimer());
|
75 |
supprimer.setIconStyle(ComposantClass.ICONE_SUPPRIMER);
|
76 |
supprimer.setIconStyle(ComposantClass.ICONE_SUPPRIMER);
|
Line 132... |
Line 133... |
132 |
store.add(liste);
|
133 |
store.add(liste);
|
Line 133... |
Line 134... |
133 |
|
134 |
|
Line 134... |
Line 135... |
134 |
mediateur.actualiserPanneauCentral();
|
135 |
mediateur.actualiserPanneauCentral();
|
- |
|
136 |
|
135 |
|
137 |
if (store.getCount() > 0) {
|
136 |
if (store.getCount() > 0) {
|
138 |
//TODO : check below:
|
137 |
table.getSelectionModel().select(0);
|
139 |
table.getSelectionModel().select(0, 1, true);
|
138 |
}
|
140 |
}
|
139 |
} else if (nouvelleDonnees instanceof Information) {
|
141 |
} else if (nouvelleDonnees instanceof Information) {
|
140 |
Information info = (Information) nouvelleDonnees;
|
142 |
Information info = (Information) nouvelleDonnees;
|