| Line 65... |
Line 65... |
| 65 |
import com.extjs.gxt.ui.client.widget.toolbar.TextToolItem;
|
65 |
import com.extjs.gxt.ui.client.widget.toolbar.TextToolItem;
|
| 66 |
import com.extjs.gxt.ui.client.widget.toolbar.ToolBar;
|
66 |
import com.extjs.gxt.ui.client.widget.toolbar.ToolBar;
|
| 67 |
import com.google.gwt.core.client.GWT;
|
67 |
import com.google.gwt.core.client.GWT;
|
| 68 |
import com.google.gwt.i18n.client.DateTimeFormat;
|
68 |
import com.google.gwt.i18n.client.DateTimeFormat;
|
| 69 |
import com.google.gwt.i18n.client.NumberFormat;
|
69 |
import com.google.gwt.i18n.client.NumberFormat;
|
| - |
|
70 |
import com.google.gwt.user.client.Window;
|
| Line 70... |
Line 71... |
| 70 |
|
71 |
|
| Line 71... |
Line 72... |
| 71 |
public class FormStructureVue extends LayoutContainer implements Rafraichissable {
|
72 |
public class FormStructureVue extends LayoutContainer implements Rafraichissable {
|
| 72 |
|
73 |
|
| 73 |
private Constantes i18nC = null;
|
74 |
private Constantes i18nC = null;
|
| Line 74... |
Line 75... |
| 74 |
private Mediateur mediateur = null;
|
75 |
private Mediateur mediateur = null;
|
| - |
|
76 |
private Modele modele = null ;
|
| Line 75... |
Line 77... |
| 75 |
private Modele modele = null ;
|
77 |
|
| 76 |
|
78 |
private FormPanel structureFormPanneau;
|
| 77 |
private FormPanel structureFormPanneau;
|
79 |
private int tabIndex = 100;
|
| 78 |
|
80 |
|
| Line 214... |
Line 216... |
| 214 |
}
|
216 |
}
|
| Line 215... |
Line 217... |
| 215 |
|
217 |
|
| 216 |
private void ajouterStructure() {
|
218 |
private void ajouterStructure() {
|
| 217 |
Structure structure = new Structure();
|
219 |
Structure structure = new Structure();
|
| - |
|
220 |
structure.setNom(nomStructureChp.getValue());
|
| 218 |
structure.setNom(nomStructureChp.getValue());
|
221 |
if (dateFondationChp.getValue() != null) {
|
| - |
|
222 |
structure.setDateFondation(DateTimeFormat.getFormat("yyyy-MM-dd HH:mm:ss").format(dateFondationChp.getValue()));
|
| Line 219... |
Line 223... |
| 219 |
structure.setDateFondation(DateTimeFormat.getFormat("yyyy-MM-dd HH:mm:ss").format(dateFondationChp.getValue()));
|
223 |
}
|
| 220 |
|
224 |
|
| 221 |
structure.setAdresse(adrChp.getValue());
|
225 |
structure.setAdresse(adrChp.getValue());
|
| 222 |
structure.setCodePostal(cpChp.getValue());
|
226 |
structure.setCodePostal(cpChp.getValue());
|
| Line 647... |
Line 651... |
| 647 |
fieldSetIdentite.setHeading("Identité");
|
651 |
fieldSetIdentite.setHeading("Identité");
|
| 648 |
fieldSetIdentite.setCollapsible(true);
|
652 |
fieldSetIdentite.setCollapsible(true);
|
| 649 |
fieldSetIdentite.setLayout(creerFormLayout(200, LabelAlign.LEFT, 4));
|
653 |
fieldSetIdentite.setLayout(creerFormLayout(200, LabelAlign.LEFT, 4));
|
| Line 650... |
Line 654... |
| 650 |
|
654 |
|
| - |
|
655 |
nomStructureChp = new TextField<String>();
|
| 651 |
nomStructureChp = new TextField<String>();
|
656 |
nomStructureChp.setTabIndex(100);
|
| 652 |
nomStructureChp.setFieldLabel("Nom de la structure");
|
657 |
nomStructureChp.setFieldLabel("Nom de la structure");
|
| 653 |
nomStructureChp.setAllowBlank(false);
|
658 |
nomStructureChp.setAllowBlank(false);
|
| 654 |
nomStructureChp.getMessages().setBlankText("Ce champ est obligatoire.");
|
659 |
nomStructureChp.getMessages().setBlankText("Ce champ est obligatoire.");
|
| Line 663... |
Line 668... |
| 663 |
droite.setLayout(creerFormLayout(0, null, 0));
|
668 |
droite.setLayout(creerFormLayout(0, null, 0));
|
| Line 664... |
Line 669... |
| 664 |
|
669 |
|
| 665 |
ListStore<InterneValeur> acronymes = new ListStore<InterneValeur>();
|
670 |
ListStore<InterneValeur> acronymes = new ListStore<InterneValeur>();
|
| Line 666... |
Line 671... |
| 666 |
acronymes.add(InterneValeurListe.getTypeAcronyme());
|
671 |
acronymes.add(InterneValeurListe.getTypeAcronyme());
|
| - |
|
672 |
|
| 667 |
|
673 |
comboAcronyme = new ComboBox<InterneValeur>();
|
| 668 |
comboAcronyme = new ComboBox<InterneValeur>();
|
674 |
comboAcronyme.setTabIndex(101);
|
| 669 |
comboAcronyme.setEmptyText("Sélectioner un type d'acronyme...");
|
675 |
comboAcronyme.setEmptyText("Sélectioner un type d'acronyme...");
|
| 670 |
comboAcronyme.setFieldLabel("Acronymes");
|
676 |
comboAcronyme.setFieldLabel("Acronymes");
|
| 671 |
comboAcronyme.setDisplayField("nom");
|
677 |
comboAcronyme.setDisplayField("nom");
|
| Line 692... |
Line 698... |
| 692 |
});
|
698 |
});
|
| 693 |
gauche.add(comboAcronyme);
|
699 |
gauche.add(comboAcronyme);
|
| Line 694... |
Line 700... |
| 694 |
|
700 |
|
| 695 |
ihChp = new TextField<String>();
|
701 |
ihChp = new TextField<String>();
|
| - |
|
702 |
//ihChp.setEmptyText("Index Herbariorum");
|
| 696 |
//ihChp.setEmptyText("Index Herbariorum");
|
703 |
ihChp.setTabIndex(102);
|
| 697 |
ihChp.setLabelSeparator("");
|
704 |
ihChp.setLabelSeparator("");
|
| 698 |
ihChp.setToolTip("Index Herbariorum : herbier de plus de 5000 échantillons");
|
705 |
ihChp.setToolTip("Index Herbariorum : herbier de plus de 5000 échantillons");
|
| 699 |
ihChp.hide();
|
706 |
ihChp.hide();
|
| Line 700... |
Line 707... |
| 700 |
droite.add(ihChp);
|
707 |
droite.add(ihChp);
|
| - |
|
708 |
|
| 701 |
|
709 |
mnhnChp = new TextField<String>();
|
| 702 |
mnhnChp = new TextField<String>();
|
710 |
mnhnChp.setTabIndex(103);
|
| 703 |
//mnhnChp.setEmptyText("MNHN");
|
711 |
//mnhnChp.setEmptyText("MNHN");
|
| 704 |
mnhnChp.setLabelSeparator("");
|
712 |
mnhnChp.setLabelSeparator("");
|
| 705 |
mnhnChp.setToolTip("Acronyme MNHN : herbier de moins de 5000 échantillons");
|
713 |
mnhnChp.setToolTip("Acronyme MNHN : herbier de moins de 5000 échantillons");
|
| Line 721... |
Line 729... |
| 721 |
droiteTs.setLayout(creerFormLayout(0, null, 0));
|
729 |
droiteTs.setLayout(creerFormLayout(0, null, 0));
|
| Line 722... |
Line 730... |
| 722 |
|
730 |
|
| 723 |
ListStore<InterneValeur> typesStructure = new ListStore<InterneValeur>();
|
731 |
ListStore<InterneValeur> typesStructure = new ListStore<InterneValeur>();
|
| Line 724... |
Line 732... |
| 724 |
typesStructure.add(InterneValeurListe.getTypeStructure());
|
732 |
typesStructure.add(InterneValeurListe.getTypeStructure());
|
| - |
|
733 |
|
| 725 |
|
734 |
comboTypeStructure = new ComboBox<InterneValeur>();
|
| 726 |
this.comboTypeStructure = new ComboBox<InterneValeur>();
|
735 |
comboTypeStructure.setTabIndex(104);
|
| 727 |
comboTypeStructure.setEmptyText("Sélectioner un type de structure...");
|
736 |
comboTypeStructure.setEmptyText("Sélectioner un type de structure...");
|
| 728 |
comboTypeStructure.setFieldLabel("Statut des structures");
|
737 |
comboTypeStructure.setFieldLabel("Statut des structures");
|
| 729 |
comboTypeStructure.setDisplayField("nom");
|
738 |
comboTypeStructure.setDisplayField("nom");
|
| Line 751... |
Line 760... |
| 751 |
gaucheTs.add(comboTypeStructure);
|
760 |
gaucheTs.add(comboTypeStructure);
|
| Line 752... |
Line 761... |
| 752 |
|
761 |
|
| 753 |
modele.obtenirListeValeurs(((Configuration) Registry.get(RegistreId.CONFIG)).getListeId("stpu"));
|
762 |
modele.obtenirListeValeurs(((Configuration) Registry.get(RegistreId.CONFIG)).getListeId("stpu"));
|
| 754 |
magazinLstpu = new ListStore<Valeur>();
|
763 |
magazinLstpu = new ListStore<Valeur>();
|
| 755 |
magazinLstpu.add(new ArrayList<Valeur>());
|
764 |
magazinLstpu.add(new ArrayList<Valeur>());
|
| - |
|
765 |
comboLstpu = new ComboBox<Valeur>();
|
| 756 |
comboLstpu = new ComboBox<Valeur>();
|
766 |
comboLstpu.setTabIndex(105);
|
| 757 |
//comboLstpu.setFieldLabel("Statut des structures publiques");
|
767 |
//comboLstpu.setFieldLabel("Statut des structures publiques");
|
| 758 |
comboLstpu.setLabelSeparator("");
|
768 |
comboLstpu.setLabelSeparator("");
|
| 759 |
comboLstpu.setDisplayField("nom");
|
769 |
comboLstpu.setDisplayField("nom");
|
| 760 |
comboLstpu.setEditable(false);
|
770 |
comboLstpu.setEditable(false);
|
| Line 764... |
Line 774... |
| 764 |
droiteTs.add(comboLstpu);
|
774 |
droiteTs.add(comboLstpu);
|
| Line 765... |
Line 775... |
| 765 |
|
775 |
|
| 766 |
modele.obtenirListeValeurs(((Configuration) Registry.get(RegistreId.CONFIG)).getListeId("stpr"));
|
776 |
modele.obtenirListeValeurs(((Configuration) Registry.get(RegistreId.CONFIG)).getListeId("stpr"));
|
| 767 |
magazinLstpr = new ListStore<Valeur>();
|
777 |
magazinLstpr = new ListStore<Valeur>();
|
| 768 |
magazinLstpr.add(new ArrayList<Valeur>());
|
778 |
magazinLstpr.add(new ArrayList<Valeur>());
|
| - |
|
779 |
comboLstpr = new ComboBox<Valeur>();
|
| 769 |
comboLstpr = new ComboBox<Valeur>();
|
780 |
comboLstpr.setTabIndex(106);
|
| 770 |
//comboLstpr.setFieldLabel("Statut des structures privées");
|
781 |
//comboLstpr.setFieldLabel("Statut des structures privées");
|
| 771 |
comboLstpr.setLabelSeparator("");
|
782 |
comboLstpr.setLabelSeparator("");
|
| 772 |
comboLstpr.setDisplayField("nom");
|
783 |
comboLstpr.setDisplayField("nom");
|
| 773 |
comboLstpr.setEditable(false);
|
784 |
comboLstpr.setEditable(false);
|
| Line 779... |
Line 790... |
| 779 |
ligneTs.add(gaucheTs, new ColumnData(0.5));
|
790 |
ligneTs.add(gaucheTs, new ColumnData(0.5));
|
| 780 |
ligneTs.add(droiteTs, new ColumnData(0.5));
|
791 |
ligneTs.add(droiteTs, new ColumnData(0.5));
|
| 781 |
fieldSetIdentite.add(ligneTs);
|
792 |
fieldSetIdentite.add(ligneTs);
|
| Line 782... |
Line 793... |
| 782 |
|
793 |
|
| - |
|
794 |
dateFondationChp = new DateField();
|
| 783 |
dateFondationChp = new DateField();
|
795 |
dateFondationChp.setTabIndex(107);
|
| 784 |
dateFondationChp.setFieldLabel("Date de fondation");
|
796 |
dateFondationChp.setFieldLabel("Date de fondation");
|
| 785 |
dateFondationChp.getPropertyEditor().getFormat();
|
797 |
dateFondationChp.getPropertyEditor().getFormat();
|
| 786 |
dateFondationChp.getPropertyEditor().setFormat(DateTimeFormat.getFormat("dd/MM/yyyy"));
|
798 |
dateFondationChp.getPropertyEditor().setFormat(DateTimeFormat.getFormat("dd/MM/yyyy"));
|
| 787 |
dateFondationChp.getMessages().setInvalidText("La valeur saisie n'est pas une date valide. La date doit être au format «jj/mm/aaaa».");
|
799 |
dateFondationChp.getMessages().setInvalidText("La valeur saisie n'est pas une date valide. La date doit être au format «jj/mm/aaaa».");
|
| Line 804... |
Line 816... |
| 804 |
fieldSetAdresse.setHeading("Adresse");
|
816 |
fieldSetAdresse.setHeading("Adresse");
|
| 805 |
fieldSetAdresse.setCollapsible(true);
|
817 |
fieldSetAdresse.setCollapsible(true);
|
| Line 806... |
Line 818... |
| 806 |
|
818 |
|
| Line 807... |
Line 819... |
| 807 |
fieldSetAdresse.setLayout(creerFormLayout(100, LabelAlign.LEFT, 4));
|
819 |
fieldSetAdresse.setLayout(creerFormLayout(100, LabelAlign.LEFT, 4));
|
| - |
|
820 |
|
| 808 |
|
821 |
adrChp = new TextField<String>();
|
| 809 |
adrChp = new TextField<String>();
|
822 |
adrChp.setTabIndex(108);
|
| Line 810... |
Line 823... |
| 810 |
adrChp.setFieldLabel("Adresse");
|
823 |
adrChp.setFieldLabel("Adresse");
|
| - |
|
824 |
fieldSetAdresse.add(adrChp, new FormData(550, 0));
|
| 811 |
fieldSetAdresse.add(adrChp, new FormData(550, 0));
|
825 |
|
| 812 |
|
826 |
cpChp = new TextField<String>();
|
| Line 813... |
Line 827... |
| 813 |
cpChp = new TextField<String>();
|
827 |
cpChp.setTabIndex(109);
|
| - |
|
828 |
cpChp.setFieldLabel("Code postal");
|
| 814 |
cpChp.setFieldLabel("Code postal");
|
829 |
gaucheFdAdresse.add(cpChp);
|
| 815 |
gaucheFdAdresse.add(cpChp);
|
830 |
|
| Line 816... |
Line 831... |
| 816 |
|
831 |
villeChp = new TextField<String>();
|
| - |
|
832 |
villeChp.setTabIndex(110);
|
| 817 |
villeChp = new TextField<String>();
|
833 |
villeChp.setFieldLabel("Ville");
|
| 818 |
villeChp.setFieldLabel("Ville");
|
834 |
droiteFdAdresse.add(villeChp);
|
| Line 819... |
Line 835... |
| 819 |
droiteFdAdresse.add(villeChp);
|
835 |
|
| - |
|
836 |
regionChp = new TextField<String>();
|
| 820 |
|
837 |
regionChp.setTabIndex(111);
|
| 821 |
regionChp = new TextField<String>();
|
838 |
regionChp.setFieldLabel("Région");
|
| Line 822... |
Line 839... |
| 822 |
regionChp.setFieldLabel("Région");
|
839 |
gaucheFdAdresse.add(regionChp);
|
| 823 |
gaucheFdAdresse.add(regionChp);
|
840 |
|
| Line 846... |
Line 863... |
| 846 |
fieldSetTelMail.setHeading("Communication");
|
863 |
fieldSetTelMail.setHeading("Communication");
|
| 847 |
fieldSetTelMail.setCollapsible(true);
|
864 |
fieldSetTelMail.setCollapsible(true);
|
| Line 848... |
Line 865... |
| 848 |
|
865 |
|
| Line 849... |
Line 866... |
| 849 |
fieldSetTelMail.setLayout(creerFormLayout(200, LabelAlign.LEFT, 4));
|
866 |
fieldSetTelMail.setLayout(creerFormLayout(200, LabelAlign.LEFT, 4));
|
| - |
|
867 |
|
| 850 |
|
868 |
telChp = new TextField<String>();
|
| 851 |
telChp = new TextField<String>();
|
869 |
telChp.setTabIndex(113);
|
| Line 852... |
Line 870... |
| 852 |
telChp.setFieldLabel("Téléphone");
|
870 |
telChp.setFieldLabel("Téléphone");
|
| - |
|
871 |
gaucheFdTelMail.add(telChp);
|
| 853 |
gaucheFdTelMail.add(telChp);
|
872 |
|
| 854 |
|
873 |
faxChp = new TextField<String>();
|
| Line 855... |
Line 874... |
| 855 |
faxChp = new TextField<String>();
|
874 |
faxChp.setTabIndex(114);
|
| - |
|
875 |
faxChp.setFieldLabel("Fax");
|
| 856 |
faxChp.setFieldLabel("Fax");
|
876 |
droiteFdTelMail.add(faxChp);
|
| 857 |
droiteFdTelMail.add(faxChp);
|
877 |
|
| 858 |
|
878 |
emailChp = new TextField<String>();
|
| Line 859... |
Line 879... |
| 859 |
emailChp = new TextField<String>();
|
879 |
emailChp.setTabIndex(115);
|
| - |
|
880 |
emailChp.setFieldLabel("Courriel");
|
| 860 |
emailChp.setFieldLabel("Courriel");
|
881 |
emailChp.setToolTip("Saisir le courriel de l'organisation, pas de courriel individuel. Ex. : accueil@organisation.org");
|
| 861 |
emailChp.setToolTip("Saisir le courriel de l'organisation, pas de courriel individuel. Ex. : accueil@organisation.org");
|
882 |
gaucheFdTelMail.add(emailChp);
|
| Line 862... |
Line 883... |
| 862 |
gaucheFdTelMail.add(emailChp);
|
883 |
|
| 863 |
|
884 |
urlChp = new TextField<String>();
|
| Line 928... |
Line 949... |
| 928 |
//radioBtn.setId(val.getId()+"_"+radioBtn.getName());
|
949 |
//radioBtn.setId(val.getId()+"_"+radioBtn.getName());
|
| 929 |
radioBtn.setBoxLabel(val.getNom());
|
950 |
radioBtn.setBoxLabel(val.getNom());
|
| 930 |
radioBtn.addListener(Events.Change, new Listener<ComponentEvent>() {
|
951 |
radioBtn.addListener(Events.Change, new Listener<ComponentEvent>() {
|
| Line 931... |
Line 952... |
| 931 |
|
952 |
|
| 932 |
public void handleEvent(ComponentEvent be) {
|
953 |
public void handleEvent(ComponentEvent be) {
|
| 933 |
//Window.alert(((Radio) be.source).getId());
|
954 |
//Window.alert(((Radio) be.component).getName());
|
| 934 |
afficherChampSupplementaire(((Radio) be.source));
|
955 |
afficherChampSupplementaire(((Radio) be.component));
|
| Line 935... |
Line 956... |
| 935 |
}
|
956 |
}
|
| Line 936... |
Line 957... |
| 936 |
|
957 |
|