OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

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

Rev 112 Rev 147
Line 3... Line 3...
3
import java.util.ArrayList;
3
import java.util.ArrayList;
4
import java.util.List;
4
import java.util.List;
5
 
5
 
6
import javax.swing.AbstractListModel;
6
import javax.swing.AbstractListModel;
7
import javax.swing.SwingUtilities;
7
import javax.swing.SwingUtilities;
-
 
8
import javax.swing.SwingWorker;
8
 
9
 
9
import org.openconcerto.ui.list.CheckListItem;
10
import org.openconcerto.ui.list.CheckListItem;
10
import org.openconcerto.utils.SwingWorker2;
-
 
11
 
11
 
12
public abstract class CheckListModel extends AbstractListModel {
12
public abstract class CheckListModel extends AbstractListModel {
13
    private List<CheckListItem> items = new ArrayList<CheckListItem>();
13
    private List<CheckListItem> items = new ArrayList<CheckListItem>();
14
 
14
 
15
    @Override
15
    @Override
Line 22... Line 22...
22
        return items.get(index);
22
        return items.get(index);
23
    }
23
    }
24
 
24
 
25
    public void loadContent() {
25
    public void loadContent() {
26
        assert SwingUtilities.isEventDispatchThread();
26
        assert SwingUtilities.isEventDispatchThread();
27
        SwingWorker2<List<CheckListItem>, Object> worker = new SwingWorker2<List<CheckListItem>, Object>() {
27
        SwingWorker<List<CheckListItem>, Object> worker = new SwingWorker<List<CheckListItem>, Object>() {
28
 
28
 
29
            @Override
29
            @Override
30
            protected List<CheckListItem> doInBackground() throws Exception {
30
            protected List<CheckListItem> doInBackground() throws Exception {
31
                return loadItems();
31
                return loadItems();
32
            }
32
            }