OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Compare Revisions

Regard whitespace Rev 27 → Rev 28

/trunk/OpenConcerto/src/org/openconcerto/erp/core/reports/history/ui/ListeHistoriquePanel.java
40,6 → 40,8
import org.openconcerto.ui.DefaultGridBagConstraints;
import org.openconcerto.utils.cc.ITransformer;
 
import java.awt.Color;
import java.awt.Font;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
63,6 → 65,9
import javax.swing.JTabbedPane;
import javax.swing.JTable;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import javax.swing.border.Border;
import javax.swing.border.TitledBorder;
import javax.swing.event.AncestorEvent;
import javax.swing.event.AncestorListener;
import javax.swing.event.ListSelectionEvent;
130,8 → 135,12
w2 = w2.and(new Where(table.getForeignTable(field.getName()).getField("ID_" + ListeHistoriquePanel.this.jListePanel.getModel().getTable().getName()), "=", id));
liste.getListe().getRequest().setWhere(w2.and(w));
} else {
if (liste.getElement().getTable().equals(jListePanel.getModel().getTable())) {
liste.getListe().getRequest().setWhere(new Where(table.getKey(), "=", id).and(w));
} else {
liste.getListe().getRequest().setWhere(new Where(table.getField("ID_" + ListeHistoriquePanel.this.jListePanel.getModel().getTable().getName()), "=", id).and(w));
}
}
} else {
liste.getListe().getRequest().setWhere(w);
}
172,7 → 181,7
* @param listFieldMap jointure d'une table pour utiliser le filtre si la table ne contient pas
* de foreignKey pointant sur tableList
*/
public ListeHistoriquePanel(String title, final SQLTable tableList, List<String> listTableOnglet, JPanel panelBottom, Map<SQLTable, SQLField> listFieldMap) {
public ListeHistoriquePanel(String title, final SQLTable tableList, Map<String, List<String>> listTableOnglet, JPanel panelBottom, Map<SQLTable, SQLField> listFieldMap) {
super();
this.setLayout(new GridBagLayout());
GridBagConstraints c = new GridBagConstraints();
191,9 → 200,20
// Onglet de IListe
JTabbedPane tabbedPane = new JTabbedPane();
 
for (int i = 0; i < listTableOnglet.size(); i++) {
final SQLElement elt = Configuration.getInstance().getDirectory().getElement(listTableOnglet.get(i).toString());
for (String key : listTableOnglet.keySet()) {
 
List<String> listPanelTable = listTableOnglet.get(key);
 
JPanel tabbedPanel = new JPanel(new GridBagLayout());
GridBagConstraints c2 = new DefaultGridBagConstraints();
c2.fill = GridBagConstraints.BOTH;
c2.weightx = 1;
c2.weighty = 1;
c2.gridy = GridBagConstraints.RELATIVE;
 
for (int i = 0; i < listPanelTable.size(); i++) {
final SQLElement elt = Configuration.getInstance().getDirectory().getElement(listPanelTable.get(i));
 
IListPanel liste;
 
if (elt.getTable().contains("ID_MOUVEMENT")) {
234,9 → 254,21
liste.setOpaque(false);
liste.setBorder(null);
 
tabbedPane.add(elt.getPluralName(), liste);
if (listPanelTable.size() > 1) {
Font f = UIManager.getFont("TitledBorder.font");
f = f.deriveFont(Font.BOLD);
Border b = UIManager.getBorder("TitledBorder.border");
b = BorderFactory.createLineBorder(Color.BLACK);
liste.setBorder(BorderFactory.createTitledBorder(b, elt.getPluralName(), TitledBorder.LEADING, TitledBorder.DEFAULT_POSITION, f));
}
 
tabbedPanel.add(liste, c2);
 
}
 
tabbedPane.add(key, tabbedPanel);
}
 
// Left Panel
SQLElement e = Configuration.getInstance().getDirectory().getElement(tableList);
 
424,7 → 456,7
* @return la Iliste associée, dans le cas échéant null
*/
 
private IListe getIListeFromTableName(String tableName) {
public IListe getIListeFromTableName(String tableName) {
IListe liste = null;
for (int i = 0; i < this.vectListePanel.size(); i++) {
IListPanel listeTmp = this.vectListePanel.get(i);