OpenConcerto

Dépôt officiel du code source de l'ERP OpenConcerto
sonarqube

svn://code.openconcerto.org/openconcerto

Rev

Rev 177 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 177 Rev 182
Line 1... Line 1...
1
/*
1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 * 
3
 * 
4
 * Copyright 2011 OpenConcerto, by ILM Informatique. All rights reserved.
4
 * Copyright 2011-2019 OpenConcerto, by ILM Informatique. All rights reserved.
5
 * 
5
 * 
6
 * The contents of this file are subject to the terms of the GNU General Public License Version 3
6
 * The contents of this file are subject to the terms of the GNU General Public License Version 3
7
 * only ("GPL"). You may not use this file except in compliance with the License. You can obtain a
7
 * only ("GPL"). You may not use this file except in compliance with the License. You can obtain a
8
 * copy of the License at http://www.gnu.org/licenses/gpl-3.0.html See the License for the specific
8
 * copy of the License at http://www.gnu.org/licenses/gpl-3.0.html See the License for the specific
9
 * language governing permissions and limitations under the License.
9
 * language governing permissions and limitations under the License.
Line 222... Line 222...
222
                if (ListeHistoriquePanel.this.mapListener.get(i) != null) {
222
                if (ListeHistoriquePanel.this.mapListener.get(i) != null) {
223
                    List<TableModelListener> l = ListeHistoriquePanel.this.mapListener.get(i);
223
                    List<TableModelListener> l = ListeHistoriquePanel.this.mapListener.get(i);
224
                    for (TableModelListener listener : l) {
224
                    for (TableModelListener listener : l) {
225
                        liste.getListe().getTableModel().addTableModelListener(listener);
225
                        liste.getListe().getTableModel().addTableModelListener(listener);
226
                        if (elementSheet.get(liste.getElement()) != null) {
226
                        if (elementSheet.get(liste.getElement()) != null) {
227
                            liste.getListe().addIListeActions(new MouseSheetXmlListeListener(elementSheet.get(liste.getElement())).getRowActions());
227
                            liste.getListe().addIListeActions(new MouseSheetXmlListeListener(liste.getElement(), elementSheet.get(liste.getElement())).getRowActions());
228
                        }
228
                        }
229
                    }
229
                    }
230
                }
230
                }
231
 
231
 
232
            }
232
            }
Line 460... Line 460...
460
                                    }
460
                                    }
461
                                }
461
                                }
462
                            }, true);
462
                            }, true);
463
                            actionDrop.setPredicate(IListeEvent.createSelectionCountPredicate(0, Integer.MAX_VALUE));
463
                            actionDrop.setPredicate(IListeEvent.createSelectionCountPredicate(0, Integer.MAX_VALUE));
464
                            liste.getListe().addIListeAction(actionDrop);
464
                            liste.getListe().addIListeAction(actionDrop);
-
 
465
                        } else if (createTableSource.getPrimaryTable().getName().endsWith("_ELEMENT")) {
-
 
466
                            liste.setAddVisible(false);
-
 
467
                            liste.setShowReadOnlyFrameOnDoubleClick(false);
-
 
468
                            liste.setModifyVisible(false);
-
 
469
                            liste.setDeleteVisible(false);
465
                        }
470
                        }
466
                    }
471
                    }
467
 
472
 
468
                    this.vectListePanel.add(liste);
473
                    this.vectListePanel.add(liste);
469
 
474
 
470
                    setRenderer(liste);
475
                    setRenderer(liste);
471
                    if (elementSheet.get(liste.getElement()) != null) {
476
                    if (elementSheet.get(liste.getElement()) != null) {
472
                        liste.getListe().addIListeActions(new MouseSheetXmlListeListener(elementSheet.get(liste.getElement())).getRowActions());
477
                        liste.getListe().addIListeActions(new MouseSheetXmlListeListener(liste.getElement(), elementSheet.get(liste.getElement())).getRowActions());
473
                    }
478
                    }
474
                    liste.getListe().getModel().setCellsEditable(false);
479
                    liste.getListe().getModel().setCellsEditable(false);
475
                    liste.setOpaque(false);
480
                    liste.setOpaque(false);
476
 
481
 
477
                    liste.setBorder(null);
482
                    liste.setBorder(null);
Line 554... Line 559...
554
 
559
 
555
            }
560
            }
556
 
561
 
557
            @Override
562
            @Override
558
            public void ancestorRemoved(AncestorEvent event) {
563
            public void ancestorRemoved(AncestorEvent event) {
-
 
564
                ListeHistoriquePanel.this.vectListePanel.clear();
-
 
565
                ListeHistoriquePanel.this.mapListener = null;
559
                ListeHistoriquePanel.this.jListePanel.removeListSelectionListener(ListeHistoriquePanel.this.listListener);
566
                ListeHistoriquePanel.this.jListePanel.removeListSelectionListener(ListeHistoriquePanel.this.listListener);
-
 
567
                ListeHistoriquePanel.this.jListePanel.removeAllTableListener();
-
 
568
                ListeHistoriquePanel.this.jListePanel = null;
-
 
569
                ListeHistoriquePanel.this.listFieldMap = null;
-
 
570
                ListeHistoriquePanel.this.whereList = null;
560
            }
571
            }
561
        });
572
        });
562
 
573
 
563
    }
574
    }
564
 
575
 
Line 600... Line 611...
600
    public void removeListSelectionListener(ListSelectionListener l) {
611
    public void removeListSelectionListener(ListSelectionListener l) {
601
        this.jListePanel.removeListSelectionListener(l);
612
        this.jListePanel.removeListSelectionListener(l);
602
    }
613
    }
603
 
614
 
604
    public SQLRowAccessor getSelectedRow() {
615
    public SQLRowAccessor getSelectedRow() {
-
 
616
        // FIXME null pointer avec historique client frame, surement un pb de garbage
-
 
617
        if (this.jListePanel == null) {
-
 
618
            return null;
-
 
619
        }
-
 
620
        if (this.jListePanel.getModel() == null) {
-
 
621
            return null;
-
 
622
        }
-
 
623
 
605
        return this.jListePanel.getModel().getRowAt(this.jListePanel.getSelectedIndex());
624
        return this.jListePanel.getModel().getRowAt(this.jListePanel.getSelectedIndex());
606
    }
625
    }
607
 
626
 
608
    public void addWhere(String key, Where w) {
627
    public void addWhere(String key, Where w) {
609
        this.whereList.put(key, w);
628
        this.whereList.put(key, w);