OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

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

Rev 181 Rev 183
Line 11... Line 11...
11
import org.openconcerto.erp.modules.AbstractModule;
11
import org.openconcerto.erp.modules.AbstractModule;
12
import org.openconcerto.erp.modules.ComponentsContext;
12
import org.openconcerto.erp.modules.ComponentsContext;
13
import org.openconcerto.erp.modules.ModuleFactory;
13
import org.openconcerto.erp.modules.ModuleFactory;
14
import org.openconcerto.sql.element.SQLElement;
14
import org.openconcerto.sql.element.SQLElement;
15
import org.openconcerto.sql.model.SQLField;
15
import org.openconcerto.sql.model.SQLField;
-
 
16
import org.openconcerto.sql.model.SQLRowAccessor;
16
import org.openconcerto.sql.model.SQLRowValues;
17
import org.openconcerto.sql.model.SQLRowValues;
17
import org.openconcerto.sql.view.list.IListe;
18
import org.openconcerto.sql.view.list.IListe;
18
import org.openconcerto.sql.view.list.IListeAction.IListeEvent;
19
import org.openconcerto.sql.view.list.IListeAction.IListeEvent;
19
import org.openconcerto.sql.view.list.RowAction;
20
import org.openconcerto.sql.view.list.RowAction;
20
import org.openconcerto.ui.FrameUtil;
21
import org.openconcerto.ui.FrameUtil;
Line 28... Line 29...
28
    @Override
29
	@Override
29
    protected void setupComponents(final ComponentsContext ctxt) {
30
	protected void setupComponents(final ComponentsContext ctxt) {
30
 
31
 
31
        super.setupComponents(ctxt);
32
		super.setupComponents(ctxt);
32
        final SQLElement element = ctxt.getElement("ARTICLE");
33
		final SQLElement element = ctxt.getElement("ARTICLE");
33
        final RowAction.PredicateRowAction editAction = new RowAction.PredicateRowAction(new AbstractAction("Traitement par lot...") {
34
		final RowAction.PredicateRowAction editAction = new RowAction.PredicateRowAction(
-
 
35
				new AbstractAction("Traitement par lot...") {
34
 
36
 
35
            @Override
37
					@Override
36
            public void actionPerformed(ActionEvent e) {
38
					public void actionPerformed(ActionEvent e) {
37
                final List<SQLRowValues> rows = IListe.get(e).getSelectedRows();
39
						final List<SQLRowAccessor> rows = IListe.get(e).getSelectedRowAccessors();
38
                final int size = rows.size();
40
						final int size = rows.size();
39
                if (size > 0) {
41
						if (size > 0) {
40
                    final JFrame f = new JFrame();
42
							final JFrame f = new JFrame();
41
                    if (size > 1) {
43
							if (size > 1) {
42
                        f.setTitle("Traitement des " + size + " " + element.getPluralName());
44
								f.setTitle("Traitement des " + size + " " + element.getPluralName());
Line 51... Line 53...
51
                            return fieldName.contains("METRIQUE") || fieldName.equals("ID_STOCK");
53
									return fieldName.contains("METRIQUE") || fieldName.equals("ID_STOCK");
52
                        }
54
								}
53
 
55
 
54
                    };
56
							};
55
 
57
 
-
 
58
							f.setContentPane(
56
                    f.setContentPane(new BatchEditorPanel(ctxt.getElement("ARTICLE").getDirectory(), rows, filter));
59
									new BatchEditorPanel(ctxt.getElement("ARTICLE").getDirectory(), rows, filter));
57
                    f.pack();
60
							f.pack();
58
                    f.setMinimumSize(new Dimension(400, 300));
61
							f.setMinimumSize(new Dimension(400, 300));
59
                    f.setLocationRelativeTo(IListe.get(e));
62
							f.setLocationRelativeTo(IListe.get(e));
60
                    FrameUtil.show(f);
63
							FrameUtil.show(f);
61
                }
64
						}