1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626
| /*
* frmRechercher.java
*
* Created on 23. octobre 2006, 11:34
*/
package test;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.File;
import java.io.IOException;
import java.lang.Object.*;
import java.lang.String;
import java.lang.Runtime;
import javax.swing.*;
import javax.swing.plaf.basic.BasicLookAndFeel;
import javax.swing.plaf.metal.MetalLookAndFeel;
import javax.swing.table.*;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.util.Calendar;
import java.util.ArrayList;
import java.text.SimpleDateFormat;
import com.sun.java.swing.plaf.motif.MotifLookAndFeel;
import com.sun.java.swing.plaf.windows.WindowsLookAndFeel;
import test.TableSorter;
/**
*
* @author xojmrc
*/
public class Main extends javax.swing.JFrame {
// Décalration et initialisation des variables
private DefaultTableModel dtmModel = null;
private Process proDonneesUtilisateur = null;
private BufferedReader brdDonneesUtilisateur = null;
private String strDonneesUtilisateur = null;
private String strUserName = null;
private String strLastLogon = null;
private String strComment = null;
private String strFullname = null;
private String strTemp = null;
private String strUserNameRestriction = null;
private String strTexteAvertissement = null;
private static String SYMBOLE_ENTRE_DATE = ".";
private String strJour = null;
private String strMois = null;
private String strAnnee = null;
private String strEmplacementRecherche = null;
private String[] strDossiersUtilisateurs = null;
private int[] intLignesSelectionnees = null;
private String[][] strDonnesUtilisateursSelectionnes = null;
private Calendar calCalendrierLimite = Calendar.getInstance();
private Calendar calCalendrierLastLogon = Calendar.getInstance();
private Calendar calDerniereModifDossier = Calendar.getInstance();
private int intJour = 0;
private int intMois = 0;
private int intAnnee = 0;
private int intNbreAffiches = 0;
private int i = 0;
private int k = 0;
private int intNbreLignesSelectionnees = 0;
private File fleRepertoireDossiers = new File("C:/users");
//private File fleRepertoireDossiers = new File("//nac2recojv/qt_ojvusers$/USERS");
private File fleDossierUtilisateur = null;
private boolean blnUtilisateurExistant = false;
private ArrayList arlNomUtilisateurs = null;
/** Creates new form frmRechercher */
public Main() {
//Change l'aspect visuel de la fenêtre à celui de l'OS
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
}//try
catch (Exception e) {
JOptionPane.showMessageDialog(null,e);
}//catch
initComponents();
}
/* *********************************************************************
* Méthode : initComponents()
* Auteur : Form Editor de NetBeans
* Remarque : /!\ Faire attention aux modifications qu'on y apporte
* Il utilise le layer Matisse de NetBeans 5.0
pour créer le GUI
* But : Initialise les composants de la form frmRechercher
* Paramètres : -
* Retour : -
* *********************************************************************/
// <editor-fold defaultstate="collapsed" desc=" Generated Code ">
private void initComponents() {
btgRecherche = new javax.swing.ButtonGroup();
btgApparence = new javax.swing.ButtonGroup();
btnSupprimer = new javax.swing.JButton();
jspConteneurTab = new javax.swing.JScrollPane();
tabResultats = new javax.swing.JTable();
btnRechercher = new javax.swing.JButton();
pgbRechercher = new javax.swing.JProgressBar();
rbtDossiers = new javax.swing.JRadioButton();
rbtUtilisateurs = new javax.swing.JRadioButton();
txtNbreJours = new javax.swing.JTextField();
lblJours = new javax.swing.JLabel();
lblResultats = new javax.swing.JLabel();
txtNbreMois = new javax.swing.JTextField();
lblMois = new javax.swing.JLabel();
txtNbreAnnees = new javax.swing.JTextField();
lblAnnees = new javax.swing.JLabel();
ckbUserNeverLoggedon = new javax.swing.JCheckBox();
lblUserName = new javax.swing.JLabel();
txtRestrictionRecherche = new javax.swing.JTextField();
btnHelp = new javax.swing.JButton();
jMenuBar1 = new javax.swing.JMenuBar();
mnuOutils = new javax.swing.JMenu();
mniConfiguration = new javax.swing.JMenuItem();
mnuDonnees = new javax.swing.JMenu();
mniReinitialiser = new javax.swing.JMenuItem();
mniEffacerListe = new javax.swing.JMenuItem();
mnuAffichage = new javax.swing.JMenu();
mnuApparence = new javax.swing.JMenu();
mniWindows = new javax.swing.JRadioButtonMenuItem();
mniMetal = new javax.swing.JRadioButtonMenuItem();
mniMotif = new javax.swing.JRadioButtonMenuItem();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setTitle("Recherche");
btnSupprimer.setText("Supprimer...");
btnSupprimer.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
AfficherSupprimer(evt);
}
});
tabResultats.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
{null, null, null, null},
{null, null, null, null},
{null, null, null, null},
{null, null, null, null}
},
new String [] {
"Title 1", "Title 2", "Title 3", "Title 4"
}
));
jspConteneurTab.setViewportView(tabResultats);
btnRechercher.setText("Rechercher");
btnRechercher.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
Rechercher(evt);
}
});
btgRecherche.add(rbtDossiers);
rbtDossiers.setText("Rechercher des dossiers dont l'utilisateur n'existe plus");
rbtDossiers.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
rbtDossiers.setMargin(new java.awt.Insets(0, 0, 0, 0));
rbtDossiers.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
VerouillerConfigRechercheUtilisateurs(evt);
}
});
btgRecherche.add(rbtUtilisateurs);
rbtUtilisateurs.setSelected(true);
rbtUtilisateurs.setText("Rechercher les utilisateur qui ne se sont plus connect\u00e9s depuis plus de");
rbtUtilisateurs.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
rbtUtilisateurs.setMargin(new java.awt.Insets(0, 0, 0, 0));
rbtUtilisateurs.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
DeverouillerConfigRechercheUtilisateurs(evt);
}
});
txtNbreJours.setText("0");
lblJours.setText("jours,");
lblResultats.setText("Resultats :");
txtNbreMois.setText("0");
lblMois.setText("mois et");
txtNbreAnnees.setText("0");
lblAnnees.setText("ann\u00e9es.");
ckbUserNeverLoggedon.setText("Afficher les utilisateurs qui ne se sont jamais connect\u00e9s");
ckbUserNeverLoggedon.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
ckbUserNeverLoggedon.setMargin(new java.awt.Insets(0, 0, 0, 0));
lblUserName.setText("Restriction de recherche :");
btnHelp.setText("?");
btnHelp.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
OuvrirFenetreAideRecherche(evt);
}
});
mnuOutils.setText("Outils");
mniConfiguration.setText("Configuration");
mnuOutils.add(mniConfiguration);
jMenuBar1.add(mnuOutils);
mnuDonnees.setText("Donn\u00e9es");
mniReinitialiser.setText("R\u00e9initialiser tout");
mniReinitialiser.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
ReinitialiserTout(evt);
}
});
mnuDonnees.add(mniReinitialiser);
mniEffacerListe.setText("Effacer la liste");
mniEffacerListe.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
EffacerListe(evt);
}
});
mnuDonnees.add(mniEffacerListe);
jMenuBar1.add(mnuDonnees);
mnuAffichage.setText("Affichage");
mnuApparence.setText("Apparence");
btgApparence.add(mniWindows);
mniWindows.setSelected(true);
mniWindows.setText("Windows");
mniWindows.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
setLookAndFeelWindows(evt);
}
});
mnuApparence.add(mniWindows);
btgApparence.add(mniMetal);
mniMetal.setText("Metal");
mniMetal.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
setLookAndFeeMetal(evt);
}
});
mnuApparence.add(mniMetal);
btgApparence.add(mniMotif);
mniMotif.setText("Motif");
mniMotif.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
setLookAndFeeMotif(evt);
}
});
mnuApparence.add(mniMotif);
mnuAffichage.add(mnuApparence);
jMenuBar1.add(mnuAffichage);
setJMenuBar(jMenuBar1);
org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
.addContainerGap()
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
.add(org.jdesktop.layout.GroupLayout.LEADING, jspConteneurTab, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 689, Short.MAX_VALUE)
.add(org.jdesktop.layout.GroupLayout.LEADING, btnSupprimer)
.add(org.jdesktop.layout.GroupLayout.LEADING, layout.createSequentialGroup()
.add(17, 17, 17)
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(layout.createSequentialGroup()
.add(lblUserName)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(txtRestrictionRecherche, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 173, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(btnHelp))
.add(ckbUserNeverLoggedon))
.add(44, 44, 44))
.add(org.jdesktop.layout.GroupLayout.LEADING, layout.createSequentialGroup()
.add(rbtUtilisateurs)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(txtNbreJours, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 30, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(lblJours)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(txtNbreMois, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 30, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(lblMois)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(txtNbreAnnees, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 30, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(lblAnnees))
.add(org.jdesktop.layout.GroupLayout.LEADING, lblResultats)
.add(org.jdesktop.layout.GroupLayout.LEADING, layout.createSequentialGroup()
.add(btnRechercher, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 99, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(pgbRechercher, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 584, Short.MAX_VALUE))
.add(org.jdesktop.layout.GroupLayout.LEADING, rbtDossiers))
.addContainerGap())
);
layout.setVerticalGroup(
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(layout.createSequentialGroup()
.addContainerGap()
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(rbtUtilisateurs)
.add(lblJours)
.add(txtNbreMois, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.add(lblMois)
.add(txtNbreAnnees, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.add(txtNbreJours, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.add(lblAnnees))
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(ckbUserNeverLoggedon)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(lblUserName)
.add(txtRestrictionRecherche, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.add(btnHelp))
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(rbtDossiers)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
.add(btnRechercher)
.add(pgbRechercher, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 23, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(lblResultats)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(jspConteneurTab, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 332, Short.MAX_VALUE)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(btnSupprimer)
.addContainerGap())
);
pack();
}// </editor-fold>
private void ReinitialiserTout(java.awt.event.ActionEvent evt) {
Reinitialiser();
rbtUtilisateurs.setSelected(true);
txtNbreJours.setText("0");
txtNbreMois.setText("0");
txtNbreAnnees.setText("0");
txtRestrictionRecherche.setText("");
ckbUserNeverLoggedon.setSelected(false);
VerouillerConfig(false);
pgbRechercher.setValue(0);
}
private void setLookAndFeeMotif(java.awt.event.ActionEvent evt) {
DefinirLookAndFeel("com.sun.java.swing.plaf.motif.MotifLookAndFeel");
}
private void setLookAndFeeMetal(java.awt.event.ActionEvent evt) {
DefinirLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
}
private void setLookAndFeelWindows(java.awt.event.ActionEvent evt) {
DefinirLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
}
private void DefinirLookAndFeel(String strApparence){
try {
UIManager.setLookAndFeel(strApparence);
SwingUtilities.updateComponentTreeUI(this);
}
catch(Exception e) {
e.printStackTrace();
}
}
private void EffacerListe(java.awt.event.ActionEvent evt) {
Reinitialiser();
}
private void DeverouillerConfigRechercheUtilisateurs(java.awt.event.ActionEvent evt) {
VerouillerConfig(false);
}
private void VerouillerConfigRechercheUtilisateurs(java.awt.event.ActionEvent evt) {
VerouillerConfig(true);
}
private void OuvrirFenetreAideRecherche(java.awt.event.ActionEvent evt) {
}
/*
dtmModel = new DefaultTableModel(
new Object [][] {},
new String [] {
"Nom d'utilisateur", "Nom complet", "Commentaire", "Dernier logon"
}
);
tabResultats.setModel(dtmModel);
*/
/* *********************************************************************
* Méthode : Rechercher(java.awt.event.ActionEvent evt)
* Auteur : Christian Muller
* But : Effectue une recherche sur les utilisateurs
* ou les dossiers, selon le bouton radio séléctionné
* Paramètres : evt
* L'action qui a déclenché l'événement
* Retour : -
* *********************************************************************/
private void Rechercher(java.awt.event.ActionEvent evt) {
// Réinitialise la grille des résultats
Reinitialiser();
// Si on désire rechercher des utilisateurs
if(rbtUtilisateurs.isSelected()){
// Créer un nouveau threas ou s'éxecuteras la recherche
Thread RechercherUtilisateurs = new Thread() {
@Override public void run() {
for(int i = 0; i<2000; i++){
dtmModel.addRow(new String[] {i+"", "texte", "texte", "texte"});
}
}
};
// On lance le thread
RechercherUtilisateurs.start();
strEmplacementRecherche = "utilisateurs";
}
// Si on désire rechercher des dossiers
else if(rbtDossiers.isSelected()){
}
// On affiche les résultats dans la grille
TableSorter tbsSorter = new TableSorter(dtmModel);
tabResultats.setModel(tbsSorter);
tbsSorter.setTableHeader(tabResultats.getTableHeader());
//tabResultats.setModel(dtmModel);
}
/* *********************************************************************
* Méthode : AfficherSupprimer(java.awt.event.ActionEvent evt)
* Auteur : Christian Muller
* But : Affiche la form de supression
* Paramètres : evt
* L'action qui a déclenché l'événement
* Retour : -
* *********************************************************************/
private void AfficherSupprimer(java.awt.event.ActionEvent evt) {
if(strEmplacementRecherche == "utilisateurs"){
intLignesSelectionnees = tabResultats.getSelectedRows();
strDonnesUtilisateursSelectionnes = new String[6][intLignesSelectionnees.length];
for(i=0; i<intLignesSelectionnees.length; i++){
strDonnesUtilisateursSelectionnes[0][i] = i+"";
strDonnesUtilisateursSelectionnes[1][i] = tabResultats.getValueAt(intLignesSelectionnees[i], 0).toString();
strDonnesUtilisateursSelectionnes[2][i] = tabResultats.getValueAt(intLignesSelectionnees[i], 1).toString();
strDonnesUtilisateursSelectionnes[3][i] = tabResultats.getValueAt(intLignesSelectionnees[i], 2).toString();
strDonnesUtilisateursSelectionnes[4][i] = tabResultats.getValueAt(intLignesSelectionnees[i], 3).toString();
strDonnesUtilisateursSelectionnes[5][i] = fleRepertoireDossiers+"\\"+tabResultats.getValueAt(intLignesSelectionnees[i], 0);
}
// Créer une nouvelle instance du form de suppression
}
else if(strEmplacementRecherche == "dossiers"){
intLignesSelectionnees = tabResultats.getSelectedRows();
intNbreLignesSelectionnees = intLignesSelectionnees.length;
if(intNbreLignesSelectionnees < 2){
strTexteAvertissement = "Voulez-vous vraiment supprimer ce dossier ?";
}
else{
strTexteAvertissement = "Voulez-vous vraiment supprimer ces "+intNbreLignesSelectionnees+" dossiers ?";
}
if(JOptionPane.showConfirmDialog(null, strTexteAvertissement, "Attention", JOptionPane.YES_NO_OPTION) == JOptionPane.OK_OPTION){
for(i=intNbreLignesSelectionnees-1; i>=0; i--){
fleDossierUtilisateur = new File(fleRepertoireDossiers+"/"+tabResultats.getValueAt(intLignesSelectionnees[i], 0).toString());
if(fleDossierUtilisateur.exists()){
if(fleDossierUtilisateur.delete()){
dtmModel.removeRow(intLignesSelectionnees[i]);
intLignesSelectionnees = tabResultats.getSelectedRows();
intNbreAffiches--;
}
else{
System.out.println("Erreur lors de l'effacement");
}
}
else{
System.out.println("Le dossier n'a pas été trouvé");
}
}
lblResultats.setText("Recherche terminée : "+intNbreAffiches+" dossiers trouvés");
}
}
}
/* *********************************************************************
* Méthode : Reinitialiser()
* Auteur : Christian Muller
* But : Supprime les entrées de la liste et refait les
* en-têtes en fonction de la séléctione de radio bouton
* Paramètres : -
* Retour : -
* *********************************************************************/
private void Reinitialiser(){
// Initialise le calendrier de la date limite à la date actuelle
calCalendrierLimite = Calendar.getInstance();
intNbreAffiches = 0;
pgbRechercher.setValue(0);
// Recréé le tableau et l'en-tête en fonction de la séléction
if(rbtUtilisateurs.isSelected()){
dtmModel = new DefaultTableModel(
new Object [][] {
},
new String [] {
"Nom d'utilisateur", "Nom complet", "Commentaire", "Dernier logon"
}
);
}
else if(rbtDossiers.isSelected()){
dtmModel = new DefaultTableModel(
new Object [][] {
},
new String [] {
"Nom du dossier", "Dernière modification"
}
);
}
tabResultats.setModel(dtmModel);
lblResultats.setText("Résultats :");
}
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new Main().setVisible(true);
}
});
}
/* *********************************************************************
* Méthode : VerouillerConfig(boolean blnVerouiller)
* Auteur : Christian Muller
* But : Vérouille ou dévérouille les textbox/boutons en
* en fonction de la séléction de radiobouton.
* Paramètres : evt
* L'action qui a déclenché l'événement
* Retour : -
* *********************************************************************/
private void VerouillerConfig(boolean blnVerouiller){
blnVerouiller = !blnVerouiller;
txtNbreJours.setEnabled(blnVerouiller);
txtNbreMois.setEnabled(blnVerouiller);
txtNbreAnnees.setEnabled(blnVerouiller);
txtRestrictionRecherche.setEnabled(blnVerouiller);
ckbUserNeverLoggedon.setEnabled(blnVerouiller);
btnHelp.setEnabled(blnVerouiller);
}
// Variables declaration - do not modify
private javax.swing.ButtonGroup btgApparence;
private javax.swing.ButtonGroup btgRecherche;
private javax.swing.JButton btnHelp;
private javax.swing.JButton btnRechercher;
private javax.swing.JButton btnSupprimer;
private javax.swing.JCheckBox ckbUserNeverLoggedon;
private javax.swing.JMenuBar jMenuBar1;
private javax.swing.JScrollPane jspConteneurTab;
private javax.swing.JLabel lblAnnees;
private javax.swing.JLabel lblJours;
private javax.swing.JLabel lblMois;
private javax.swing.JLabel lblResultats;
private javax.swing.JLabel lblUserName;
private javax.swing.JMenuItem mniConfiguration;
private javax.swing.JMenuItem mniEffacerListe;
private javax.swing.JRadioButtonMenuItem mniMetal;
private javax.swing.JRadioButtonMenuItem mniMotif;
private javax.swing.JMenuItem mniReinitialiser;
private javax.swing.JRadioButtonMenuItem mniWindows;
private javax.swing.JMenu mnuAffichage;
private javax.swing.JMenu mnuApparence;
private javax.swing.JMenu mnuDonnees;
private javax.swing.JMenu mnuOutils;
private javax.swing.JProgressBar pgbRechercher;
private javax.swing.JRadioButton rbtDossiers;
private javax.swing.JRadioButton rbtUtilisateurs;
private javax.swing.JTable tabResultats;
private javax.swing.JTextField txtNbreAnnees;
private javax.swing.JTextField txtNbreJours;
private javax.swing.JTextField txtNbreMois;
private javax.swing.JTextField txtRestrictionRecherche;
// End of variables declaration
} |
Partager