View Javadoc
1   package fr.ifremer.dali.ui.swing.content.manage.referential.samplingequipment.table;
2   
3   /*
4    * #%L
5    * Dali :: UI
6    * $Id:$
7    * $HeadURL:$
8    * %%
9    * Copyright (C) 2014 - 2015 Ifremer
10   * %%
11   * This program is free software: you can redistribute it and/or modify
12   * it under the terms of the GNU Affero General Public License as published by
13   * the Free Software Foundation, either version 3 of the License, or
14   * (at your option) any later version.
15   * 
16   * This program is distributed in the hope that it will be useful,
17   * but WITHOUT ANY WARRANTY; without even the implied warranty of
18   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19   * GNU General Public License for more details.
20   * 
21   * You should have received a copy of the GNU Affero General Public License
22   * along with this program.  If not, see <http://www.gnu.org/licenses/>.
23   * #L%
24   */
25  
26  
27  import fr.ifremer.dali.dto.ErrorAware;
28  import fr.ifremer.dali.dto.ErrorDTO;
29  import org.nuiton.util.beans.Binder;
30  import org.nuiton.util.beans.BinderFactory;
31  
32  import fr.ifremer.dali.dto.DaliBeanFactory;
33  import fr.ifremer.dali.dto.referential.SamplingEquipmentDTO;
34  import fr.ifremer.quadrige3.ui.core.dto.referential.StatusDTO;
35  import fr.ifremer.dali.dto.referential.UnitDTO;
36  import fr.ifremer.dali.ui.swing.util.table.AbstractDaliRowUIModel;
37  
38  import java.util.ArrayList;
39  import java.util.Collection;
40  import java.util.Date;
41  import java.util.List;
42  
43  /**
44   * <p>SamplingEquipmentsTableRowModel class.</p>
45   *
46   * @author Antoine
47   */
48  public class SamplingEquipmentsTableRowModel extends AbstractDaliRowUIModel<SamplingEquipmentDTO, SamplingEquipmentsTableRowModel> implements SamplingEquipmentDTO, ErrorAware {
49  
50  	private static final Binder<SamplingEquipmentDTO, SamplingEquipmentsTableRowModel> FROM_BEAN_BINDER =
51  			BinderFactory.newBinder(SamplingEquipmentDTO.class, SamplingEquipmentsTableRowModel.class);
52  
53  	private static final Binder<SamplingEquipmentsTableRowModel, SamplingEquipmentDTO> TO_BEAN_BINDER =
54  			BinderFactory.newBinder(SamplingEquipmentsTableRowModel.class, SamplingEquipmentDTO.class);
55  
56  	private final List<ErrorDTO> errors;
57  	
58  	/**
59  	 * <p>Constructor for SamplingEquipmentsTableRowModel.</p>
60  	 */
61  	public SamplingEquipmentsTableRowModel() {
62  		super(FROM_BEAN_BINDER, TO_BEAN_BINDER);
63          errors = new ArrayList<>();
64  	}
65  
66  	/** {@inheritDoc} */
67  	@Override
68  	protected SamplingEquipmentDTO newBean() {
69  		return DaliBeanFactory.newSamplingEquipmentDTO();
70  	}
71  
72  	/** {@inheritDoc} */
73  	@Override
74  	public String getName() {
75  		return delegateObject.getName();
76  	}
77  
78  	/** {@inheritDoc} */
79  	@Override
80  	public void setName(String mnemonique) {
81  		delegateObject.setName(mnemonique);
82  	}
83  
84  	/** {@inheritDoc} */
85  	@Override
86  	public String getDescription() {
87  		return delegateObject.getDescription();
88  	}
89  
90  	/** {@inheritDoc} */
91  	@Override
92  	public void setDescription(String description) {
93  		delegateObject.setDescription(description);
94  	}
95  
96  	/** {@inheritDoc} */
97  	@Override
98  	public Double getSize() {
99  		return delegateObject.getSize();
100 	}
101 
102 	/** {@inheritDoc} */
103 	@Override
104 	public void setSize(Double taille) {
105 		delegateObject.setSize(taille);
106 	}
107 
108 	@Override
109 	public String getComment() {
110 		return delegateObject.getComment();
111 	}
112 
113 	@Override
114 	public void setComment(String comment) {
115 		delegateObject.setComment(comment);
116 	}
117 
118 	/** {@inheritDoc} */
119 	@Override
120 	public boolean isDirty() {
121 		return delegateObject.isDirty();
122 	}
123 
124 	/** {@inheritDoc} */
125 	@Override
126 	public void setDirty(boolean dirty) {
127 		delegateObject.setDirty(dirty);
128 	}
129 
130 	@Override
131 	public boolean isReadOnly() {
132 		return delegateObject.isReadOnly();
133 	}
134 
135 	@Override
136 	public void setReadOnly(boolean readOnly) {
137 		delegateObject.setReadOnly(readOnly);
138 	}
139 
140 	@Override
141 	public Date getCreationDate() {
142 		return delegateObject.getCreationDate();
143 	}
144 
145 	@Override
146 	public void setCreationDate(Date date) {
147 		delegateObject.setCreationDate(date);
148 	}
149 
150 	@Override
151 	public Date getUpdateDate() {
152 		return delegateObject.getUpdateDate();
153 	}
154 
155 	@Override
156 	public void setUpdateDate(Date date) {
157 		delegateObject.setUpdateDate(date);
158 	}
159 
160 	/** {@inheritDoc} */
161 	@Override
162 	public StatusDTO getStatus() {
163 		return delegateObject.getStatus();
164 	}
165 
166 	/** {@inheritDoc} */
167 	@Override
168 	public void setStatus(StatusDTO status) {
169 		delegateObject.setStatus(status);
170 	}
171 
172 	/** {@inheritDoc} */
173 	@Override
174 	public UnitDTO getUnit() {
175 		return delegateObject.getUnit();
176 	}
177 
178 	/** {@inheritDoc} */
179 	@Override
180 	public void setUnit(UnitDTO unit) {
181 		delegateObject.setUnit(unit);
182 	}
183 
184 	/** {@inheritDoc} */
185 	@Override
186 	public Collection<ErrorDTO> getErrors() {
187 		return errors;
188 	}
189 }