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);
+ }
}