| Line 24... |
Line 24... |
| 24 |
import com.extjs.gxt.ui.client.event.SelectionListener;
|
24 |
import com.extjs.gxt.ui.client.event.SelectionListener;
|
| 25 |
import com.extjs.gxt.ui.client.store.ListStore;
|
25 |
import com.extjs.gxt.ui.client.store.ListStore;
|
| 26 |
import com.extjs.gxt.ui.client.widget.LayoutContainer;
|
26 |
import com.extjs.gxt.ui.client.widget.LayoutContainer;
|
| 27 |
import com.extjs.gxt.ui.client.widget.TabItem;
|
27 |
import com.extjs.gxt.ui.client.widget.TabItem;
|
| 28 |
import com.extjs.gxt.ui.client.widget.TabPanel;
|
28 |
import com.extjs.gxt.ui.client.widget.TabPanel;
|
| 29 |
import com.extjs.gxt.ui.client.widget.button.Button;
|
- |
|
| 30 |
import com.extjs.gxt.ui.client.widget.button.ButtonBar;
|
29 |
import com.extjs.gxt.ui.client.widget.button.ButtonBar;
|
| 31 |
import com.extjs.gxt.ui.client.widget.form.CheckBox;
|
30 |
import com.extjs.gxt.ui.client.widget.form.CheckBox;
|
| 32 |
import com.extjs.gxt.ui.client.widget.form.CheckBoxGroup;
|
31 |
import com.extjs.gxt.ui.client.widget.form.CheckBoxGroup;
|
| 33 |
import com.extjs.gxt.ui.client.widget.form.ComboBox;
|
32 |
import com.extjs.gxt.ui.client.widget.form.ComboBox;
|
| 34 |
import com.extjs.gxt.ui.client.widget.form.Field;
|
33 |
import com.extjs.gxt.ui.client.widget.form.Field;
|
| Line 38... |
Line 37... |
| 38 |
import com.extjs.gxt.ui.client.widget.form.FormPanel.LabelAlign;
|
37 |
import com.extjs.gxt.ui.client.widget.form.FormPanel.LabelAlign;
|
| 39 |
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
|
38 |
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
|
| 40 |
import com.extjs.gxt.ui.client.widget.layout.FormData;
|
39 |
import com.extjs.gxt.ui.client.widget.layout.FormData;
|
| 41 |
import com.extjs.gxt.ui.client.widget.layout.FormLayout;
|
40 |
import com.extjs.gxt.ui.client.widget.layout.FormLayout;
|
| 42 |
import com.extjs.gxt.ui.client.widget.tips.ToolTipConfig;
|
41 |
import com.extjs.gxt.ui.client.widget.tips.ToolTipConfig;
|
| 43 |
import com.extjs.gxt.ui.client.widget.toolbar.FillToolItem;
|
- |
|
| 44 |
import com.google.gwt.core.client.GWT;
|
42 |
import com.google.gwt.core.client.GWT;
|
| 45 |
import com.google.gwt.user.client.ui.AbstractImagePrototype;
|
- |
|
| Line 46... |
Line 43... |
| 46 |
|
43 |
|
| Line 47... |
Line 44... |
| 47 |
public abstract class Formulaire extends LayoutContainer implements Rafraichissable {
|
44 |
public abstract class Formulaire extends LayoutContainer implements Rafraichissable {
|
| 48 |
|
45 |
|
| Line 49... |
Line -... |
| 49 |
public static final String MODE_AJOUTER = "AJOUT";
|
- |
|
| 50 |
public static final String MODE_MODIFIER = "MODIF";
|
- |
|
| 51 |
|
- |
|
| 52 |
public static final String CODE_BOUTON_VALIDER = "VA";
|
- |
|
| 53 |
public static final String CODE_BOUTON_APPLIQUER = "AP";
|
- |
|
| 54 |
public static final String CODE_BOUTON_ANNULER = "AN";
|
46 |
public static final String MODE_AJOUTER = "AJOUT";
|
| 55 |
public static final String CODE_BOUTON_REINITIALISER = "RE";
|
47 |
public static final String MODE_MODIFIER = "MODIF";
|
| 56 |
|
48 |
|
| Line 57... |
Line 49... |
| 57 |
protected Constantes i18nC = null;
|
49 |
protected Constantes i18nC = null;
|
| 58 |
protected Mediateur mediateur = null;
|
50 |
protected Mediateur mediateur = null;
|
| Line 59... |
Line 51... |
| 59 |
protected Configuration config = null;
|
51 |
protected Configuration config = null;
|
| 60 |
|
52 |
|
| 61 |
protected String mode = null;
|
- |
|
| 62 |
protected int tabIndex = 100;
|
53 |
protected String mode = null;
|
| 63 |
|
54 |
protected int tabIndex = 100;
|
| 64 |
protected FormPanel panneauFormulaire = null;
|
55 |
|
| - |
|
56 |
protected FormPanel panneauFormulaire = null;
|
| - |
|
57 |
protected ButtonBar barreOutilsValidation = null;
|
| - |
|
58 |
|
| - |
|
59 |
protected String menuIdCourant = null;
|
| Line 65... |
Line 60... |
| 65 |
protected ButtonBar barreOutilsValidation = null;
|
60 |
protected static Boolean clicBoutonvalidation = false;
|
| 66 |
protected TabPanel onglets = null;
|
61 |
|
| 67 |
|
62 |
public FormPanel getFormulaire() {
|
| 68 |
protected String menuIdCourant = null;
|
63 |
return panneauFormulaire;
|
| Line 82... |
Line 77... |
| 82 |
|
77 |
|
| 83 |
// Création du panneau du FORMULAIRE GÉNÉRAL
|
78 |
// Création du panneau du FORMULAIRE GÉNÉRAL
|
| 84 |
panneauFormulaire = new FormPanel();
|
79 |
panneauFormulaire = new FormPanel();
|
| 85 |
panneauFormulaire.setBodyBorder(false);
|
80 |
panneauFormulaire.setBodyBorder(false);
|
| 86 |
panneauFormulaire.setFrame(true);
|
- |
|
| 87 |
panneauFormulaire.setIcon(Images.ICONES.formAjouter());
|
81 |
panneauFormulaire.setFrame(true);
|
| 88 |
panneauFormulaire.setCollapsible(false);
|
- |
|
| 89 |
panneauFormulaire.setHeading(i18nC.titreAjoutFormStructurePanneau());
|
82 |
panneauFormulaire.setCollapsible(false);
|
| 90 |
panneauFormulaire.setButtonAlign(HorizontalAlignment.CENTER);
|
83 |
panneauFormulaire.setButtonAlign(HorizontalAlignment.CENTER);
|
| - |
|
84 |
panneauFormulaire.setLayout(new FitLayout());
|
| - |
|
85 |
|
| - |
|
86 |
if (modeDeCreation.equals(MODE_AJOUTER)) {
|
| - |
|
87 |
panneauFormulaire.setIcon(Images.ICONES.formAjouter());
|
| - |
|
88 |
} else if (modeDeCreation.equals(MODE_AJOUTER)) {
|
| - |
|
89 |
panneauFormulaire.setIcon(Images.ICONES.formModifier());
|
| Line 91... |
Line 90... |
| 91 |
panneauFormulaire.setLayout(new FitLayout());
|
90 |
}
|
| 92 |
|
91 |
|
| Line 93... |
Line 92... |
| 93 |
creerOnglets();
|
92 |
barreOutilsValidation = new FormulaireBarreValidation(creerEcouteurValidation());
|
| 94 |
creerBarreOutilsValidation();
|
93 |
panneauFormulaire.setBottomComponent(barreOutilsValidation);
|
| Line 95... |
Line 94... |
| 95 |
|
94 |
|
| Line -... |
Line 95... |
| - |
|
95 |
add(panneauFormulaire);
|
| - |
|
96 |
}
|
| 96 |
add(panneauFormulaire);
|
97 |
|
| 97 |
}
|
98 |
protected abstract SelectionListener<ButtonEvent> creerEcouteurValidation();
|
| 98 |
|
99 |
|
| 99 |
protected abstract void creerOnglets();
|
100 |
protected abstract void soumettreFormulaire();
|
| 100 |
|
101 |
|
| 101 |
protected TabItem creerOnglet(String nom, String id) {
|
102 |
protected TabItem creerOnglet(String nom, String id) {
|
| 102 |
TabItem onglet = new TabItem();
|
103 |
TabItem onglet = new TabItem();
|
| 103 |
onglet.setId(id);
|
- |
|
| 104 |
onglet.setText(nom);
|
- |
|
| 105 |
FormulaireOnglet.parametrer(onglet);
|
- |
|
| 106 |
return onglet;
|
- |
|
| 107 |
}
|
- |
|
| 108 |
|
- |
|
| 109 |
protected void creerBarreOutilsValidation() {
|
- |
|
| 110 |
barreOutilsValidation = new ButtonBar();
|
- |
|
| 111 |
barreOutilsValidation.setAlignment(HorizontalAlignment.LEFT);
|
- |
|
| 112 |
|
- |
|
| 113 |
barreOutilsValidation.add(creerBoutonFormulaire(i18nC.reinitialiser(), Images.ICONES.reinitialiser(), CODE_BOUTON_REINITIALISER));
|
- |
|
| 114 |
|
- |
|
| 115 |
barreOutilsValidation.add(new FillToolItem());
|
- |
|
| 116 |
|
- |
|
| 117 |
barreOutilsValidation.add(creerBoutonFormulaire(i18nC.appliquer(), Images.ICONES.appliquer(), CODE_BOUTON_APPLIQUER));
|
- |
|
| 118 |
|
- |
|
| 119 |
barreOutilsValidation.add(creerBoutonFormulaire(i18nC.annuler(), Images.ICONES.annuler(), CODE_BOUTON_ANNULER));
|
- |
|
| 120 |
|
- |
|
| 121 |
barreOutilsValidation.add(creerBoutonFormulaire(i18nC.valider(), Images.ICONES.valider(), CODE_BOUTON_VALIDER));
|
- |
|
| 122 |
|
- |
|
| 123 |
panneauFormulaire.setBottomComponent(barreOutilsValidation);
|
- |
|
| 124 |
}
|
- |
|
| 125 |
|
- |
|
| 126 |
protected Button creerBoutonFormulaire(String nom, AbstractImagePrototype icone, final String code) {
|
- |
|
| 127 |
SelectionListener<ButtonEvent> ecouteur = creerEcouteurBoutonFormulaire(code);
|
- |
|
| 128 |
Button bouton = creerBouton(nom, icone, ecouteur);
|
- |
|
| 129 |
return bouton;
|
- |
|
| 130 |
}
|
- |
|
| 131 |
|
- |
|
| 132 |
protected abstract SelectionListener<ButtonEvent> creerEcouteurBoutonFormulaire(final String code);
|
- |
|
| 133 |
|
- |
|
| 134 |
protected Button creerBouton(String nom, AbstractImagePrototype icone, SelectionListener<ButtonEvent> ecouteur) {
|
- |
|
| 135 |
Button bouton = new Button(nom);
|
- |
|
| 136 |
bouton.setIcon(icone);
|
- |
|
| 137 |
bouton.addSelectionListener(ecouteur);
|
- |
|
| 138 |
|
- |
|
| Line 139... |
Line 104... |
| 139 |
return bouton;
|
104 |
onglet.setId(id);
|
| 140 |
}
|
105 |
onglet.setText(nom);
|
| 141 |
|
106 |
FormulaireOnglet.parametrer(onglet);
|
| 142 |
protected abstract void soumettreFormulaire();
|
107 |
return onglet;
|
| Line 212... |
Line 177... |
| 212 |
}
|
177 |
}
|
| 213 |
radioGroupe.add(radioBtn);
|
178 |
radioGroupe.add(radioBtn);
|
| 214 |
}
|
179 |
}
|
| 215 |
}
|
180 |
}
|
| Line 216... |
Line 181... |
| 216 |
|
181 |
|
| - |
|
182 |
protected void afficherChampSupplementaire(Radio radioBtn) {
|
| 217 |
protected abstract void afficherChampSupplementaire(Radio radioBtn);
|
183 |
GWT.log("Vous devez redéfinir la méthode afficherChampSupplementaire(Radio radioBtn) dans votre classe formulaire.", null);
|
| Line 218... |
Line 184... |
| 218 |
|
184 |
};
|
| 219 |
|
185 |
|
| 220 |
/** Méthode simplifiant la création de choix multiple sous forme de case à cocher.
|
186 |
/** Méthode simplifiant la création de choix multiple sous forme de case à cocher.
|
| 221 |
* Apelle un service retournant la liste des valeurs représentant les cases à cocher.
|
187 |
* Apelle un service retournant la liste des valeurs représentant les cases à cocher.
|