OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

Rev 132 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 132 Rev 151
Line 19... Line 19...
19
import org.openconcerto.sql.view.list.RowValuesTable;
19
import org.openconcerto.sql.view.list.RowValuesTable;
20
import org.openconcerto.sql.view.list.RowValuesTableControlPanel;
20
import org.openconcerto.sql.view.list.RowValuesTableControlPanel;
21
import org.openconcerto.sql.view.list.RowValuesTableModel;
21
import org.openconcerto.sql.view.list.RowValuesTableModel;
22
import org.openconcerto.sql.view.list.RowValuesTableRenderer;
22
import org.openconcerto.sql.view.list.RowValuesTableRenderer;
23
import org.openconcerto.sql.view.list.SQLTableElement;
23
import org.openconcerto.sql.view.list.SQLTableElement;
-
 
24
import org.openconcerto.ui.FormatEditor;
-
 
25
import org.openconcerto.utils.FormatGroup;
-
 
26
import org.openconcerto.utils.convertor.DateToSQLConvertor;
24
 
27
 
25
import java.awt.GridBagConstraints;
28
import java.awt.GridBagConstraints;
26
import java.awt.GridBagLayout;
29
import java.awt.GridBagLayout;
27
import java.io.File;
30
import java.io.File;
-
 
31
import java.text.DateFormat;
-
 
32
import java.util.Date;
28
import java.util.List;
33
import java.util.List;
29
import java.util.Vector;
34
import java.util.Vector;
30
 
35
 
31
import javax.swing.JPanel;
36
import javax.swing.JPanel;
32
import javax.swing.JScrollPane;
37
import javax.swing.JScrollPane;
Line 102... Line 107...
102
        if (elt.getTable().contains("NO_MAILING")) {
107
        if (elt.getTable().contains("NO_MAILING")) {
103
            SQLTableElement tableElementNoMailing = new SQLTableElement(elt.getTable().getField("NO_MAILING"));
108
            SQLTableElement tableElementNoMailing = new SQLTableElement(elt.getTable().getField("NO_MAILING"));
104
            list.add(tableElementNoMailing);
109
            list.add(tableElementNoMailing);
105
        }
110
        }
106
 
111
 
-
 
112
        if (elt.getTable().contains("DATE_NAISSANCE")) {
-
 
113
            list.add(new SQLTableElement(elt.getTable().getField("DATE_NAISSANCE")) {
-
 
114
                private final DateToSQLConvertor conv = new DateToSQLConvertor();
-
 
115
                {
-
 
116
                    this.setEditor(new FormatEditor(
-
 
117
                            new FormatGroup(DateFormat.getDateInstance(DateFormat.SHORT), DateFormat.getDateInstance(DateFormat.MEDIUM), DateFormat.getDateInstance(DateFormat.LONG))));
-
 
118
                }
-
 
119
 
-
 
120
                @Override
-
 
121
                public Object convertEditorValueToModel(Object value, SQLRowValues row) {
-
 
122
                    return this.conv.convert((Date) value);
-
 
123
                }
-
 
124
            });
-
 
125
        }
107
        final RowValuesTableModel model = new RowValuesTableModel(elt, list, elt.getTable().getField("NOM"), false, defaultRow);
126
        final RowValuesTableModel model = new RowValuesTableModel(elt, list, elt.getTable().getField("NOM"), false, defaultRow);
108
 
127
 
109
        this.table = new RowValuesTable(model, new File(Configuration.getInstance().getConfDir(), "Table" + File.separator + "Table_Contact.xml"));
128
        this.table = new RowValuesTable(model, new File(Configuration.getInstance().getConfDir(), "Table" + File.separator + "Table_Contact.xml"));
110
        ToolTipManager.sharedInstance().unregisterComponent(this.table);
129
        ToolTipManager.sharedInstance().unregisterComponent(this.table);
111
        ToolTipManager.sharedInstance().unregisterComponent(this.table.getTableHeader());
130
        ToolTipManager.sharedInstance().unregisterComponent(this.table.getTableHeader());