1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package pl.edu.agh.cast.model.mapper.internal;
19
20 import java.util.List;
21
22 import org.apache.log4j.Logger;
23
24 import pl.edu.agh.cast.model.base.BasePlugin;
25 import pl.edu.agh.cast.model.base.IDataSet;
26 import pl.edu.agh.cast.model.base.IModel;
27 import pl.edu.agh.cast.model.mapper.Mappable;
28 import pl.edu.agh.cast.model.mapper.Remover;
29
30
31
32
33
34
35
36 public abstract class AbstractRemover implements Remover {
37
38
39
40 protected static Logger log = BasePlugin.getLogger();
41
42
43
44
45 protected Mappable primaryObject;
46
47
48
49
50
51 public AbstractRemover(Mappable object) {
52 primaryObject = object;
53 }
54
55 protected static void removeDataSetFromModel(IDataSet dataSet) {
56 IModel model = dataSet.getModel();
57 List<IDataSet> dataSets = model.getDataSets();
58 dataSets.remove(dataSet);
59 model.setDataSets(dataSets);
60 }
61 }