<pathelement path="../auth-dgcp/build/classes"/>
<pathelement path="../swing-utils/build/classes"/>
<pathelement path="../starter/build/classes"/>
+ <pathelement path="../xemelios-core/build/classes"/>
+ <pathelement path="../xml-marshall/build/classes"/>
<fileset dir="../core/lib" includes="*.jar"/>
<fileset dir="../swing-utils/lib" includes="*.jar"/>
</classpath>
xsi:noNamespaceSchemaLocation="../../defs/technical-component-definition.xsd">
<name>auth-std-db</name>
<description>Authentification avancée permettant de gérer les droits finement</description>
- <release>5.0.0.5</release>
+ <release>5.0.0.6</release>
<url>http://xemelios.org/updatesV5/auth-std-db</url>
<type>COMPOSANT</type>
<destination>
<component-ref url="http://xemelios.org/updatesV5/swing-utils" release="5.0.0.0"/>
</requires>
<release-notes>
+ <release v="5.0.0.6">
+ <note visibility="public">Possibilité d'aller chercher des collectivités dans le référentiel SPL</note>
+ <note visibility="public">Panneau des utilisateurs: la recherche se déclenche quand on saisit ENTER dans le champ de filtrage des utilisateurs</note>
+ <note visibility="public">Panneau des utilisateurs: correction du tab order entre les champs des propriétés des utilisateurs</note>
+ <note visibility="public">Fenêtre des collectivités d'un utilisateur: correction de la suppression des collectivités quand le tableau est trié</note>
+ <note visibility="public">Création de collectivité: suprression de l'import du référentiel</note>
+ </release>
<release v="5.0.0.5">
<note visibility="dev">Déplacement de SimpleXemeliosUserImpl</note>
</release>
ps.executeUpdate();
} catch(SQLException sqlEx) {
logger.error("createProfil(Profil)",sqlEx);
+ return false;
} finally {
if(ps!=null) {
try {
<Group type="102" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
- <Component id="tab" alignment="0" pref="519" max="32767" attributes="0"/>
+ <Component id="tab" alignment="0" pref="625" max="32767" attributes="0"/>
<Component id="pbClose" alignment="1" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
initComponents();
setLocationRelativeTo(getParent());
tab.add("Profils", new PnlProfils(this,DataHelper.getProfils()));
- tab.add("Utilisateurs",new PnlUsers(this, applicationProperties));
+ tab.add("Utilisateurs",new PnlUsers(this, applicationProperties, getConnectedUser()));
}
public XemeliosUser getConnectedUser() {
XemeliosUser ret = connectedUser;
}
return ret;
}
+ @Override
protected JRootPane createRootPane() {
KeyStroke ks = KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE,0);
JRootPane rp = new JRootPane();
*/
private static final long serialVersionUID = 1L;
+ @Override
public void actionPerformed(ActionEvent evt) {
pbCloseActionPerformed(evt);
}
.add(layout.createSequentialGroup()
.addContainerGap()
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
- .add(tab, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 519, Short.MAX_VALUE)
+ .add(tab, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 625, Short.MAX_VALUE)
.add(org.jdesktop.layout.GroupLayout.TRAILING, pbClose))
.addContainerGap())
);
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<Form version="1.3" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JDialogFormInfo">
+ <Properties>
+ <Property name="defaultCloseOperation" type="int" value="2"/>
+ </Properties>
+ <SyntheticProperties>
+ <SyntheticProperty name="formSizePolicy" type="int" value="1"/>
+ </SyntheticProperties>
+ <AuxValues>
+ <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
+ <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
+ <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
+ <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
+ <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
+ <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
+ <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
+ <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
+ <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
+ </AuxValues>
+
+ <Layout>
+ <DimensionLayout dim="0">
+ <Group type="103" groupAlignment="0" attributes="0">
+ <Component id="pnl" alignment="0" pref="991" max="32767" attributes="0"/>
+ <Group type="102" alignment="1" attributes="0">
+ <EmptySpace max="-2" attributes="0"/>
+ <Component id="pbClose" min="-2" max="-2" attributes="0"/>
+ </Group>
+ </Group>
+ </DimensionLayout>
+ <DimensionLayout dim="1">
+ <Group type="103" groupAlignment="0" attributes="0">
+ <Group type="102" alignment="1" attributes="0">
+ <Component id="pnl" pref="28" max="32767" attributes="0"/>
+ <EmptySpace type="unrelated" max="-2" attributes="0"/>
+ <Component id="pbClose" min="-2" max="-2" attributes="0"/>
+ <EmptySpace min="-2" max="-2" attributes="0"/>
+ </Group>
+ </Group>
+ </DimensionLayout>
+ </Layout>
+ <SubComponents>
+ <Container class="javax.swing.JPanel" name="pnl">
+
+ <Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
+ </Container>
+ <Component class="javax.swing.JButton" name="pbClose">
+ <Properties>
+ <Property name="action" type="javax.swing.Action" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
+ <Connection code="closeAction" type="code"/>
+ </Property>
+ <Property name="text" type="java.lang.String" value="Fermer"/>
+ </Properties>
+ </Component>
+ </SubComponents>
+</Form>
--- /dev/null
+/*
+ * Copyright
+ * 2011 axYus - http://www.axyus.com
+ * 2011 C.Marchand - christophe.marchand@axyus.com
+ *
+ * This file is part of XEMELIOS_NB.
+ *
+ * XEMELIOS_NB is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * XEMELIOS_NB is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with XEMELIOS_NB; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+/*
+ * Perme de rechercher un budget
+ *
+ * Created on 8 déc. 2011, 10:15:50
+ */
+
+package fr.gouv.finances.dgfip.xemelios.auth.impl.std.db.ui;
+
+import fr.gouv.finances.cp.utils.PropertiesExpansion;
+import fr.gouv.finances.cp.xemelios.ui.resulttable.EtatResultTableModel;
+import fr.gouv.finances.cp.xemelios.ui.search.PnlSearch;
+import fr.gouv.finances.dgfip.utils.Pair;
+import fr.gouv.finances.dgfip.xemelios.auth.XemeliosUser;
+import fr.gouv.finances.dgfip.xemelios.common.config.DocumentModel;
+import fr.gouv.finances.dgfip.xemelios.common.config.ElementModel;
+import fr.gouv.finances.dgfip.xemelios.common.config.EtatModel;
+import fr.gouv.finances.dgfip.xemelios.common.config.HiddenModel;
+import fr.gouv.finances.dgfip.xemelios.common.config.Loader;
+import fr.gouv.finances.dgfip.xemelios.data.DataHandler;
+import fr.gouv.finances.dgfip.xemelios.swing.InfiniteGlassPane;
+import java.awt.Rectangle;
+import java.awt.event.ActionEvent;
+import java.awt.event.KeyEvent;
+import java.awt.event.MouseEvent;
+import javax.swing.AbstractAction;
+import javax.swing.JComponent;
+import javax.swing.JDialog;
+import javax.swing.JRootPane;
+import javax.swing.KeyStroke;
+import org.jdesktop.swingx.JXTable;
+
+/**
+ *
+ * @author cmarchand
+ */
+public class DlgBrowseReferentiel extends javax.swing.JDialog {
+ private PnlSearch searchPanel;
+ private AbstractAction closeAction;
+ private Pair collectivite;
+
+ /** Creates new form DlgBrowseReferentiel */
+ public DlgBrowseReferentiel(JDialog parent, XemeliosUser user, PropertiesExpansion applicationProperties) {
+ super(parent, "Choix du Budget", true);
+ DocumentModel __ref = null;
+ try {
+ __ref = Loader.getConfigurationFromLoadedFiles().getDocumentById("ref-collec-spl");
+ } catch(Exception ex) {
+ return;
+ }
+ final DocumentModel referentielDocumentModel = __ref;
+ final EtatModel etatModel = referentielDocumentModel.getEtatById("Referentiel");
+ ElementModel elementModel = etatModel.getElementById("Collectivite");
+ PnlSearch.DisplayParameters displayParameters = new PnlSearch.DisplayParameters();
+ displayParameters.setWidgetsVisible(false);
+ try {
+ searchPanel = new PnlSearch(referentielDocumentModel, etatModel, elementModel, displayParameters, user, applicationProperties) {
+ @Override
+ public void resizeParent(Rectangle bounds) { }
+ @Override
+ public void actionOnRowPerformed(MouseEvent evt, int row) {
+ row=((JXTable)getTable()).convertRowIndexToModel(row);
+ EtatResultTableModel etrm = (EtatResultTableModel)getTable().getModel();
+ DataHandler dh = etrm.getRowAt(row,0);
+ String id=null, libelle=null;
+ for(int pos=0;pos<etrm.getHiddens().size();pos++) {
+ HiddenModel hm = etrm.getHiddens().get(pos);
+ if(hm.getName().equals("idColl")) {
+ id = dh.getValueAtColumn(etrm.getListeChamps().size()+pos).toString();
+ } else if("libelle".equals(hm.getName())) {
+ libelle = dh.getValueAtColumn(etrm.getListeChamps().size()+pos).toString();
+ }
+ }
+ DlgBrowseReferentiel.this.collectivite = new Pair(id, libelle);
+ DlgBrowseReferentiel.this.setVisible(false);
+ }
+ @Override
+ public String getTitle() {
+ return etatModel.getTitre();
+ }
+ @Override
+ public void notifyParentStateChanged() { }
+ @Override
+ public void iconify(boolean iconified) { }
+ @Override
+ public void setTitle(String newTitle) { }
+ @Override
+ public void redisplayTitle() { }
+ @Override
+ public void startWaiter() {
+ getGlassPane().setVisible(true);
+ }
+ @Override
+ public void stopWaiter() {
+ getGlassPane().setVisible(false);
+ }
+ @Override
+ public boolean canExport() {
+ return false;
+ }
+ };
+ } catch(Exception tEx) {
+ // qu'est-ce qu'on en fait ?
+ }
+ initComponents();
+ setGlassPane(new InfiniteGlassPane());
+ pnl.add(searchPanel);
+ pack();
+ setLocationRelativeTo(getParent());
+ }
+
+ public Pair run() {
+ setVisible(true);
+ return collectivite;
+ }
+
+ /** This method is called from within the constructor to
+ * initialize the form.
+ * WARNING: Do NOT modify this code. The content of this method is
+ * always regenerated by the Form Editor.
+ */
+ @SuppressWarnings("unchecked")
+ // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
+ private void initComponents() {
+
+ pnl = new javax.swing.JPanel();
+ pbClose = new javax.swing.JButton();
+
+ setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
+
+ pnl.setLayout(new java.awt.BorderLayout());
+
+ pbClose.setAction(closeAction);
+ pbClose.setText("Fermer");
+
+ javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
+ getContentPane().setLayout(layout);
+ layout.setHorizontalGroup(
+ layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addComponent(pnl, javax.swing.GroupLayout.DEFAULT_SIZE, 991, Short.MAX_VALUE)
+ .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
+ .addContainerGap()
+ .addComponent(pbClose))
+ );
+ layout.setVerticalGroup(
+ layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
+ .addComponent(pnl, javax.swing.GroupLayout.DEFAULT_SIZE, 28, Short.MAX_VALUE)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
+ .addComponent(pbClose)
+ .addContainerGap())
+ );
+
+ pack();
+ }// </editor-fold>//GEN-END:initComponents
+
+ @Override
+ protected JRootPane createRootPane() {
+ closeAction = new AbstractAction("Fermer") {
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ collectivite=null;
+ setVisible(false);
+ }
+ };
+ KeyStroke ks = KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE,0);
+ JRootPane rp = new JRootPane();
+ rp.registerKeyboardAction(closeAction,"CLOSE",ks,JComponent.WHEN_IN_FOCUSED_WINDOW);
+ return rp;
+ }
+
+ // Variables declaration - do not modify//GEN-BEGIN:variables
+ private javax.swing.JButton pbClose;
+ private javax.swing.JPanel pnl;
+ // End of variables declaration//GEN-END:variables
+
+}
import fr.gouv.finances.cp.utils.PropertiesExpansion;
import fr.gouv.finances.dgfip.xemelios.auth.Collectivite;
+import fr.gouv.finances.dgfip.xemelios.auth.XemeliosUser;
import fr.gouv.finances.dgfip.xemelios.auth.impl.std.db.DataHelper;
import fr.gouv.finances.dgfip.xemelios.auth.impl.std.db.DataHelper.CollectiviteLib;
import java.awt.event.ActionEvent;
import java.awt.event.KeyEvent;
import java.util.ArrayList;
-import java.util.Arrays;
import java.util.Hashtable;
import javax.swing.AbstractAction;
import javax.swing.JComponent;
private DataHelper.StdUser user;
private TableCollectivitesModel collectivitesUserModel;
private boolean bRet;
+ private XemeliosUser connectedUser;
private PropertiesExpansion applicationProperties;
/** Creates new form DlgCollectivitesUtilisateur */
- public DlgCollectivitesUtilisateur(java.awt.Dialog parent, DataHelper.StdUser user, PropertiesExpansion applicationProperties) {
+ public DlgCollectivitesUtilisateur(java.awt.Dialog parent, DataHelper.StdUser user, PropertiesExpansion applicationProperties, XemeliosUser connectedUser) {
super(parent, "Collectivités", true);
this.user=user;
this.applicationProperties = applicationProperties;
+ this.connectedUser = connectedUser;
collectivitesUserModel = new TableCollectivitesModel(user.getCollectivites());
initComponents();
tblCollectivitesUser.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
+ @Override
public void valueChanged(ListSelectionEvent e) {
pbRemoveCollectivite.setEnabled(tblCollectivitesUser.getSelectedRowCount()>0);
}
}//GEN-LAST:event_pbOkActionPerformed
private void pbAddCollectiviteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_pbAddCollectiviteActionPerformed
- DlgSelectCollectivite dlg = new DlgSelectCollectivite(this, this.applicationProperties);
+ DlgSelectCollectivite dlg = new DlgSelectCollectivite(this, connectedUser, this.applicationProperties);
if(dlg.run()) {
for(CollectiviteLib coll: dlg.getSelectedData()) {
collectivitesUserModel.addCollectivite(coll);
private void pbRemoveCollectiviteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_pbRemoveCollectiviteActionPerformed
int[] rows = tblCollectivitesUser.getSelectedRows();
- Arrays.sort(rows);
+ ArrayList<CollectiviteLib> toRemove = new ArrayList<CollectiviteLib>();
for(int i=rows.length-1;i>=0;i--) {
- collectivitesUserModel.removeRow(rows[i]);
+ toRemove.add(collectivitesUserModel.getDataAtRow(tblCollectivitesUser.convertRowIndexToModel(rows[i])));
}
+ collectivitesUserModel.data.removeAll(toRemove);
+ collectivitesUserModel.fireTableDataChanged();
}//GEN-LAST:event_pbRemoveCollectiviteActionPerformed
*/
private static final long serialVersionUID = 1L;
+ @Override
public void actionPerformed(ActionEvent evt) {
pbCancelActionPerformed(evt);
}
this.data=data;
}
+ @Override
public int getRowCount() {
return data.size();
}
+ @Override
public int getColumnCount() {
return 3;
}
+ @Override
public Object getValueAt(int rowIndex, int columnIndex) {
CollectiviteLib coll = data.get(rowIndex);
switch(columnIndex) {
}
return coll;
}
- public CollectiviteLib removeRow(int row) {
- CollectiviteLib ret = data.remove(row);
- fireTableRowsDeleted(row, row);
- return ret;
+ public CollectiviteLib getDataAtRow(int row) {
+ return data.get(row);
}
+// public CollectiviteLib removeRow(int row) {
+// CollectiviteLib ret = data.remove(row);
+// fireTableRowsDeleted(row, row);
+// return ret;
+// }
@Override
public String getColumnName(int column) {
public void run() {
setVisible(true);
}
+ @Override
protected JRootPane createRootPane() {
KeyStroke ks = KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE,0);
JRootPane rp = new JRootPane();
<Group type="102" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
- <Component id="tabs" alignment="0" pref="640" max="32767" attributes="0"/>
+ <Component id="tabs" alignment="0" pref="639" max="32767" attributes="0"/>
<Group type="102" alignment="1" attributes="0">
<Component id="pbCancel" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
package fr.gouv.finances.dgfip.xemelios.auth.impl.std.db.ui;
import fr.gouv.finances.cp.utils.PropertiesExpansion;
+import fr.gouv.finances.dgfip.xemelios.auth.XemeliosUser;
import fr.gouv.finances.dgfip.xemelios.auth.impl.std.db.DataHelper;
import fr.gouv.finances.dgfip.xemelios.swing.InfiniteGlassPane;
import java.awt.event.ActionEvent;
private PropertiesExpansion applicationProperties;
/** Creates new form DlgSelectCollectivite */
- public DlgSelectCollectivite(java.awt.Dialog parent, PropertiesExpansion applicationProperties) {
+ public DlgSelectCollectivite(java.awt.Dialog parent, XemeliosUser user, PropertiesExpansion applicationProperties) {
super(parent, "Ajouter des collectivités", true);
this.applicationProperties = applicationProperties;
initComponents();
pnlSearch = new PnlSearchCollectivite();
tabs.add("Recherche", pnlSearch);
- pnlCreate = new PnlCreateCollectivite(this, applicationProperties);
+ pnlCreate = new PnlCreateCollectivite(this, user, applicationProperties);
tabs.add("Création",pnlCreate);
setGlassPane(new InfiniteGlassPane());
setLocationRelativeTo(parent);
.add(layout.createSequentialGroup()
.addContainerGap()
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
- .add(tabs, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 640, Short.MAX_VALUE)
+ .add(tabs, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 639, Short.MAX_VALUE)
.add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
.add(pbCancel)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
- <EmptySpace max="-2" attributes="0"/>
+ <EmptySpace min="-2" max="-2" attributes="0"/>
<Group type="103" groupAlignment="1" attributes="0">
- <Component id="jPanel2" alignment="0" max="32767" attributes="1"/>
- <Component id="jPanel1" alignment="0" min="-2" max="-2" attributes="1"/>
+ <Component id="pnlBrowse" alignment="0" max="32767" attributes="2"/>
+ <Component id="jPanel1" alignment="0" max="32767" attributes="2"/>
</Group>
- <EmptySpace max="32767" attributes="0"/>
+ <EmptySpace min="-2" max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<EmptySpace max="-2" attributes="0"/>
<Component id="jPanel1" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
- <Component id="jPanel2" min="-2" max="-2" attributes="0"/>
- <EmptySpace pref="18" max="32767" attributes="0"/>
+ <Component id="pnlBrowse" min="-2" max="-2" attributes="0"/>
+ <EmptySpace pref="31" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Group>
</Group>
</Group>
- <EmptySpace pref="106" max="32767" attributes="0"/>
+ <EmptySpace pref="45" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Component>
</SubComponents>
</Container>
- <Container class="javax.swing.JPanel" name="jPanel2">
+ <Container class="javax.swing.JPanel" name="pnlBrowse">
<Properties>
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
<Border info="org.netbeans.modules.form.compat2.border.TitledBorderInfo">
- <TitledBorder title="Importer le référentiel de Collectivités / Budgets"/>
+ <TitledBorder title="Chercher un budget dans le référentiel SPL"/>
</Border>
</Property>
</Properties>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
- <Group type="102" attributes="0">
- <EmptySpace max="32767" attributes="0"/>
- <Group type="103" groupAlignment="0" attributes="0">
- <Component id="jLabel1" alignment="1" min="-2" max="-2" attributes="0"/>
- <Group type="102" alignment="1" attributes="0">
- <Component id="pbLoadRef" min="-2" max="-2" attributes="0"/>
- <EmptySpace max="-2" attributes="0"/>
- </Group>
- </Group>
+ <Group type="102" alignment="0" attributes="0">
+ <EmptySpace max="-2" attributes="0"/>
+ <Component id="pbBrowseRef" min="-2" max="-2" attributes="0"/>
+ <EmptySpace pref="374" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
- <Component id="jLabel1" min="-2" max="-2" attributes="0"/>
- <EmptySpace max="-2" attributes="0"/>
- <Component id="pbLoadRef" min="-2" max="-2" attributes="0"/>
- <EmptySpace pref="13" max="32767" attributes="0"/>
+ <Component id="pbBrowseRef" min="-2" max="-2" attributes="0"/>
+ <EmptySpace pref="65" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
- <Component class="javax.swing.JLabel" name="jLabel1">
- <Properties>
- <Property name="text" type="java.lang.String" value="<html>
<p>Permet de charger le référentiel de collectivités / budgets maintenu par la DGFiP pour Helios.</p>
<p>Ce référentiel est disponible sous la forme d'un unique fichier déposé sur www.xemelios.org.</p>

<p>Ce référentiel est maintenu à jour et republié régulièrement.</p>
<p>L'installation du référentiel peut être longue et bloquer Xemelios pendant longtemps.</p>
</html>"/>
- </Properties>
- </Component>
- <Component class="javax.swing.JButton" name="pbLoadRef">
+ <Component class="javax.swing.JButton" name="pbBrowseRef">
<Properties>
- <Property name="text" type="java.lang.String" value="Installer le référentiel"/>
+ <Property name="text" type="java.lang.String" value="Parcourir le référentiel"/>
</Properties>
<Events>
- <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="pbLoadRefActionPerformed"/>
+ <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="pbBrowseRefActionPerformed"/>
</Events>
</Component>
</SubComponents>
import fr.gouv.finances.cp.utils.PropertiesExpansion;
import fr.gouv.finances.dgfip.xemelios.auth.impl.std.db.DataHelper;
import fr.gouv.finances.dgfip.utils.Pair;
-import fr.gouv.finances.dgfip.utils.xml.FactoryProvider;
-import fr.gouv.finances.dgfip.xemelios.common.Constants;
-import fr.gouv.finances.dgfip.xemelios.common.NetAccess;
-import fr.gouv.finances.dgfip.xemelios.data.DataLayerManager;
-import java.io.BufferedReader;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.net.URL;
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
+import fr.gouv.finances.dgfip.xemelios.auth.XemeliosUser;
import java.util.ArrayList;
-import java.util.Date;
import java.util.List;
import java.util.Vector;
-import java.util.zip.GZIPInputStream;
-import javax.swing.JOptionPane;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.xpath.XPath;
-import javax.xml.xpath.XPathConstants;
-import javax.xml.xpath.XPathFactory;
-import org.apache.commons.httpclient.HttpClient;
-import org.apache.commons.httpclient.methods.GetMethod;
import org.apache.log4j.Logger;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.NodeList;
/**
*
private Vector<Pair> natIds;
private DlgSelectCollectivite parent;
private PropertiesExpansion applicationProperties;
+ private XemeliosUser user;
/** Creates new form PnlCreateCollectivite */
- public PnlCreateCollectivite(DlgSelectCollectivite parent, PropertiesExpansion applicationProperties) {
+ public PnlCreateCollectivite(DlgSelectCollectivite parent, XemeliosUser user, PropertiesExpansion applicationProperties) {
super();
this.parent=parent;
+ this.user = user;
this.applicationProperties = applicationProperties;
natIds = new Vector<Pair>();
for(String key:DlgCollectivitesUtilisateur.naturesIdentifiants.keySet()) {
natIds.add(new Pair(key,DlgCollectivitesUtilisateur.naturesIdentifiants.get(key)));
}
initComponents();
+ try {
+ Class.forName("fr.gouv.finances.dgfip.xemelios.refCollecSpl.importer.RefCollecSplImporter");
+ } catch(Exception ex) {
+ // a priori, ce n'est pas disponible, donc on masque le panneau permettant
+ // de naviguer dans le référentiel
+ pnlBrowse.setVisible(false);
+ }
}
public List<DataHelper.CollectiviteLib> getSelectedData() {
dfIdentifiant = new javax.swing.JTextField();
lblLibelle = new javax.swing.JLabel();
dfLibelle = new javax.swing.JTextField();
- jPanel2 = new javax.swing.JPanel();
- jLabel1 = new javax.swing.JLabel();
- pbLoadRef = new javax.swing.JButton();
+ pnlBrowse = new javax.swing.JPanel();
+ pbBrowseRef = new javax.swing.JButton();
jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("Créer une nouvelle collectivité"));
.add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
.add(dfIdentifiant)
.add(dfLibelle, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 357, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))))
- .addContainerGap(106, Short.MAX_VALUE))
+ .addContainerGap(45, Short.MAX_VALUE))
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.addContainerGap(14, Short.MAX_VALUE))
);
- jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder("Importer le référentiel de Collectivités / Budgets"));
-
- jLabel1.setText("<html>\n<p>Permet de charger le référentiel de collectivités / budgets maintenu par la DGFiP pour Helios.</p>\n<p>Ce référentiel est disponible sous la forme d'un unique fichier déposé sur www.xemelios.org.</p>\n\n<p>Ce référentiel est maintenu à jour et republié régulièrement.</p>\n<p>L'installation du référentiel peut être longue et bloquer Xemelios pendant longtemps.</p>\n</html>");
+ pnlBrowse.setBorder(javax.swing.BorderFactory.createTitledBorder("Chercher un budget dans le référentiel SPL"));
- pbLoadRef.setText("Installer le référentiel");
- pbLoadRef.addActionListener(new java.awt.event.ActionListener() {
+ pbBrowseRef.setText("Parcourir le référentiel");
+ pbBrowseRef.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
- pbLoadRefActionPerformed(evt);
+ pbBrowseRefActionPerformed(evt);
}
});
- org.jdesktop.layout.GroupLayout jPanel2Layout = new org.jdesktop.layout.GroupLayout(jPanel2);
- jPanel2.setLayout(jPanel2Layout);
- jPanel2Layout.setHorizontalGroup(
- jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
- .add(jPanel2Layout.createSequentialGroup()
- .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .add(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
- .add(org.jdesktop.layout.GroupLayout.TRAILING, jLabel1)
- .add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel2Layout.createSequentialGroup()
- .add(pbLoadRef)
- .addContainerGap())))
+ org.jdesktop.layout.GroupLayout pnlBrowseLayout = new org.jdesktop.layout.GroupLayout(pnlBrowse);
+ pnlBrowse.setLayout(pnlBrowseLayout);
+ pnlBrowseLayout.setHorizontalGroup(
+ pnlBrowseLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+ .add(pnlBrowseLayout.createSequentialGroup()
+ .addContainerGap()
+ .add(pbBrowseRef)
+ .addContainerGap(374, Short.MAX_VALUE))
);
- jPanel2Layout.setVerticalGroup(
- jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
- .add(jPanel2Layout.createSequentialGroup()
+ pnlBrowseLayout.setVerticalGroup(
+ pnlBrowseLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+ .add(pnlBrowseLayout.createSequentialGroup()
.addContainerGap()
- .add(jLabel1)
- .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
- .add(pbLoadRef)
- .addContainerGap(13, Short.MAX_VALUE))
+ .add(pbBrowseRef)
+ .addContainerGap(65, Short.MAX_VALUE))
);
org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this);
.add(layout.createSequentialGroup()
.addContainerGap()
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
- .add(org.jdesktop.layout.GroupLayout.LEADING, jPanel2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .add(org.jdesktop.layout.GroupLayout.LEADING, jPanel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
- .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
+ .add(org.jdesktop.layout.GroupLayout.LEADING, pnlBrowse, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .add(org.jdesktop.layout.GroupLayout.LEADING, jPanel1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
+ .addContainerGap())
);
layout.setVerticalGroup(
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.addContainerGap()
.add(jPanel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
- .add(jPanel2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
- .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
+ .add(pnlBrowse, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
+ .addContainerGap(31, Short.MAX_VALUE))
);
}// </editor-fold>//GEN-END:initComponents
- private void pbLoadRefActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_pbLoadRefActionPerformed
- DateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
- parent.getGlassPane().setVisible(true);
- try {
- String actualDate = DataLayerManager.getImplementation().getParameterValue("referentiel.collectivite.last.update");
- Date actualRefDate = actualDate!=null ? sdf.parse(actualDate) : new Date(0);
- HttpClient client = NetAccess.getHttpClient(applicationProperties);
- URL refUrl = new URL(applicationProperties.getProperty(Constants.SYS_PROP_AUTH_REF_URL,"http://www.xemelios.org/collectivites/referentiel.xml"));
- GetMethod meth = new GetMethod(refUrl.toURI().toString());
- int httpRet = client.executeMethod(meth);
- if(httpRet>300) throw new Exception(meth.getStatusText());
- InputStream is = meth.getResponseBodyAsStream();
- DocumentBuilderFactory domFactory = FactoryProvider.getDocumentBuilderFactory();
- DocumentBuilder domBuilder = domFactory.newDocumentBuilder();
- Document refColls = domBuilder.parse(is);
- XPathFactory xpf = FactoryProvider.getXPathFactory();
- XPath xp = xpf.newXPath();
- String fileToLoad = null;
- Date updateDate = actualRefDate;
- NodeList nl = (NodeList)xp.evaluate("/ref-collectivites/referentiel", refColls, XPathConstants.NODESET);
- for(int i=0;i<nl.getLength();i++) {
- Element el = (Element)nl.item(i);
- String fileName = (String)xp.evaluate("./file/text()",el);
- Date date = sdf.parse((String)xp.evaluate("./date/text()",el));
- if(date.after(updateDate)) {
- fileToLoad = fileName;
- updateDate = date;
- }
- }
- if(fileToLoad==null) {
- JOptionPane.showMessageDialog(this, "Votre référentiel est à jour.");
- } else {
- URL url = new URL(refUrl,fileToLoad);
- meth = new GetMethod(url.toURI().toString());
- httpRet = client.executeMethod(meth);
- if(httpRet>300) throw new Exception(meth.getStatusText());
- is = meth.getResponseBodyAsStream();
- GZIPInputStream gzis = new GZIPInputStream(is);
- BufferedReader br = new BufferedReader(new InputStreamReader(gzis));
- String l = null;
- while((l=br.readLine()) != null) {
- saveLine(l);
- }
- br.close();
- DataLayerManager.getImplementation().setParameterValue("referentiel.collectivite.last.update", sdf.format(updateDate));
- }
- } catch(Exception ex) {
- logger.error("loadRef",ex);
- } finally {
- parent.getGlassPane().setVisible(false);
+ private void pbBrowseRefActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_pbBrowseRefActionPerformed
+ DlgBrowseReferentiel dlg = new DlgBrowseReferentiel(parent, user, applicationProperties);
+ Pair ret = dlg.run();
+ if(ret!=null) {
+ dfIdentifiant.setText(ret.key);
+ dfLibelle.setText(ret.libelle);
+ cbxNatId.setSelectedItem(new Pair("SIRET", DlgCollectivitesUtilisateur.getTypIdLib("SIRET")));
}
- }//GEN-LAST:event_pbLoadRefActionPerformed
-
- private void saveLine(String line) {
- String[] vals = line.split(";");
- String siret = vals[5];
- String idColl = vals[1]+vals[3]+vals[4];
- String libelle = vals[7];
- String codic = vals[1];
- String libCodic = vals[2];
- DataHelper.updateCollectivite(new DataHelper.CollectiviteLib("SIRET",siret,libelle));
- DataHelper.updateCollectivite(new DataHelper.CollectiviteLib("IDCOLL",idColl,libelle));
- DataHelper.updateCollectivite(new DataHelper.CollectiviteLib("CODIC",codic,libCodic));
- DataHelper.updateCollectivite(new DataHelper.CollectiviteLib("VARIABLE",siret,libelle));
- DataHelper.updateCollectivite(new DataHelper.CollectiviteLib("VARIABLE",idColl,libelle));
- DataHelper.updateCollectivite(new DataHelper.CollectiviteLib("VARIABLE",codic,libCodic));
-
- }
+ }//GEN-LAST:event_pbBrowseRefActionPerformed
+
+// private void saveLine(String line) {
+// String[] vals = line.split(";");
+// String siret = vals[5];
+// String idColl = vals[1]+vals[3]+vals[4];
+// String libelle = vals[7];
+// String codic = vals[1];
+// String libCodic = vals[2];
+// DataHelper.updateCollectivite(new DataHelper.CollectiviteLib("SIRET",siret,libelle));
+// DataHelper.updateCollectivite(new DataHelper.CollectiviteLib("IDCOLL",idColl,libelle));
+// DataHelper.updateCollectivite(new DataHelper.CollectiviteLib("CODIC",codic,libCodic));
+// DataHelper.updateCollectivite(new DataHelper.CollectiviteLib("VARIABLE",siret,libelle));
+// DataHelper.updateCollectivite(new DataHelper.CollectiviteLib("VARIABLE",idColl,libelle));
+// DataHelper.updateCollectivite(new DataHelper.CollectiviteLib("VARIABLE",codic,libCodic));
+// }
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JComboBox cbxNatId;
private javax.swing.JTextField dfIdentifiant;
private javax.swing.JTextField dfLibelle;
- private javax.swing.JLabel jLabel1;
private javax.swing.JPanel jPanel1;
- private javax.swing.JPanel jPanel2;
private javax.swing.JLabel lblClef;
private javax.swing.JLabel lblLibelle;
private javax.swing.JLabel lblNatId;
- private javax.swing.JButton pbLoadRef;
+ private javax.swing.JButton pbBrowseRef;
+ private javax.swing.JPanel pnlBrowse;
// End of variables declaration//GEN-END:variables
}
<Group type="103" groupAlignment="1" attributes="0">
<Component id="jLabel1" alignment="0" min="-2" max="-2" attributes="0"/>
<Group type="102" alignment="1" attributes="0">
- <Group type="103" groupAlignment="1" attributes="0">
- <Component id="jScrollPane1" alignment="0" pref="136" max="32767" attributes="2"/>
- <Component id="dfUser" alignment="1" pref="136" max="32767" attributes="0"/>
+ <Group type="103" groupAlignment="0" max="-2" attributes="0">
+ <Component id="dfUser" max="32767" attributes="1"/>
+ <Component id="jScrollPane1" alignment="0" pref="189" max="32767" attributes="3"/>
</Group>
- <EmptySpace min="-2" max="-2" attributes="0"/>
+ <EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" max="-2" attributes="0">
<Component id="pbRemoveUser" min="0" pref="0" max="32767" attributes="1"/>
<Component id="pbAddUser" min="0" pref="0" max="32767" attributes="1"/>
<Component id="pbSearch" alignment="0" pref="22" max="32767" attributes="1"/>
</Group>
- <EmptySpace min="-2" pref="8" max="-2" attributes="0"/>
- </Group>
- </Group>
- <EmptySpace max="-2" attributes="0"/>
- <Group type="103" groupAlignment="1" attributes="0">
- <Group type="102" alignment="0" attributes="0">
- <Component id="lblLogin" min="-2" max="-2" attributes="0"/>
- <EmptySpace min="-2" pref="281" max="-2" attributes="0"/>
- </Group>
- <Group type="102" alignment="0" attributes="0">
- <Group type="103" groupAlignment="0" attributes="0">
- <Component id="lblPrenom" alignment="0" min="-2" max="-2" attributes="0"/>
- <Component id="lblNom" alignment="0" min="-2" max="-2" attributes="0"/>
- <Component id="lblPassword" min="-2" max="-2" attributes="0"/>
- <Component id="lblPwd2" min="-2" max="-2" attributes="0"/>
- </Group>
- <EmptySpace max="-2" attributes="0"/>
- <Group type="103" groupAlignment="0" attributes="0">
- <Group type="102" alignment="1" attributes="0">
- <Component id="dfLogin" pref="229" max="32767" attributes="0"/>
- <EmptySpace max="-2" attributes="0"/>
- </Group>
- <Group type="102" alignment="0" attributes="0">
- <Group type="103" groupAlignment="0" attributes="0">
- <Component id="dfNom" alignment="0" min="-2" pref="209" max="-2" attributes="0"/>
- <Component id="dfPrenom" alignment="1" pref="229" max="32767" attributes="0"/>
- <Group type="103" alignment="0" groupAlignment="1" max="-2" attributes="0">
- <Component id="dfPassword2" alignment="0" max="32767" attributes="1"/>
- <Component id="dfPassword1" alignment="0" pref="131" max="32767" attributes="1"/>
- </Group>
- </Group>
- <EmptySpace min="-2" pref="12" max="-2" attributes="0"/>
- </Group>
- </Group>
- </Group>
- <Group type="102" alignment="0" attributes="0">
- <Group type="103" groupAlignment="1" attributes="0">
- <Group type="102" attributes="0">
- <Group type="103" groupAlignment="0" attributes="0">
- <Component id="chkAllCollectivites" alignment="0" min="-2" max="-2" attributes="0"/>
- <Component id="chkAllDocuments" min="-2" max="-2" attributes="0"/>
- </Group>
- <EmptySpace min="-2" pref="24" max="-2" attributes="0"/>
- </Group>
- <Group type="102" alignment="1" attributes="0">
- <Component id="chkAllFonctionalities" min="-2" max="-2" attributes="0"/>
- <EmptySpace type="unrelated" max="-2" attributes="0"/>
- </Group>
- </Group>
- <Group type="103" groupAlignment="0" attributes="0">
- <Component id="pbSave" alignment="1" pref="151" max="32767" attributes="0"/>
- <Component id="pbChooseCollectivites" alignment="1" pref="151" max="32767" attributes="1"/>
- <Component id="pbChooseDocuments" alignment="1" pref="151" max="32767" attributes="1"/>
- <Component id="pbChooseProfils" alignment="0" pref="151" max="32767" attributes="1"/>
- </Group>
- <EmptySpace max="-2" attributes="0"/>
+ <EmptySpace min="-2" max="-2" attributes="0"/>
+ <Component id="jPanel1" max="32767" attributes="0"/>
</Group>
</Group>
+ <EmptySpace min="-2" max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
- <Group type="102" alignment="0" attributes="0">
+ <Group type="102" alignment="1" attributes="0">
<EmptySpace min="-2" max="-2" attributes="0"/>
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" max="-2" attributes="0"/>
- <Group type="103" groupAlignment="3" attributes="0">
- <Component id="dfUser" alignment="3" min="-2" max="-2" attributes="0"/>
- <Component id="pbSearch" alignment="3" min="-2" max="-2" attributes="0"/>
- <Component id="lblLogin" alignment="3" min="-2" max="-2" attributes="0"/>
- <Component id="dfLogin" alignment="3" min="-2" max="-2" attributes="0"/>
- </Group>
- <EmptySpace min="-2" max="-2" attributes="0"/>
- <Group type="103" groupAlignment="0" attributes="0">
- <Group type="102" attributes="0">
- <Group type="103" groupAlignment="3" attributes="0">
- <Component id="lblNom" alignment="3" min="-2" max="-2" attributes="0"/>
- <Component id="dfNom" alignment="3" min="-2" max="-2" attributes="0"/>
- </Group>
- <EmptySpace max="-2" attributes="0"/>
- <Group type="103" groupAlignment="3" attributes="0">
- <Component id="lblPrenom" alignment="3" min="-2" max="-2" attributes="0"/>
- <Component id="dfPrenom" alignment="3" min="-2" max="-2" attributes="0"/>
- </Group>
- <EmptySpace max="-2" attributes="0"/>
- <Group type="103" groupAlignment="3" attributes="0">
- <Component id="dfPassword1" alignment="3" min="-2" max="-2" attributes="0"/>
- <Component id="lblPassword" alignment="3" min="-2" max="-2" attributes="0"/>
- </Group>
- <EmptySpace max="-2" attributes="0"/>
- <Group type="103" groupAlignment="3" attributes="0">
- <Component id="dfPassword2" alignment="3" min="-2" max="-2" attributes="0"/>
- <Component id="lblPwd2" alignment="3" min="-2" max="-2" attributes="0"/>
- </Group>
- <EmptySpace type="separate" max="-2" attributes="0"/>
- <Component id="pbSave" min="-2" max="-2" attributes="0"/>
- <EmptySpace pref="35" max="32767" attributes="0"/>
- <Group type="103" groupAlignment="3" attributes="0">
- <Component id="pbChooseProfils" alignment="3" min="-2" max="-2" attributes="0"/>
- <Component id="chkAllFonctionalities" alignment="3" min="-2" max="-2" attributes="0"/>
- </Group>
- <EmptySpace max="-2" attributes="0"/>
+ <Group type="103" groupAlignment="1" attributes="0">
+ <Component id="jPanel1" alignment="0" max="32767" attributes="0"/>
+ <Group type="102" alignment="1" attributes="0">
<Group type="103" groupAlignment="3" attributes="0">
- <Component id="pbChooseDocuments" alignment="3" min="-2" max="-2" attributes="0"/>
- <Component id="chkAllDocuments" alignment="3" min="-2" max="-2" attributes="0"/>
+ <Component id="dfUser" alignment="3" min="-2" max="-2" attributes="0"/>
+ <Component id="pbSearch" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
- <EmptySpace max="-2" attributes="0"/>
- <Group type="103" groupAlignment="3" attributes="0">
- <Component id="pbChooseCollectivites" alignment="3" min="-2" max="-2" attributes="0"/>
- <Component id="chkAllCollectivites" alignment="3" min="-2" max="-2" attributes="0"/>
+ <EmptySpace min="-2" max="-2" attributes="0"/>
+ <Group type="103" groupAlignment="0" attributes="0">
+ <Group type="102" attributes="0">
+ <Component id="pbAddUser" min="-2" max="-2" attributes="0"/>
+ <EmptySpace max="-2" attributes="0"/>
+ <Component id="pbRemoveUser" min="-2" max="-2" attributes="0"/>
+ </Group>
+ <Component id="jScrollPane1" pref="300" max="32767" attributes="0"/>
</Group>
</Group>
- <Component id="jScrollPane1" pref="275" max="32767" attributes="0"/>
- <Group type="102" attributes="0">
- <Component id="pbAddUser" min="-2" max="-2" attributes="0"/>
- <EmptySpace max="-2" attributes="0"/>
- <Component id="pbRemoveUser" min="-2" max="-2" attributes="0"/>
- </Group>
</Group>
- <EmptySpace max="-2" attributes="0"/>
+ <EmptySpace min="-2" max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Properties>
</Component>
<Component class="javax.swing.JTextField" name="dfUser">
+ <Events>
+ <EventHandler event="keyReleased" listener="java.awt.event.KeyListener" parameters="java.awt.event.KeyEvent" handler="dfUserKeyReleased"/>
+ </Events>
</Component>
<Component class="javax.swing.JButton" name="pbSearch">
<Properties>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="pbRemoveUserActionPerformed"/>
</Events>
</Component>
- <Component class="javax.swing.JLabel" name="lblLogin">
- <Properties>
- <Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor">
- <ComponentRef name="dfLogin"/>
- </Property>
- <Property name="text" type="java.lang.String" value="Login"/>
- </Properties>
- </Component>
- <Component class="javax.swing.JTextField" name="dfLogin">
- <Properties>
- <Property name="editable" type="boolean" value="false"/>
- </Properties>
- </Component>
- <Component class="javax.swing.JLabel" name="lblNom">
- <Properties>
- <Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor">
- <ComponentRef name="dfNom"/>
- </Property>
- <Property name="text" type="java.lang.String" value="Nom"/>
- </Properties>
- </Component>
- <Component class="javax.swing.JTextField" name="dfNom">
- <Properties>
- <Property name="enabled" type="boolean" value="false"/>
- </Properties>
- <Events>
- <EventHandler event="caretUpdate" listener="javax.swing.event.CaretListener" parameters="javax.swing.event.CaretEvent" handler="dfNomCaretUpdate"/>
- </Events>
- </Component>
- <Component class="javax.swing.JLabel" name="lblPrenom">
- <Properties>
- <Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor">
- <ComponentRef name="dfPrenom"/>
- </Property>
- <Property name="text" type="java.lang.String" value="Prénom"/>
- </Properties>
- </Component>
- <Component class="javax.swing.JTextField" name="dfPrenom">
- <Properties>
- <Property name="enabled" type="boolean" value="false"/>
- </Properties>
- <Events>
- <EventHandler event="caretUpdate" listener="javax.swing.event.CaretListener" parameters="javax.swing.event.CaretEvent" handler="dfPrenomCaretUpdate"/>
- </Events>
- </Component>
- <Component class="javax.swing.JLabel" name="lblPassword">
- <Properties>
- <Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor">
- <ComponentRef name="dfPassword1"/>
- </Property>
- <Property name="text" type="java.lang.String" value="Mot de passe"/>
- </Properties>
- </Component>
- <Component class="javax.swing.JPasswordField" name="dfPassword1">
- <Properties>
- <Property name="enabled" type="boolean" value="false"/>
- </Properties>
- <Events>
- <EventHandler event="caretUpdate" listener="javax.swing.event.CaretListener" parameters="javax.swing.event.CaretEvent" handler="dfPassword1CaretUpdate"/>
- </Events>
- </Component>
- <Component class="javax.swing.JLabel" name="lblPwd2">
- <Properties>
- <Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor">
- <ComponentRef name="dfPassword2"/>
- </Property>
- <Property name="text" type="java.lang.String" value="Répéter"/>
- </Properties>
- </Component>
- <Component class="javax.swing.JPasswordField" name="dfPassword2">
- <Properties>
- <Property name="enabled" type="boolean" value="false"/>
- </Properties>
- <Events>
- <EventHandler event="caretUpdate" listener="javax.swing.event.CaretListener" parameters="javax.swing.event.CaretEvent" handler="dfPassword2CaretUpdate"/>
- </Events>
- </Component>
- <Component class="javax.swing.JCheckBox" name="chkAllFonctionalities">
- <Properties>
- <Property name="text" type="java.lang.String" value="Toutes fonctionnalités"/>
- <Property name="enabled" type="boolean" value="false"/>
- </Properties>
- <Events>
- <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="chkAllFonctionalitiesActionPerformed"/>
- <EventHandler event="stateChanged" listener="javax.swing.event.ChangeListener" parameters="javax.swing.event.ChangeEvent" handler="chkAllFonctionalitiesStateChanged"/>
- </Events>
- </Component>
- <Component class="javax.swing.JButton" name="pbChooseProfils">
- <Properties>
- <Property name="text" type="java.lang.String" value="Profils..."/>
- <Property name="enabled" type="boolean" value="false"/>
- </Properties>
- <Events>
- <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="pbChooseProfilsActionPerformed"/>
- </Events>
- </Component>
- <Component class="javax.swing.JCheckBox" name="chkAllDocuments">
- <Properties>
- <Property name="text" type="java.lang.String" value="Tous documents"/>
- <Property name="enabled" type="boolean" value="false"/>
- </Properties>
- <Events>
- <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="chkAllDocumentsActionPerformed"/>
- <EventHandler event="stateChanged" listener="javax.swing.event.ChangeListener" parameters="javax.swing.event.ChangeEvent" handler="chkAllDocumentsStateChanged"/>
- </Events>
- </Component>
- <Component class="javax.swing.JButton" name="pbChooseDocuments">
- <Properties>
- <Property name="text" type="java.lang.String" value="Documents..."/>
- <Property name="enabled" type="boolean" value="false"/>
- </Properties>
- <Events>
- <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="pbChooseDocumentsActionPerformed"/>
- </Events>
- </Component>
- <Component class="javax.swing.JCheckBox" name="chkAllCollectivites">
- <Properties>
- <Property name="text" type="java.lang.String" value="Toutes collectivités"/>
- <Property name="enabled" type="boolean" value="false"/>
- </Properties>
- <Events>
- <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="chkAllCollectivitesActionPerformed"/>
- <EventHandler event="stateChanged" listener="javax.swing.event.ChangeListener" parameters="javax.swing.event.ChangeEvent" handler="chkAllCollectivitesStateChanged"/>
- </Events>
- </Component>
- <Component class="javax.swing.JButton" name="pbChooseCollectivites">
- <Properties>
- <Property name="text" type="java.lang.String" value="Collectivités..."/>
- <Property name="enabled" type="boolean" value="false"/>
- </Properties>
- <Events>
- <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="pbChooseCollectivitesActionPerformed"/>
- </Events>
- </Component>
- <Component class="javax.swing.JButton" name="pbSave">
- <Properties>
- <Property name="text" type="java.lang.String" value="Enregistrer"/>
- <Property name="enabled" type="boolean" value="false"/>
- </Properties>
- <Events>
- <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="pbSaveActionPerformed"/>
- </Events>
- </Component>
+ <Container class="javax.swing.JPanel" name="jPanel1">
+
+ <Layout>
+ <DimensionLayout dim="0">
+ <Group type="103" groupAlignment="0" attributes="0">
+ <Group type="102" alignment="1" attributes="0">
+ <EmptySpace max="-2" attributes="0"/>
+ <Group type="103" groupAlignment="1" attributes="0">
+ <Group type="102" alignment="0" attributes="0">
+ <Component id="lblLogin" min="-2" max="-2" attributes="0"/>
+ <EmptySpace min="-2" pref="269" max="-2" attributes="0"/>
+ </Group>
+ <Group type="102" alignment="0" attributes="0">
+ <Group type="103" groupAlignment="0" attributes="0">
+ <Component id="lblPrenom" alignment="0" min="-2" max="-2" attributes="0"/>
+ <Component id="lblNom" alignment="0" min="-2" max="-2" attributes="0"/>
+ <Component id="lblPassword" min="-2" max="-2" attributes="0"/>
+ <Component id="lblPwd2" min="-2" max="-2" attributes="0"/>
+ </Group>
+ <EmptySpace max="-2" attributes="0"/>
+ <Group type="103" groupAlignment="0" attributes="0">
+ <Component id="dfLogin" alignment="1" pref="205" max="32767" attributes="0"/>
+ <Component id="dfPrenom" alignment="1" pref="205" max="32767" attributes="0"/>
+ <Group type="103" alignment="0" groupAlignment="1" max="-2" attributes="0">
+ <Component id="dfPassword2" alignment="0" max="32767" attributes="1"/>
+ <Component id="dfPassword1" alignment="0" min="-2" pref="131" max="-2" attributes="1"/>
+ </Group>
+ <Component id="dfNom" alignment="0" pref="205" max="32767" attributes="0"/>
+ </Group>
+ </Group>
+ <Group type="102" alignment="1" attributes="0">
+ <Group type="103" groupAlignment="0" attributes="0">
+ <Component id="chkAllFonctionalities" alignment="0" min="-2" max="-2" attributes="0"/>
+ <Component id="chkAllDocuments" alignment="0" min="-2" max="-2" attributes="0"/>
+ <Component id="chkAllCollectivites" alignment="0" min="-2" max="-2" attributes="0"/>
+ </Group>
+ <EmptySpace min="-2" pref="12" max="-2" attributes="0"/>
+ <Group type="103" groupAlignment="0" attributes="0">
+ <Component id="pbChooseCollectivites" alignment="1" pref="127" max="32767" attributes="1"/>
+ <Component id="pbChooseDocuments" alignment="1" pref="127" max="32767" attributes="1"/>
+ <Component id="pbChooseProfils" alignment="0" pref="127" max="32767" attributes="1"/>
+ </Group>
+ </Group>
+ <Component id="pbSave" alignment="1" pref="303" max="32767" attributes="0"/>
+ </Group>
+ <EmptySpace max="-2" attributes="0"/>
+ </Group>
+ </Group>
+ </DimensionLayout>
+ <DimensionLayout dim="1">
+ <Group type="103" groupAlignment="0" attributes="0">
+ <Group type="102" alignment="0" attributes="0">
+ <Group type="103" groupAlignment="3" attributes="0">
+ <Component id="lblLogin" alignment="3" min="-2" max="-2" attributes="0"/>
+ <Component id="dfLogin" alignment="3" min="-2" max="-2" attributes="0"/>
+ </Group>
+ <EmptySpace min="-2" max="-2" attributes="0"/>
+ <Group type="103" groupAlignment="3" attributes="0">
+ <Component id="lblNom" alignment="3" min="-2" max="-2" attributes="0"/>
+ <Component id="dfNom" alignment="3" min="-2" max="-2" attributes="0"/>
+ </Group>
+ <EmptySpace max="-2" attributes="0"/>
+ <Group type="103" groupAlignment="3" attributes="0">
+ <Component id="lblPrenom" alignment="3" min="-2" max="-2" attributes="0"/>
+ <Component id="dfPrenom" alignment="3" min="-2" max="-2" attributes="0"/>
+ </Group>
+ <EmptySpace max="-2" attributes="0"/>
+ <Group type="103" groupAlignment="3" attributes="0">
+ <Component id="dfPassword1" alignment="3" min="-2" max="-2" attributes="0"/>
+ <Component id="lblPassword" alignment="3" min="-2" max="-2" attributes="0"/>
+ </Group>
+ <EmptySpace max="-2" attributes="0"/>
+ <Group type="103" groupAlignment="3" attributes="0">
+ <Component id="dfPassword2" alignment="3" min="-2" max="-2" attributes="0"/>
+ <Component id="lblPwd2" alignment="3" min="-2" max="-2" attributes="0"/>
+ </Group>
+ <EmptySpace type="separate" max="-2" attributes="0"/>
+ <Group type="103" groupAlignment="3" attributes="0">
+ <Component id="pbChooseProfils" alignment="3" min="-2" max="-2" attributes="0"/>
+ <Component id="chkAllFonctionalities" alignment="3" min="-2" max="-2" attributes="0"/>
+ </Group>
+ <EmptySpace max="-2" attributes="0"/>
+ <Group type="103" groupAlignment="3" attributes="0">
+ <Component id="pbChooseDocuments" alignment="3" min="-2" max="-2" attributes="0"/>
+ <Component id="chkAllDocuments" alignment="3" min="-2" max="-2" attributes="0"/>
+ </Group>
+ <EmptySpace max="-2" attributes="0"/>
+ <Group type="103" groupAlignment="3" attributes="0">
+ <Component id="pbChooseCollectivites" alignment="3" min="-2" max="-2" attributes="0"/>
+ <Component id="chkAllCollectivites" alignment="3" min="-2" max="-2" attributes="0"/>
+ </Group>
+ <EmptySpace type="unrelated" max="-2" attributes="0"/>
+ <Component id="pbSave" min="-2" max="-2" attributes="0"/>
+ <EmptySpace pref="48" max="32767" attributes="0"/>
+ </Group>
+ </Group>
+ </DimensionLayout>
+ </Layout>
+ <SubComponents>
+ <Component class="javax.swing.JLabel" name="lblLogin">
+ <Properties>
+ <Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor">
+ <ComponentRef name="dfLogin"/>
+ </Property>
+ <Property name="text" type="java.lang.String" value="Login"/>
+ </Properties>
+ </Component>
+ <Component class="javax.swing.JTextField" name="dfLogin">
+ <Properties>
+ <Property name="editable" type="boolean" value="false"/>
+ </Properties>
+ <Events>
+ <EventHandler event="caretUpdate" listener="javax.swing.event.CaretListener" parameters="javax.swing.event.CaretEvent" handler="caretHandler"/>
+ </Events>
+ </Component>
+ <Component class="javax.swing.JLabel" name="lblNom">
+ <Properties>
+ <Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor">
+ <ComponentRef name="dfNom"/>
+ </Property>
+ <Property name="text" type="java.lang.String" value="Nom"/>
+ </Properties>
+ </Component>
+ <Component class="javax.swing.JTextField" name="dfNom">
+ <Properties>
+ <Property name="enabled" type="boolean" value="false"/>
+ </Properties>
+ <Events>
+ <EventHandler event="caretUpdate" listener="javax.swing.event.CaretListener" parameters="javax.swing.event.CaretEvent" handler="dfNomCaretUpdate"/>
+ </Events>
+ </Component>
+ <Component class="javax.swing.JLabel" name="lblPrenom">
+ <Properties>
+ <Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor">
+ <ComponentRef name="dfPrenom"/>
+ </Property>
+ <Property name="text" type="java.lang.String" value="Prénom"/>
+ </Properties>
+ </Component>
+ <Component class="javax.swing.JTextField" name="dfPrenom">
+ <Properties>
+ <Property name="enabled" type="boolean" value="false"/>
+ </Properties>
+ <Events>
+ <EventHandler event="caretUpdate" listener="javax.swing.event.CaretListener" parameters="javax.swing.event.CaretEvent" handler="dfPrenomCaretUpdate"/>
+ </Events>
+ </Component>
+ <Component class="javax.swing.JLabel" name="lblPassword">
+ <Properties>
+ <Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor">
+ <ComponentRef name="dfPassword1"/>
+ </Property>
+ <Property name="text" type="java.lang.String" value="Mot de passe"/>
+ </Properties>
+ </Component>
+ <Component class="javax.swing.JPasswordField" name="dfPassword1">
+ <Properties>
+ <Property name="enabled" type="boolean" value="false"/>
+ </Properties>
+ <Events>
+ <EventHandler event="caretUpdate" listener="javax.swing.event.CaretListener" parameters="javax.swing.event.CaretEvent" handler="dfPassword1CaretUpdate"/>
+ </Events>
+ </Component>
+ <Component class="javax.swing.JLabel" name="lblPwd2">
+ <Properties>
+ <Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor">
+ <ComponentRef name="dfPassword2"/>
+ </Property>
+ <Property name="text" type="java.lang.String" value="Répéter"/>
+ </Properties>
+ </Component>
+ <Component class="javax.swing.JPasswordField" name="dfPassword2">
+ <Properties>
+ <Property name="enabled" type="boolean" value="false"/>
+ </Properties>
+ <Events>
+ <EventHandler event="caretUpdate" listener="javax.swing.event.CaretListener" parameters="javax.swing.event.CaretEvent" handler="dfPassword2CaretUpdate"/>
+ </Events>
+ </Component>
+ <Component class="javax.swing.JCheckBox" name="chkAllFonctionalities">
+ <Properties>
+ <Property name="text" type="java.lang.String" value="Toutes fonctionnalités"/>
+ <Property name="enabled" type="boolean" value="false"/>
+ </Properties>
+ <Events>
+ <EventHandler event="stateChanged" listener="javax.swing.event.ChangeListener" parameters="javax.swing.event.ChangeEvent" handler="chkAllFonctionalitiesStateChanged"/>
+ <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="chkAllFonctionalitiesActionPerformed"/>
+ </Events>
+ </Component>
+ <Component class="javax.swing.JButton" name="pbChooseProfils">
+ <Properties>
+ <Property name="text" type="java.lang.String" value="Profils..."/>
+ <Property name="enabled" type="boolean" value="false"/>
+ </Properties>
+ <Events>
+ <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="pbChooseProfilsActionPerformed"/>
+ </Events>
+ </Component>
+ <Component class="javax.swing.JCheckBox" name="chkAllDocuments">
+ <Properties>
+ <Property name="text" type="java.lang.String" value="Tous documents"/>
+ <Property name="enabled" type="boolean" value="false"/>
+ </Properties>
+ <Events>
+ <EventHandler event="stateChanged" listener="javax.swing.event.ChangeListener" parameters="javax.swing.event.ChangeEvent" handler="chkAllDocumentsStateChanged"/>
+ <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="chkAllDocumentsActionPerformed"/>
+ </Events>
+ </Component>
+ <Component class="javax.swing.JButton" name="pbChooseDocuments">
+ <Properties>
+ <Property name="text" type="java.lang.String" value="Documents..."/>
+ <Property name="enabled" type="boolean" value="false"/>
+ </Properties>
+ <Events>
+ <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="pbChooseDocumentsActionPerformed"/>
+ </Events>
+ </Component>
+ <Component class="javax.swing.JCheckBox" name="chkAllCollectivites">
+ <Properties>
+ <Property name="text" type="java.lang.String" value="Toutes collectivités"/>
+ <Property name="enabled" type="boolean" value="false"/>
+ </Properties>
+ <Events>
+ <EventHandler event="stateChanged" listener="javax.swing.event.ChangeListener" parameters="javax.swing.event.ChangeEvent" handler="chkAllCollectivitesStateChanged"/>
+ <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="chkAllCollectivitesActionPerformed"/>
+ </Events>
+ </Component>
+ <Component class="javax.swing.JButton" name="pbChooseCollectivites">
+ <Properties>
+ <Property name="text" type="java.lang.String" value="Collectivités..."/>
+ <Property name="enabled" type="boolean" value="false"/>
+ </Properties>
+ <Events>
+ <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="pbChooseCollectivitesActionPerformed"/>
+ </Events>
+ </Component>
+ <Component class="javax.swing.JButton" name="pbSave">
+ <Properties>
+ <Property name="text" type="java.lang.String" value="Enregistrer"/>
+ <Property name="enabled" type="boolean" value="false"/>
+ </Properties>
+ <Events>
+ <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="pbSaveActionPerformed"/>
+ </Events>
+ </Component>
+ </SubComponents>
+ </Container>
</SubComponents>
</Form>
package fr.gouv.finances.dgfip.xemelios.auth.impl.std.db.ui;
import fr.gouv.finances.cp.utils.PropertiesExpansion;
+import fr.gouv.finances.dgfip.xemelios.auth.XemeliosUser;
import fr.gouv.finances.dgfip.xemelios.auth.impl.std.db.DataHelper;
import fr.gouv.finances.dgfip.xemelios.common.Crypter;
import fr.gouv.finances.dgfip.xemelios.common.config.DocumentsModel;
import fr.gouv.finances.dgfip.xemelios.common.config.Loader;
+import java.awt.event.KeyEvent;
import java.util.ArrayList;
import java.util.Arrays;
import javax.swing.JOptionPane;
private DataHelper.StdUser currentUser;
private DataHelper.StdUser[] users;
private PropertiesExpansion applicationProperties;
+ private XemeliosUser connectedUser;
/** Creates new form PnlUsers */
- public PnlUsers(DlgAdmin dlgAdmin, PropertiesExpansion applicationProperties) {
+ public PnlUsers(DlgAdmin dlgAdmin, PropertiesExpansion applicationProperties, XemeliosUser connectedUser) {
this.dlgAdmin=dlgAdmin;
this.applicationProperties = applicationProperties;
+ this.connectedUser = connectedUser;
initComponents();
lstUsers.addListSelectionListener(new ListSelectionListener() {
+ @Override
public void valueChanged(ListSelectionEvent e) {
boolean hasSelectedItem = (lstUsers.getSelectedIndex()>=0);
chkAllFonctionalities.setEnabled(hasSelectedItem);
pbChooseDocuments.setEnabled(false);
pbChooseProfils.setEnabled(false);
}
+ setChanged(false);
}
});
+ setChanged(false);
}
/** This method is called from within the constructor to
lstUsers = new javax.swing.JList();
pbAddUser = new javax.swing.JButton();
pbRemoveUser = new javax.swing.JButton();
+ jPanel1 = new javax.swing.JPanel();
lblLogin = new javax.swing.JLabel();
dfLogin = new javax.swing.JTextField();
lblNom = new javax.swing.JLabel();
jLabel1.setText("Chercher des utilisateurs");
+ dfUser.addKeyListener(new java.awt.event.KeyAdapter() {
+ public void keyReleased(java.awt.event.KeyEvent evt) {
+ dfUserKeyReleased(evt);
+ }
+ });
+
pbSearch.setIcon(new javax.swing.ImageIcon(getClass().getResource("/fr/gouv/finances/cp/xemelios/ui/resources/search.png"))); // NOI18N
pbSearch.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
lblLogin.setText("Login");
dfLogin.setEditable(false);
+ dfLogin.addCaretListener(new javax.swing.event.CaretListener() {
+ public void caretUpdate(javax.swing.event.CaretEvent evt) {
+ caretHandler(evt);
+ }
+ });
lblNom.setLabelFor(dfNom);
lblNom.setText("Nom");
chkAllFonctionalities.setText("Toutes fonctionnalités");
chkAllFonctionalities.setEnabled(false);
- chkAllFonctionalities.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- chkAllFonctionalitiesActionPerformed(evt);
- }
- });
chkAllFonctionalities.addChangeListener(new javax.swing.event.ChangeListener() {
public void stateChanged(javax.swing.event.ChangeEvent evt) {
chkAllFonctionalitiesStateChanged(evt);
}
});
+ chkAllFonctionalities.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ chkAllFonctionalitiesActionPerformed(evt);
+ }
+ });
pbChooseProfils.setText("Profils...");
pbChooseProfils.setEnabled(false);
chkAllDocuments.setText("Tous documents");
chkAllDocuments.setEnabled(false);
- chkAllDocuments.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- chkAllDocumentsActionPerformed(evt);
- }
- });
chkAllDocuments.addChangeListener(new javax.swing.event.ChangeListener() {
public void stateChanged(javax.swing.event.ChangeEvent evt) {
chkAllDocumentsStateChanged(evt);
}
});
+ chkAllDocuments.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ chkAllDocumentsActionPerformed(evt);
+ }
+ });
pbChooseDocuments.setText("Documents...");
pbChooseDocuments.setEnabled(false);
chkAllCollectivites.setText("Toutes collectivités");
chkAllCollectivites.setEnabled(false);
- chkAllCollectivites.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- chkAllCollectivitesActionPerformed(evt);
- }
- });
chkAllCollectivites.addChangeListener(new javax.swing.event.ChangeListener() {
public void stateChanged(javax.swing.event.ChangeEvent evt) {
chkAllCollectivitesStateChanged(evt);
}
});
+ chkAllCollectivites.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ chkAllCollectivitesActionPerformed(evt);
+ }
+ });
pbChooseCollectivites.setText("Collectivités...");
pbChooseCollectivites.setEnabled(false);
}
});
+ org.jdesktop.layout.GroupLayout jPanel1Layout = new org.jdesktop.layout.GroupLayout(jPanel1);
+ jPanel1.setLayout(jPanel1Layout);
+ jPanel1Layout.setHorizontalGroup(
+ jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+ .add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel1Layout.createSequentialGroup()
+ .addContainerGap()
+ .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
+ .add(org.jdesktop.layout.GroupLayout.LEADING, jPanel1Layout.createSequentialGroup()
+ .add(lblLogin)
+ .add(269, 269, 269))
+ .add(org.jdesktop.layout.GroupLayout.LEADING, jPanel1Layout.createSequentialGroup()
+ .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+ .add(lblPrenom)
+ .add(lblNom)
+ .add(lblPassword)
+ .add(lblPwd2))
+ .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
+ .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+ .add(org.jdesktop.layout.GroupLayout.TRAILING, dfLogin, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 205, Short.MAX_VALUE)
+ .add(org.jdesktop.layout.GroupLayout.TRAILING, dfPrenom, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 205, Short.MAX_VALUE)
+ .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING, false)
+ .add(org.jdesktop.layout.GroupLayout.LEADING, dfPassword2)
+ .add(org.jdesktop.layout.GroupLayout.LEADING, dfPassword1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 131, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
+ .add(dfNom, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 205, Short.MAX_VALUE)))
+ .add(jPanel1Layout.createSequentialGroup()
+ .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+ .add(chkAllFonctionalities)
+ .add(chkAllDocuments)
+ .add(chkAllCollectivites))
+ .add(12, 12, 12)
+ .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+ .add(org.jdesktop.layout.GroupLayout.TRAILING, pbChooseCollectivites, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 127, Short.MAX_VALUE)
+ .add(org.jdesktop.layout.GroupLayout.TRAILING, pbChooseDocuments, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 127, Short.MAX_VALUE)
+ .add(pbChooseProfils, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 127, Short.MAX_VALUE)))
+ .add(pbSave, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 303, Short.MAX_VALUE))
+ .addContainerGap())
+ );
+ jPanel1Layout.setVerticalGroup(
+ jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+ .add(jPanel1Layout.createSequentialGroup()
+ .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
+ .add(lblLogin)
+ .add(dfLogin, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
+ .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
+ .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
+ .add(lblNom)
+ .add(dfNom, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
+ .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
+ .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
+ .add(lblPrenom)
+ .add(dfPrenom, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
+ .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
+ .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
+ .add(dfPassword1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
+ .add(lblPassword))
+ .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
+ .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
+ .add(dfPassword2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
+ .add(lblPwd2))
+ .add(18, 18, 18)
+ .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
+ .add(pbChooseProfils)
+ .add(chkAllFonctionalities))
+ .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
+ .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
+ .add(pbChooseDocuments)
+ .add(chkAllDocuments))
+ .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
+ .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
+ .add(pbChooseCollectivites)
+ .add(chkAllCollectivites))
+ .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
+ .add(pbSave)
+ .addContainerGap(48, Short.MAX_VALUE))
+ );
+
org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
.add(org.jdesktop.layout.GroupLayout.LEADING, jLabel1)
.add(layout.createSequentialGroup()
- .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
- .add(org.jdesktop.layout.GroupLayout.LEADING, jScrollPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 130, Short.MAX_VALUE)
- .add(dfUser, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 130, Short.MAX_VALUE))
+ .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
+ .add(dfUser)
+ .add(jScrollPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 189, Short.MAX_VALUE))
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
.add(pbRemoveUser, 0, 0, Short.MAX_VALUE)
.add(pbAddUser, 0, 0, Short.MAX_VALUE)
- .add(pbSearch, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 22, Short.MAX_VALUE))
- .add(8, 8, 8)))
- .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
- .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
- .add(org.jdesktop.layout.GroupLayout.LEADING, layout.createSequentialGroup()
- .add(lblLogin)
- .add(281, 281, 281))
- .add(org.jdesktop.layout.GroupLayout.LEADING, layout.createSequentialGroup()
- .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
- .add(lblPrenom)
- .add(lblNom)
- .add(lblPassword)
- .add(lblPwd2))
+ .add(pbSearch, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 22, Short.MAX_VALUE))
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
- .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
- .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
- .add(dfLogin, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 224, Short.MAX_VALUE)
- .addContainerGap())
- .add(layout.createSequentialGroup()
- .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
- .add(dfNom, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 209, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
- .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
- .add(dfPrenom, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 224, Short.MAX_VALUE)
- .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED))
- .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING, false)
- .add(org.jdesktop.layout.GroupLayout.LEADING, dfPassword2)
- .add(org.jdesktop.layout.GroupLayout.LEADING, dfPassword1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 131, Short.MAX_VALUE)))
- .add(12, 12, 12))))
- .add(org.jdesktop.layout.GroupLayout.LEADING, layout.createSequentialGroup()
- .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
- .add(layout.createSequentialGroup()
- .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
- .add(layout.createSequentialGroup()
- .add(chkAllCollectivites)
- .add(22, 22, 22))
- .add(chkAllDocuments))
- .add(2, 2, 2))
- .add(layout.createSequentialGroup()
- .add(chkAllFonctionalities)
- .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)))
- .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
- .add(org.jdesktop.layout.GroupLayout.TRAILING, pbSave, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 144, Short.MAX_VALUE)
- .add(org.jdesktop.layout.GroupLayout.TRAILING, pbChooseCollectivites, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 144, Short.MAX_VALUE)
- .add(org.jdesktop.layout.GroupLayout.TRAILING, pbChooseDocuments, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 144, Short.MAX_VALUE)
- .add(pbChooseProfils, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 144, Short.MAX_VALUE))
- .addContainerGap())))
+ .add(jPanel1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
+ .addContainerGap())
);
layout.setVerticalGroup(
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
- .add(layout.createSequentialGroup()
+ .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
.addContainerGap()
.add(jLabel1)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
- .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
- .add(dfUser, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
- .add(pbSearch)
- .add(lblLogin)
- .add(dfLogin, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
- .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
- .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+ .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
+ .add(org.jdesktop.layout.GroupLayout.LEADING, jPanel1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.add(layout.createSequentialGroup()
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
- .add(lblNom)
- .add(dfNom, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
- .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
- .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
- .add(lblPrenom)
- .add(dfPrenom, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
- .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
- .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
- .add(dfPassword1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
- .add(lblPassword))
- .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
- .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
- .add(dfPassword2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
- .add(lblPwd2))
- .add(18, 18, 18)
- .add(pbSave)
- .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 34, Short.MAX_VALUE)
- .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
- .add(pbChooseProfils)
- .add(chkAllFonctionalities))
- .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
- .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
- .add(pbChooseDocuments)
- .add(chkAllDocuments))
- .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
- .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
- .add(pbChooseCollectivites)
- .add(chkAllCollectivites)))
- .add(jScrollPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 275, Short.MAX_VALUE)
- .add(layout.createSequentialGroup()
- .add(pbAddUser)
+ .add(dfUser, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
+ .add(pbSearch))
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
- .add(pbRemoveUser)))
+ .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+ .add(layout.createSequentialGroup()
+ .add(pbAddUser)
+ .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
+ .add(pbRemoveUser))
+ .add(jScrollPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 300, Short.MAX_VALUE))))
.addContainerGap())
);
}// </editor-fold>//GEN-END:initComponents
private void dfNomCaretUpdate(javax.swing.event.CaretEvent evt) {//GEN-FIRST:event_dfNomCaretUpdate
if(!dfNom.isEnabled()) return;
- if(!dfNom.getText().equals(currentUser.getNom()) && (dfNom.getText().length()!=0 || currentUser.getNom()!=null)) pbSave.setEnabled(true);
+ if(!dfNom.getText().equals(currentUser.getNom()) && (dfNom.getText().length()!=0 || currentUser.getNom()!=null)) setChanged(true);
}//GEN-LAST:event_dfNomCaretUpdate
private void dfPrenomCaretUpdate(javax.swing.event.CaretEvent evt) {//GEN-FIRST:event_dfPrenomCaretUpdate
private void dfPassword1CaretUpdate(javax.swing.event.CaretEvent evt) {//GEN-FIRST:event_dfPassword1CaretUpdate
if(!dfPassword1.isEnabled()) return;
- if(dfPassword1.getText().length()!=0) pbSave.setEnabled(true);
+ if(dfPassword1.getPassword().length!=0) setChanged(true);
}//GEN-LAST:event_dfPassword1CaretUpdate
private void dfPassword2CaretUpdate(javax.swing.event.CaretEvent evt) {//GEN-FIRST:event_dfPassword2CaretUpdate
if(!dfPassword2.isEnabled()) return;
- if(dfPassword2.getText().length()!=0) pbSave.setEnabled(true);
+ if(dfPassword2.getPassword().length!=0) setChanged(true);
}//GEN-LAST:event_dfPassword2CaretUpdate
private void chkAllFonctionalitiesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_chkAllFonctionalitiesActionPerformed
if(!chkAllFonctionalities.isEnabled()) return;
- pbSave.setEnabled(true);
+ setChanged(true);
}//GEN-LAST:event_chkAllFonctionalitiesActionPerformed
private void chkAllCollectivitesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_chkAllCollectivitesActionPerformed
private void chkAllDocumentsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_chkAllDocumentsActionPerformed
if(!chkAllDocuments.isEnabled()) return;
- pbSave.setEnabled(true);
+ setChanged(true);
}//GEN-LAST:event_chkAllDocumentsActionPerformed
private void chkAllDocumentsStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_chkAllDocumentsStateChanged
for(ListSelectionListener lsl:lstUsers.getListSelectionListeners()) {
lsl.valueChanged(null);
}
+ setChanged(false);
}//GEN-LAST:event_pbSaveActionPerformed
private void pbAddUserActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_pbAddUserActionPerformed
users=tmpUsers;
lstUsers.setListData(users);
lstUsers.setSelectedIndex(users.length-1);
+ setChanged(true);
}//GEN-LAST:event_pbAddUserActionPerformed
private void pbRemoveUserActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_pbRemoveUserActionPerformed
System.arraycopy(users, pos+1, tmpUsers, pos, users.length-pos-1);
users=tmpUsers;
lstUsers.setListData(users);
+ setChanged(false);
}
}//GEN-LAST:event_pbRemoveUserActionPerformed
private void pbChooseCollectivitesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_pbChooseCollectivitesActionPerformed
try {
- DlgCollectivitesUtilisateur dlg = new DlgCollectivitesUtilisateur(dlgAdmin, currentUser, applicationProperties);
+ DlgCollectivitesUtilisateur dlg = new DlgCollectivitesUtilisateur(dlgAdmin, currentUser, applicationProperties, connectedUser);
dlg.run();
} catch(Exception ex) {
logger.error("pbChooseCollectivitesActionPerformed",ex);
}
}//GEN-LAST:event_pbChooseCollectivitesActionPerformed
+ private void caretHandler(javax.swing.event.CaretEvent evt) {//GEN-FIRST:event_caretHandler
+ setChanged(true);
+ }//GEN-LAST:event_caretHandler
+
+ private void dfUserKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_dfUserKeyReleased
+ if(evt.getKeyCode()==KeyEvent.VK_ENTER)
+ pbSearch.doClick();
+ }//GEN-LAST:event_dfUserKeyReleased
+
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JCheckBox chkAllCollectivites;
private javax.swing.JTextField dfPrenom;
private javax.swing.JTextField dfUser;
private javax.swing.JLabel jLabel1;
+ private javax.swing.JPanel jPanel1;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JLabel lblLogin;
private javax.swing.JLabel lblNom;
private javax.swing.JButton pbSearch;
// End of variables declaration//GEN-END:variables
+ private void setChanged(boolean changed) {
+ pbSave.setEnabled(changed);
+ }
}