OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

Rev 132 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
18 ilm 1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 *
4
 * Copyright 2011 OpenConcerto, by ILM Informatique. All rights reserved.
5
 *
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
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.
10
 *
11
 * When distributing the software, include this License Header Notice in each file.
12
 */
13
 
14
 package org.openconcerto.erp.core.customerrelationship.customer.action;
15
 
156 ilm 16
import org.openconcerto.erp.action.CreateIListFrameAbstractAction;
18 ilm 17
import org.openconcerto.erp.config.ComptaPropsConfiguration;
156 ilm 18
import org.openconcerto.erp.core.customerrelationship.customer.element.ClientNormalSQLElement;
19
import org.openconcerto.erp.core.customerrelationship.customer.element.CustomerSQLElement;
18 ilm 20
import org.openconcerto.erp.core.sales.invoice.ui.EcheanceRenderer;
21
import org.openconcerto.sql.model.SQLField;
22
import org.openconcerto.sql.model.SQLTable;
23
import org.openconcerto.sql.view.IListFrame;
24
 
25
import java.util.Set;
26
 
27
import javax.swing.JTable;
28
 
156 ilm 29
public class ListeDesClientsAction extends CreateIListFrameAbstractAction<ClientNormalSQLElement> {
18 ilm 30
 
156 ilm 31
    public ListeDesClientsAction(final ComptaPropsConfiguration conf) {
32
        super(conf, CustomerSQLElement.class);
18 ilm 33
    }
34
 
83 ilm 35
    @Override
156 ilm 36
    protected void initFrame(IListFrame frame) {
37
        super.initFrame(frame);
83 ilm 38
 
156 ilm 39
        SQLTable tableModeReglement = getElem().getDirectory().getElement("MODE_REGLEMENT").getTable();
41 ilm 40
 
18 ilm 41
        // Renderer
42
        final EcheanceRenderer rend = EcheanceRenderer.getInstance();
43
        JTable jTable = frame.getPanel().getListe().getJTable();
44
        for (int i = 0; i < jTable.getColumnCount(); i++) {
45
            int realColIndex = frame.getPanel().getListe().getJTable().getColumnModel().getColumn(i).getModelIndex();
46
            final Set<SQLField> fields = frame.getPanel().getListe().getSource().getColumn(realColIndex).getFields();
47
            // System.err.println("Column " + column + " Fields : " + fields);
48
            if (fields.contains(tableModeReglement.getField("AJOURS"))) {
49
 
50
                // if (jTable.getColumnClass(i) == Long.class || jTable.getColumnClass(i) ==
51
                // BigInteger.class) {
52
                jTable.getColumnModel().getColumn(i).setCellRenderer(rend);
53
            }
54
        }
55
 
156 ilm 56
        frame.getPanel().setSearchFullMode(true);
57
        frame.getPanel().setSelectRowOnAdd(false);
18 ilm 58
    }
59
}