1 package fr.ifremer.quadrige3.ui.swing.component.number;
2
3 /*
4 * #%L
5 * JAXX :: Widgets
6 * %%
7 * Copyright (C) 2008 - 2014 CodeLutin
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 java.io.Serializable;
25
26 /**
27 * Put here all immutable options used to init the number editor.
28 *
29 * Created on 11/23/14.
30 *
31 * @author Tony Chemit - chemit@codelutin.com
32 * @since 2.17
33 */
34 public class NumberEditorConfig implements Serializable {
35
36 private static final long serialVersionUID = 1L;
37
38 /**
39 * Optional property where to bind the number value in optional bean.
40 */
41 protected String property;
42
43 /**
44 * Should you allowed signed number ?
45 */
46 protected boolean useSign = true;
47
48 /**
49 * Should you allowed decimal number ?
50 */
51 protected Boolean useDecimal;
52
53 /**
54 * Type of number.
55 */
56 protected Class<?> numberType;
57
58 /**
59 * When a error occurs, previous valid value is repush in textField,
60 * with this flag setted to true then also reselect this content.
61 */
62 protected boolean selectAllTextOnError;
63
64 public Class<?> getNumberType() {
65 return numberType;
66 }
67
68 public void setNumberType(Class<?> numberType) {
69 this.numberType = numberType;
70 }
71
72 public String getProperty() {
73 return property;
74 }
75
76 public void setProperty(String property) {
77 this.property = property;
78 }
79
80 public boolean isSelectAllTextOnError() {
81 return selectAllTextOnError;
82 }
83
84 public void setSelectAllTextOnError(boolean selectAllTextOnError) {
85 this.selectAllTextOnError = selectAllTextOnError;
86 }
87
88 public boolean isUseSign() {
89 return useSign;
90 }
91
92 public void setUseSign(boolean useSign) {
93 this.useSign = useSign;
94 }
95
96 public Boolean getUseDecimal() {
97 return useDecimal;
98 }
99
100 public void setUseDecimal(Boolean useDecimal) {
101 this.useDecimal = useDecimal;
102 }
103 }