View Javadoc
1   package fr.ifremer.dali.ui.swing.content.manage.referential.location.menu;
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  import fr.ifremer.dali.dto.DaliBeanFactory;
27  import fr.ifremer.dali.dto.configuration.filter.location.LocationCriteriaDTO;
28  import fr.ifremer.dali.dto.configuration.programStrategy.ProgramDTO;
29  import fr.ifremer.dali.dto.referential.GroupingDTO;
30  import fr.ifremer.dali.dto.referential.GroupingTypeDTO;
31  import fr.ifremer.dali.ui.swing.content.manage.referential.menu.AbstractReferentialMenuUIModel;
32  import org.nuiton.util.beans.Binder;
33  import org.nuiton.util.beans.BinderFactory;
34  
35  /**
36   * Modele du menu pour la gestion des lieux
37   */
38  public class LocationMenuUIModel extends AbstractReferentialMenuUIModel<LocationCriteriaDTO, LocationMenuUIModel> implements LocationCriteriaDTO {
39  
40      private static final Binder<LocationMenuUIModel, LocationCriteriaDTO> TO_BEAN_BINDER =
41              BinderFactory.newBinder(LocationMenuUIModel.class, LocationCriteriaDTO.class);
42  
43      private static final Binder<LocationCriteriaDTO, LocationMenuUIModel> FROM_BEAN_BINDER =
44              BinderFactory.newBinder(LocationCriteriaDTO.class, LocationMenuUIModel.class);
45  
46      /**
47       * Constructor.
48       */
49      public LocationMenuUIModel() {
50          super(FROM_BEAN_BINDER, TO_BEAN_BINDER);
51      }
52  
53      /** {@inheritDoc} */
54      @Override
55      protected LocationCriteriaDTO newBean() {
56          return DaliBeanFactory.newLocationCriteriaDTO();
57      }
58  
59      /** {@inheritDoc} */
60      @Override
61      public String getLabel() {
62          return delegateObject.getLabel();
63      }
64  
65      /** {@inheritDoc} */
66      @Override
67      public void setLabel(String label) {
68          delegateObject.setLabel(label);
69      }
70  
71      /** {@inheritDoc} */
72      @Override
73      public GroupingTypeDTO getGroupingType() {
74          return delegateObject.getGroupingType();
75      }
76  
77      /** {@inheritDoc} */
78      @Override
79      public void setGroupingType(GroupingTypeDTO groupingType) {
80          delegateObject.setGroupingType(groupingType);
81      }
82  
83      /** {@inheritDoc} */
84      @Override
85      public GroupingDTO getGrouping() {
86          return delegateObject.getGrouping();
87      }
88  
89      /** {@inheritDoc} */
90      @Override
91      public void setGrouping(GroupingDTO grouping) {
92          delegateObject.setGrouping(grouping);
93      }
94  
95      /** {@inheritDoc} */
96      @Override
97      public ProgramDTO getProgram() {
98          return delegateObject.getProgram();
99      }
100 
101     /** {@inheritDoc} */
102     @Override
103     public void setProgram(ProgramDTO program) {
104         delegateObject.setProgram(program);
105     }
106 
107     /** {@inheritDoc} */
108     @Override
109     public void clear() {
110         super.clear();
111         setLabel(null);
112         setGroupingType(null);
113         setGrouping(null);
114         setProgram(null);
115     }
116 
117     @Override
118     public boolean isDirty() {
119         return false;
120     }
121 
122     @Override
123     public void setDirty(boolean dirty) {
124 
125     }
126 
127     @Override
128     public boolean isReadOnly() {
129         return false;
130     }
131 
132     @Override
133     public void setReadOnly(boolean readOnly) {
134 
135     }
136 }