1 /* 2 * Copyright (c) 2002-2014, Mairie de 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 * 39 * AttributeField 40 * 41 */ 42 public class AttributeField 43 { 44 private int _nIdField; 45 private IAttribute _attribute; 46 private String _strTitle; 47 private String _strValue; 48 private boolean _bDefaultValue; 49 private int _nPosition; 50 private int _nHeight; 51 private int _nWidth; 52 private int _nMaxSizeEnter; 53 private boolean _bMultiple; 54 55 /** 56 * Set ID field 57 * @param nIdField ID Field 58 */ 59 public void setIdField( int nIdField ) 60 { 61 _nIdField = nIdField; 62 } 63 64 /** 65 * Get ID Field 66 * @return ID Field 67 */ 68 public int getIdField( ) 69 { 70 return _nIdField; 71 } 72 73 /** 74 * Set attribute 75 * @param attribute attribute 76 */ 77 public void setAttribute( IAttribute attribute ) 78 { 79 _attribute = attribute; 80 } 81 82 /** 83 * Get attribute 84 * @return attribute 85 */ 86 public IAttribute getAttribute( ) 87 { 88 return _attribute; 89 } 90 91 /** 92 * 93 * @return the title of the field 94 */ 95 public String getTitle( ) 96 { 97 return _strTitle; 98 } 99 100 /** 101 * set the title of the field 102 * @param title the title of the field 103 */ 104 public void setTitle( String title ) 105 { 106 _strTitle = title; 107 } 108 109 /** 110 * 111 * @return the value of the field 112 */ 113 public String getValue( ) 114 { 115 return _strValue; 116 } 117 118 /** 119 * set the value of the field 120 * @param value the value of the field 121 */ 122 public void setValue( String value ) 123 { 124 _strValue = value; 125 } 126 127 /** 128 * 129 * @return true if the field is a default field of the entry 130 */ 131 public boolean isDefaultValue( ) 132 { 133 return _bDefaultValue; 134 } 135 136 /** 137 * set true if the field is a default field of the entry 138 * @param defaultValue true if the field is a default field of the entry 139 */ 140 public void setDefaultValue( boolean defaultValue ) 141 { 142 _bDefaultValue = defaultValue; 143 } 144 145 /** 146 * 147 * @return the position of the field in the list of the entry's fields 148 */ 149 public int getPosition( ) 150 { 151 return _nPosition; 152 } 153 154 /** 155 * set the position of the field in the list of the entry's fields 156 * @param position the position of the field in the list of fields 157 */ 158 public void setPosition( int position ) 159 { 160 _nPosition = position; 161 } 162 163 /** 164 * Get height 165 * @return height 166 */ 167 public int getHeight( ) 168 { 169 return _nHeight; 170 } 171 172 /** 173 * Set height 174 * @param nHeight Height 175 */ 176 public void setHeight( int nHeight ) 177 { 178 _nHeight = nHeight; 179 } 180 181 /** 182 * Get width 183 * @return width 184 */ 185 public int getWidth( ) 186 { 187 return _nWidth; 188 } 189 190 /** 191 * Set width 192 * @param nWidth width 193 */ 194 public void setWidth( int nWidth ) 195 { 196 _nWidth = nWidth; 197 } 198 199 /** 200 * Get max size enter 201 * @return max size enter 202 */ 203 public int getMaxSizeEnter( ) 204 { 205 return _nMaxSizeEnter; 206 } 207 208 /** 209 * Set max size enter 210 * @param nMaxSizeEnter max size enter 211 */ 212 public void setMaxSizeEnter( int nMaxSizeEnter ) 213 { 214 _nMaxSizeEnter = nMaxSizeEnter; 215 } 216 217 /** 218 * Check if the attribute is multiple 219 * @return true if it is multiple, false otherwise 220 */ 221 public boolean isMultiple( ) 222 { 223 return _bMultiple; 224 } 225 226 /** 227 * Set the multiple 228 * @param bMultiple mutiple 229 */ 230 public void setMultiple( boolean bMultiple ) 231 { 232 _bMultiple = bMultiple; 233 } 234 }