View Javadoc
1   package fr.ifremer.reefdb.ui.swing.content.observation.shared;
2   
3   /*
4    * #%L
5    * Reef DB :: 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.reefdb.dto.data.measurement.MeasurementDTO;
27  import fr.ifremer.reefdb.ui.swing.util.table.ReefDbColumnIdentifier;
28  
29  import java.util.ArrayList;
30  import java.util.HashSet;
31  import java.util.List;
32  import java.util.Set;
33  
34  /**
35   * Modele pour les mesures de l'observation.
36   */
37  public abstract class AbstractMeasurementsMultiEditUIModel<
38      B extends MeasurementDTO,
39      R extends AbstractMeasurementsGroupedRowModel<B, R>,
40      M extends AbstractMeasurementsMultiEditUIModel<B, R, M>>
41      extends AbstractMeasurementsGroupedTableUIModel<B, R, M> {
42  
43      // rows selected by caller
44      Set<R> rowsToEdit;
45  
46      // pmfm ids as read-only
47      List<Integer> readOnlyPmfmIds;
48  
49      public Set<R> getRowsToEdit() {
50          if (rowsToEdit == null)
51              rowsToEdit = new HashSet<>();
52          return rowsToEdit;
53      }
54  
55      public void setRowsToEdit(Set<R> rowsToEdit) {
56          this.rowsToEdit = rowsToEdit;
57      }
58  
59      public List<Integer> getReadOnlyPmfmIds() {
60          if (readOnlyPmfmIds == null)
61              readOnlyPmfmIds = new ArrayList<>();
62          return readOnlyPmfmIds;
63      }
64  
65      public void setReadOnlyPmfmIds(List<Integer> readOnlyPmfmIds) {
66          this.readOnlyPmfmIds = readOnlyPmfmIds;
67      }
68  
69      public abstract Set<ReefDbColumnIdentifier<R>> getIdentifiersToCheck();
70  
71  }