1 package fr.ifremer.tutti.ui.swing.util.attachment;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27 import fr.ifremer.adagio.core.dao.referential.ObjectTypeCode;
28 import fr.ifremer.tutti.persistence.entities.data.Attachment;
29 import fr.ifremer.tutti.persistence.entities.data.AttachmentBean;
30 import fr.ifremer.tutti.persistence.entities.data.Attachments;
31 import fr.ifremer.tutti.ui.swing.util.AbstractTuttiBeanUIModel;
32 import org.nuiton.util.beans.Binder;
33 import org.nuiton.util.beans.BinderFactory;
34
35
36
37
38
39
40
41 public class AttachmentItemModel extends AbstractTuttiBeanUIModel<Attachment, AttachmentItemModel> {
42
43 private static final long serialVersionUID = 1L;
44
45 private final Attachment editObject = new AttachmentBean();
46
47 protected static Binder<AttachmentItemModel, Attachment> toBeanBinder =
48 BinderFactory.newBinder(AttachmentItemModel.class,
49 Attachment.class);
50
51 protected static Binder<Attachment, AttachmentItemModel> fromBeanBinder =
52 BinderFactory.newBinder(Attachment.class, AttachmentItemModel.class);
53
54 public AttachmentItemModel() {
55 super(fromBeanBinder, toBeanBinder);
56 }
57
58 @Override
59 protected Attachment newEntity() {
60 return Attachments.newAttachment();
61 }
62
63 public String getName() {
64 return editObject.getName();
65 }
66
67 public void setName(String name) {
68 editObject.setName(name);
69 }
70
71 public Integer getObjectId() {
72 return editObject.getObjectId();
73 }
74
75 public void setObjectId(Integer objectId) {
76 editObject.setObjectId(objectId);
77 }
78
79 public String getComment() {
80 return editObject.getComment();
81 }
82
83 public void setComment(String comment) {
84 editObject.setComment(comment);
85 }
86
87 public ObjectTypeCode getObjectType() {
88 return editObject.getObjectType();
89 }
90
91 public void setObjectType(ObjectTypeCode objectType) {
92 editObject.setObjectType(objectType);
93 }
94
95 public String getPath() {
96 return editObject.getPath();
97 }
98
99 public void setPath(String path) {
100 editObject.setPath(path);
101 }
102 }