View Javadoc
1   /*
2    * Copyright (c) 2002-2022, City of Paris
3    * All rights reserved.
4    *
5    * Redistribution and use in source and binary forms, with or without
6    * modification, are permitted provided that the following conditions
7    * are met:
8    *
9    *  1. Redistributions of source code must retain the above copyright notice
10   *     and the following disclaimer.
11   *
12   *  2. Redistributions in binary form must reproduce the above copyright notice
13   *     and the following disclaimer in the documentation and/or other materials
14   *     provided with the distribution.
15   *
16   *  3. Neither the name of 'Mairie de Paris' nor 'Lutece' nor the names of its
17   *     contributors may be used to endorse or promote products derived from
18   *     this software without specific prior written permission.
19   *
20   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21   * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23   * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
24   * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25   * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26   * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27   * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28   * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29   * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30   * POSSIBILITY OF SUCH DAMAGE.
31   *
32   * License 1.0
33   */
34  package fr.paris.lutece.portal.business.user.attribute;
35  
36  /**
37   *
38   * AttributeField
39   *
40   */
41  public class AttributeField
42  {
43      private int _nIdField;
44      private IAttribute _attribute;
45      private String _strTitle;
46      private String _strValue;
47      private boolean _bDefaultValue;
48      private int _nPosition;
49      private int _nHeight;
50      private int _nWidth;
51      private int _nMaxSizeEnter;
52      private boolean _bMultiple;
53  
54      /**
55       * Set ID field
56       * 
57       * @param nIdField
58       *            ID Field
59       */
60      public void setIdField( int nIdField )
61      {
62          _nIdField = nIdField;
63      }
64  
65      /**
66       * Get ID Field
67       * 
68       * @return ID Field
69       */
70      public int getIdField( )
71      {
72          return _nIdField;
73      }
74  
75      /**
76       * Set attribute
77       * 
78       * @param attribute
79       *            attribute
80       */
81      public void setAttribute( IAttribute attribute )
82      {
83          _attribute = attribute;
84      }
85  
86      /**
87       * Get attribute
88       * 
89       * @return attribute
90       */
91      public IAttribute getAttribute( )
92      {
93          return _attribute;
94      }
95  
96      /**
97       *
98       * @return the title of the field
99       */
100     public String getTitle( )
101     {
102         return _strTitle;
103     }
104 
105     /**
106      * set the title of the field
107      * 
108      * @param title
109      *            the title of the field
110      */
111     public void setTitle( String title )
112     {
113         _strTitle = title;
114     }
115 
116     /**
117      *
118      * @return the value of the field
119      */
120     public String getValue( )
121     {
122         return _strValue;
123     }
124 
125     /**
126      * set the value of the field
127      * 
128      * @param value
129      *            the value of the field
130      */
131     public void setValue( String value )
132     {
133         _strValue = value;
134     }
135 
136     /**
137      *
138      * @return true if the field is a default field of the entry
139      */
140     public boolean isDefaultValue( )
141     {
142         return _bDefaultValue;
143     }
144 
145     /**
146      * set true if the field is a default field of the entry
147      * 
148      * @param defaultValue
149      *            true if the field is a default field of the entry
150      */
151     public void setDefaultValue( boolean defaultValue )
152     {
153         _bDefaultValue = defaultValue;
154     }
155 
156     /**
157      *
158      * @return the position of the field in the list of the entry's fields
159      */
160     public int getPosition( )
161     {
162         return _nPosition;
163     }
164 
165     /**
166      * set the position of the field in the list of the entry's fields
167      * 
168      * @param position
169      *            the position of the field in the list of fields
170      */
171     public void setPosition( int position )
172     {
173         _nPosition = position;
174     }
175 
176     /**
177      * Get height
178      * 
179      * @return height
180      */
181     public int getHeight( )
182     {
183         return _nHeight;
184     }
185 
186     /**
187      * Set height
188      * 
189      * @param nHeight
190      *            Height
191      */
192     public void setHeight( int nHeight )
193     {
194         _nHeight = nHeight;
195     }
196 
197     /**
198      * Get width
199      * 
200      * @return width
201      */
202     public int getWidth( )
203     {
204         return _nWidth;
205     }
206 
207     /**
208      * Set width
209      * 
210      * @param nWidth
211      *            width
212      */
213     public void setWidth( int nWidth )
214     {
215         _nWidth = nWidth;
216     }
217 
218     /**
219      * Get max size enter
220      * 
221      * @return max size enter
222      */
223     public int getMaxSizeEnter( )
224     {
225         return _nMaxSizeEnter;
226     }
227 
228     /**
229      * Set max size enter
230      * 
231      * @param nMaxSizeEnter
232      *            max size enter
233      */
234     public void setMaxSizeEnter( int nMaxSizeEnter )
235     {
236         _nMaxSizeEnter = nMaxSizeEnter;
237     }
238 
239     /**
240      * Check if the attribute is multiple
241      * 
242      * @return true if it is multiple, false otherwise
243      */
244     public boolean isMultiple( )
245     {
246         return _bMultiple;
247     }
248 
249     /**
250      * Set the multiple
251      * 
252      * @param bMultiple
253      *            mutiple
254      */
255     public void setMultiple( boolean bMultiple )
256     {
257         _bMultiple = bMultiple;
258     }
259 }