View Javadoc
1   package fr.ifremer.dali.ui.swing.content.manage.rule.controlrule.precondition;
2   
3   /*-
4    * #%L
5    * Dali :: UI
6    * %%
7    * Copyright (C) 2017 - 2018 Ifremer
8    * %%
9    * This program is free software: you can redistribute it and/or modify
10   * it under the terms of the GNU Affero General Public License as published by
11   * the Free Software Foundation, either version 3 of the License, or
12   * (at your option) any later version.
13   * 
14   * This program is distributed in the hope that it will be useful,
15   * but WITHOUT ANY WARRANTY; without even the implied warranty of
16   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17   * GNU General Public License for more details.
18   * 
19   * You should have received a copy of the GNU Affero General Public License
20   * along with this program.  If not, see <http://www.gnu.org/licenses/>.
21   * #L%
22   */
23  
24  import fr.ifremer.dali.dto.DaliBeanFactory;
25  import fr.ifremer.quadrige3.ui.core.dto.referential.StatusDTO;
26  import fr.ifremer.dali.dto.referential.pmfm.QualitativeValueDTO;
27  import fr.ifremer.dali.ui.swing.util.table.AbstractDaliRowUIModel;
28  import org.nuiton.util.beans.Binder;
29  import org.nuiton.util.beans.BinderFactory;
30  
31  import java.util.Date;
32  
33  /**
34   * @author peck7 on 05/02/2018.
35   */
36  public class RulePreconditionRowModel extends AbstractDaliRowUIModel<QualitativeValueDTO, RulePreconditionRowModel> implements QualitativeValueDTO {
37  
38      private static final Binder<QualitativeValueDTO, RulePreconditionRowModel> FROM_BEAN_BINDER =
39              BinderFactory.newBinder(QualitativeValueDTO.class, RulePreconditionRowModel.class);
40      private static final Binder<RulePreconditionRowModel, QualitativeValueDTO> TO_BEAN_BINDER =
41              BinderFactory.newBinder(RulePreconditionRowModel.class, QualitativeValueDTO.class);
42  
43      public RulePreconditionRowModel() {
44          super(FROM_BEAN_BINDER, TO_BEAN_BINDER);
45      }
46  
47  
48  
49      // Delegate methods
50  
51      @Override
52      protected QualitativeValueDTO newBean() {
53          return DaliBeanFactory.newQualitativeValueDTO();
54      }
55  
56      @Override
57      public String getDescription() {
58          return delegateObject.getDescription();
59      }
60  
61      @Override
62      public void setDescription(String description) {
63          delegateObject.setDescription(description);
64      }
65  
66      @Override
67      public String getName() {
68          return delegateObject.getName();
69      }
70  
71      @Override
72      public void setName(String name) {
73          delegateObject.setName(name);
74      }
75  
76      @Override
77      public boolean isDirty() {
78          return delegateObject.isDirty();
79      }
80  
81      @Override
82      public void setDirty(boolean dirty) {
83          delegateObject.setDirty(dirty);
84      }
85  
86      @Override
87      public boolean isReadOnly() {
88          return delegateObject.isReadOnly();
89      }
90  
91      @Override
92      public void setReadOnly(boolean readOnly) {
93          delegateObject.setReadOnly(readOnly);
94      }
95  
96      @Override
97      public Date getCreationDate() {
98          return null;
99      }
100 
101     @Override
102     public void setCreationDate(Date date) {
103 
104     }
105 
106     @Override
107     public Date getUpdateDate() {
108         return null;
109     }
110 
111     @Override
112     public void setUpdateDate(Date date) {
113 
114     }
115 
116     @Override
117     public StatusDTO getStatus() {
118         return delegateObject.getStatus();
119     }
120 
121     @Override
122     public void setStatus(StatusDTO status) {
123         delegateObject.setStatus(status);
124     }
125 }