View Javadoc
1   package fr.ifremer.dali.ui.swing.content.manage.rule.pmfm;
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.referential.UnitDTO;
27  import fr.ifremer.dali.dto.referential.pmfm.*;
28  import fr.ifremer.dali.ui.swing.util.table.AbstractDaliTableModel;
29  import fr.ifremer.dali.ui.swing.util.table.DaliColumnIdentifier;
30  import fr.ifremer.quadrige3.ui.swing.table.SwingTableColumnModel;
31  
32  import static org.nuiton.i18n.I18n.n;
33  
34  /**
35   * Model.
36   */
37  public class ControlPmfmTableModel extends AbstractDaliTableModel<ControlPmfmRowModel> {
38  
39  	public static final DaliColumnIdentifier<ControlPmfmRowModel> PMFM_ID = DaliColumnIdentifier.newReadOnlyId(
40  			ControlPmfmRowModel.PROPERTY_PMFM + "." + PmfmDTO.PROPERTY_ID,
41  			n("dali.property.pmfm.id"),
42  			n("dali.property.pmfm.id"),
43  			Integer.class);
44  
45  	/** Constant <code>NAME</code> */
46  	public static final DaliColumnIdentifier<ControlPmfmRowModel> NAME = DaliColumnIdentifier.newPmfmNameId(
47  			ControlPmfmRowModel.PROPERTY_PMFM,
48  			n("dali.property.name"),
49  			n("dali.property.name"));
50  	
51  	/** Constant <code>MATRIX</code> */
52  	public static final DaliColumnIdentifier<ControlPmfmRowModel> MATRIX = DaliColumnIdentifier.newReadOnlyId(
53  			ControlPmfmRowModel.PROPERTY_PMFM + "." + PmfmDTO.PROPERTY_MATRIX,
54  			n("dali.property.pmfm.matrix"),
55  			n("dali.property.pmfm.matrix"),
56  			MatrixDTO.class);
57  	
58  	/** Constant <code>FRACTION</code> */
59  	public static final DaliColumnIdentifier<ControlPmfmRowModel> FRACTION = DaliColumnIdentifier.newReadOnlyId(
60  			ControlPmfmRowModel.PROPERTY_PMFM + "." + PmfmDTO.PROPERTY_FRACTION,
61  			n("dali.property.pmfm.fraction"),
62  			n("dali.property.pmfm.fraction"),
63  			FractionDTO.class);
64  	
65  	/** Constant <code>METHOD</code> */
66  	public static final DaliColumnIdentifier<ControlPmfmRowModel> METHOD = DaliColumnIdentifier.newReadOnlyId(
67  			ControlPmfmRowModel.PROPERTY_PMFM + "." + PmfmDTO.PROPERTY_METHOD,
68  			n("dali.property.pmfm.method"),
69  			n("dali.property.pmfm.method"),
70  			MethodDTO.class);
71  	
72  	/** Constant <code>PARAMETER</code> */
73  	public static final DaliColumnIdentifier<ControlPmfmRowModel> PARAMETER = DaliColumnIdentifier.newReadOnlyId(
74  			ControlPmfmRowModel.PROPERTY_PMFM + "." + PmfmDTO.PROPERTY_PARAMETER,
75  			n("dali.property.pmfm.parameter"),
76  			n("dali.property.pmfm.parameter"),
77  			ParameterDTO.class);
78      
79  	/** Constant <code>UNIT</code> */
80  	public static final DaliColumnIdentifier<ControlPmfmRowModel> UNIT = DaliColumnIdentifier.newReadOnlyId(
81  			ControlPmfmRowModel.PROPERTY_PMFM + "." + PmfmDTO.PROPERTY_UNIT,
82  			n("dali.property.pmfm.unit"),
83  			n("dali.property.pmfm.unit"),
84  			UnitDTO.class);
85  
86  	/**
87  	 * <p>Constructor for ControlPmfmTableModel.</p>
88  	 *
89  	 */
90  	public ControlPmfmTableModel(final SwingTableColumnModel columnModel) {
91  		super(columnModel, false, false);
92  	}
93  
94  	/** {@inheritDoc} */
95  	@Override
96  	public ControlPmfmRowModel createNewRow() {
97  		return new ControlPmfmRowModel();
98  	}
99  
100 	/** {@inheritDoc} */
101 	@Override
102 	public DaliColumnIdentifier<ControlPmfmRowModel> getFirstColumnEditing() {
103 		return null;
104 	}
105 }