View Javadoc
1   package fr.ifremer.dali.ui.swing.util.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  import fr.ifremer.quadrige3.ui.core.dto.QuadrigeBean;
27  import fr.ifremer.quadrige3.ui.swing.table.AbstractRowUIModel;
28  import org.nuiton.util.beans.Binder;
29  
30  /**
31   * <p>Abstract AbstractDaliRowUIModel class.</p>
32   *
33   * @author Ludovic Pecquot <ludovic.pecquot@e-is.pro>
34   * @param <B>
35   * @param <M>
36   */
37  public abstract class AbstractDaliRowUIModel<B extends QuadrigeBean, M extends AbstractDaliRowUIModel<B, M>> extends AbstractRowUIModel<B, M> {
38  
39  	/**
40  	 * <p>Constructor for AbstractDaliRowUIModel.</p>
41  	 *
42  	 * @param fromBeanBinder a {@link org.nuiton.util.beans.Binder} object.
43  	 * @param toBeanBinder a {@link org.nuiton.util.beans.Binder} object.
44  	 */
45  	public AbstractDaliRowUIModel(Binder<B, M> fromBeanBinder, Binder<M, B> toBeanBinder) {
46  		super(fromBeanBinder, toBeanBinder);
47  	}
48  
49  	/**
50  	 * <p>isCreate.</p>
51  	 *
52  	 * @return a boolean.
53  	 */
54  	public boolean isCreate() {
55  		return delegateObject.getId() == null;
56  	}
57  
58  	/**
59  	 * <p>getId.</p>
60  	 *
61  	 * @return a {@link java.lang.Integer} object.
62  	 */
63  	public Integer getId() {
64  		return delegateObject.getId();
65  	}
66  
67  	/**
68  	 * <p>setId.</p>
69  	 *
70  	 * @param id a {@link java.lang.Integer} object.
71  	 */
72  	public void setId(Integer id) {
73  		delegateObject.setId(id);
74  	}
75  
76  }