View Javadoc

1   package org.rcfaces.core.component;
2   
3   import org.rcfaces.core.internal.component.Properties;
4   import java.util.Map;
5   import org.rcfaces.core.component.capability.IComponentLocaleCapability;
6   import java.util.Collections;
7   import org.apache.commons.logging.LogFactory;
8   import org.rcfaces.core.component.capability.ILiteralLocaleCapability;
9   import org.rcfaces.core.internal.converter.NumberFormatTypeConverter;
10  import org.rcfaces.core.component.capability.IRequiredCapability;
11  import java.util.HashMap;
12  import javax.faces.context.FacesContext;
13  import org.rcfaces.core.internal.Constants;
14  import org.rcfaces.core.component.capability.IFocusStyleClassCapability;
15  import org.rcfaces.core.component.capability.INumberFormatTypeCapability;
16  import org.rcfaces.core.component.capability.IReadOnlyCapability;
17  import org.rcfaces.core.internal.converter.LocaleConverter;
18  import org.apache.commons.logging.Log;
19  import java.util.Locale;
20  import java.util.Set;
21  import org.rcfaces.core.component.capability.IValueChangeEventCapability;
22  import org.rcfaces.core.component.capability.ISeverityStyleClassCapability;
23  import org.rcfaces.core.component.capability.ISelectionEventCapability;
24  import java.lang.Object;
25  import java.lang.String;
26  import org.rcfaces.core.internal.converter.LiteralNumberConverter;
27  import org.rcfaces.core.component.capability.IAlternateTextCapability;
28  import org.rcfaces.core.internal.component.IDataMapAccessor;
29  import java.lang.Number;
30  import javax.el.ValueExpression;
31  import java.util.HashSet;
32  import org.rcfaces.core.component.capability.IAutoTabCapability;
33  import java.util.Arrays;
34  import org.rcfaces.core.internal.manager.IValidationParameters;
35  import org.rcfaces.core.component.AbstractInputComponent;
36  
37  /**
38   * <b>NOT COMPLETE</b>
39   */
40  public class NumberEntryComponent extends AbstractInputComponent implements 
41  	IRequiredCapability,
42  	IAutoTabCapability,
43  	IValueChangeEventCapability,
44  	IFocusStyleClassCapability,
45  	ISelectionEventCapability,
46  	IReadOnlyCapability,
47  	INumberFormatTypeCapability,
48  	ILiteralLocaleCapability,
49  	IComponentLocaleCapability,
50  	ISeverityStyleClassCapability,
51  	IAlternateTextCapability,
52  	IValidationParameters {
53  
54  	private static final Log LOG = LogFactory.getLog(NumberEntryComponent.class);
55  
56  	public static final String COMPONENT_TYPE="org.rcfaces.core.numberEntry";
57  
58  	protected static final Set CAMELIA_ATTRIBUTES=new HashSet(AbstractInputComponent.CAMELIA_ATTRIBUTES);
59  	static {
60  		CAMELIA_ATTRIBUTES.addAll(Arrays.asList(new String[] {"focusStyleClass","fatalStyleClass","fractionDigits","minimum","defaultNumber","integerDigits","selectionListener","literalLocale","valueChangeListener","errorStyleClass","autoCompletion","alternateText","required","autoTab","fractionStep","styleClass","number","numberFormatType","warnStyleClass","readOnly","infoStyleClass","numberFormat","componentLocale","maximum","integerStep"}));
61  	}
62  	protected static final String CAMELIA_VALUE_ALIAS="number";
63  
64  	public NumberEntryComponent() {
65  		setRendererType(COMPONENT_TYPE);
66  	}
67  
68  	public NumberEntryComponent(String componentId) {
69  		this();
70  		setId(componentId);
71  	}
72  
73  	public int getValidationParametersCount() {
74  
75  		 
76  		 return getValidationParametersCount(null);
77  		
78  	}
79  
80  	public boolean isClientSideValidationParameter(String name) {
81  
82  
83  		return isClientSideValidationParameter(name, null);
84  		
85  	}
86  
87  	public Map getValidationParametersMap() {
88  
89  
90  		return getValidationParametersMap(null);
91  		
92  	}
93  
94  	public void setValidationParameter(String name, ValueExpression value, boolean client) {
95  
96  
97  		setValidationParameterData(name, value, client);
98  		
99  	}
100 
101 	public String getValidationParameter(String name) {
102 
103 
104 		 return getValidationParameter(name, null);
105 		
106 	}
107 
108 	public Map getClientValidationParametersMap() {
109 
110 
111 		return getClientValidationParametersMap(null);
112 		
113 	}
114 
115 	public String removeValidationParameter(String name) {
116 
117 
118 		FacesContext facesContext=getFacesContext();
119 
120 		IDataMapAccessor dataMapAccessor=engine.getDataMapAccessor(facesContext, "ValidationParameter", false);
121 		if (dataMapAccessor==null) {
122 			return null;
123 		}
124  
125  		IDataMapAccessor clientMapAccessor=engine.getDataMapAccessor(facesContext, "ClientValidationParameter", false);
126 		if (clientMapAccessor!=null) {
127 			clientMapAccessor.removeData(name, facesContext);
128 		}
129             
130 		return (String)dataMapAccessor.removeData(name, facesContext);
131 		
132 	}
133 
134 	public String setValidationParameter(String name, String value, boolean client) {
135 
136 
137 		return (String)setValidationParameterData(name, value, client);
138 		
139 	}
140 
141 	public void setValue(Object value) {
142 
143 
144 				if (value instanceof String) {
145 					value=LiteralNumberConverter.SINGLETON.getAsObject(null, this, (String)value);
146 				}
147 				
148 				super.setValue(value);
149 			
150 	}
151 
152 	public void setNumberFormatType(String formatType) {
153 
154 
155 			setNumberFormatType(((Integer)NumberFormatTypeConverter.SINGLETON.getAsObject(null, this, formatType)).intValue());
156 			
157 	}
158 
159 	public Number getNumber() {
160 
161 
162 				Object submittedValue=getSubmittedExternalValue();
163 				if (submittedValue!=null) {
164 					return (Number)submittedValue;
165 				}
166 			
167 				return (Number)getValue();
168 			
169 	}
170 
171 	public void setNumber(double number) {
172 
173 
174 				setValue(new Double(number));
175 			
176 	}
177 
178 	public void setNumber(long number) {
179 
180 
181 				setValue(new Long(number));
182 			
183 	}
184 
185 	public void setNumber(String number) {
186 
187 
188 				setValue(number);
189 			
190 	}
191 
192 	public void setMinimum(String number) {
193 
194 
195 			Number numberObject=(Number)LiteralNumberConverter.SINGLETON.getAsObject(null, this, number);
196 			setMinimum(numberObject);
197 		
198 	}
199 
200 	public void setDefaultNumber(String number) {
201 
202 
203 			Number numberObject=(Number)LiteralNumberConverter.SINGLETON.getAsObject(null, this, number);
204 			setDefaultNumber(numberObject);
205 		
206 	}
207 
208 	public void setMaximum(String number) {
209 
210 
211 			Number numberObject=(Number)LiteralNumberConverter.SINGLETON.getAsObject(null, this, number);
212 			setMaximum(numberObject);
213 		
214 	}
215 
216 	public void setLiteralLocale(String locale) {
217 
218 
219 		setLiteralLocale((Locale)LocaleConverter.SINGLETON.getAsObject(null, this, locale));
220 		
221 	}
222 
223 	public void setComponentLocale(String locale) {
224 
225 
226 		setComponentLocale((Locale)LocaleConverter.SINGLETON.getAsObject(null, this, locale));
227 		
228 	}
229 
230 	public String getValidationParameter(String name, FacesContext facesContext) {
231 
232 
233 		if (facesContext==null) {
234 			facesContext=getFacesContext();
235 		}
236 
237 		IDataMapAccessor dataMapAccessor=engine.getDataMapAccessor(facesContext, "ValidationParameter", false);
238 		if (dataMapAccessor==null) {
239 			return null;
240 		}
241             
242 		return (String)dataMapAccessor.getData(name, facesContext);
243 		
244 	}
245 
246 	public int getValidationParametersCount(FacesContext facesContext) {
247 
248 
249 		if (facesContext==null) {
250 			facesContext=getFacesContext();
251 		}
252 		IDataMapAccessor dataMapAccessor=engine.getDataMapAccessor(facesContext, "ValidationParameter", false);
253 		if (dataMapAccessor==null) {
254 			return 0;
255 		}
256 		 
257 		return dataMapAccessor.getDataCount();
258 		
259 	}
260 
261 	public Map getValidationParametersMap(FacesContext facesContext) {
262 
263 
264 		if (facesContext==null) {
265 			facesContext=getFacesContext();
266 		}
267 		
268 		IDataMapAccessor dataMapAccessor=engine.getDataMapAccessor(facesContext, "ValidationParameter", false);
269 		if (dataMapAccessor==null) {
270 			return Collections.EMPTY_MAP;
271 		}
272             
273 		return dataMapAccessor.getDataMap(facesContext);
274 		
275 	}
276 
277 	public Map getClientValidationParametersMap(FacesContext facesContext) {
278 
279 
280 		if (facesContext==null) {
281 			facesContext=getFacesContext();
282 		}
283 		
284 		IDataMapAccessor dataMapAccessor=engine.getDataMapAccessor(facesContext, "ValidationParameter", false);
285 		if (dataMapAccessor==null) {
286 			return Collections.EMPTY_MAP;
287 		}
288             
289 		Map map=dataMapAccessor.getDataMap(facesContext);
290 		if (map.isEmpty()) {
291 			return Collections.EMPTY_MAP;
292 		}
293 		
294 		IDataMapAccessor clientMapAccessor=engine.getDataMapAccessor(facesContext, "ClientValidationParameter", false);
295 		if (clientMapAccessor==null) {
296 			if (Constants.READ_ONLY_COLLECTION_LOCK_ENABLED) {
297 				map=Collections.unmodifiableMap(map);
298 			}
299 			return map;
300 		}
301 		
302 		Map client=clientMapAccessor.getDataMap(facesContext);
303 		if (client==null || client.isEmpty()) {
304 		
305 			if (Constants.READ_ONLY_COLLECTION_LOCK_ENABLED) {
306 				map=Collections.unmodifiableMap(map);
307 			}
308 			return map;
309 		}
310 		
311 		Map fmap=new HashMap(map);
312 		if (map.keySet().removeAll(client.keySet())==false) {
313 			if (Constants.READ_ONLY_COLLECTION_LOCK_ENABLED) {
314 				map=Collections.unmodifiableMap(map);
315 			}
316 			return map;
317 		}
318 		
319 		if (fmap.isEmpty()) {
320 			return Collections.EMPTY_MAP;
321 		}
322 		
323 		if (Constants.READ_ONLY_COLLECTION_LOCK_ENABLED) {
324 			fmap=Collections.unmodifiableMap(fmap);
325 		}
326 		
327 		return fmap;
328 		
329 	}
330 
331 	private Object setValidationParameterData(String name, Object value, boolean client) {
332 
333 
334 		FacesContext facesContext=getFacesContext();
335 		IDataMapAccessor dataMapAccessor=engine.getDataMapAccessor(facesContext, "ValidationParameter", true);
336 		if (client) {
337 			// On retire la limitation au niveau client si besoin !
338 			IDataMapAccessor clientMapAccessor=engine.getDataMapAccessor(facesContext, "ClientValidationParameter", false);
339 			if (clientMapAccessor!=null) {
340 				clientMapAccessor.removeData(name, facesContext);
341 			}
342 		} else {
343 			IDataMapAccessor clientMapAccessor=engine.getDataMapAccessor(facesContext, "ClientValidationParameter", true);
344 			clientMapAccessor.setData(name, Boolean.FALSE, facesContext);
345 		}
346             
347 		return dataMapAccessor.setData(name, value, facesContext);
348 		
349 	}
350 
351 	public boolean isClientSideValidationParameter(String name, FacesContext facesContext) {
352 
353 
354 		if (facesContext==null) {
355 			facesContext=getFacesContext();
356 		}
357 		
358 		IDataMapAccessor clientMapAccessor=engine.getDataMapAccessor(facesContext, "ClientValidationParameter", false);
359 		if (clientMapAccessor==null) {
360 			return false;
361 		}
362 		return (clientMapAccessor.getData(name, facesContext)==null);
363 		
364 	}
365 
366 	public boolean isAutoTab() {
367 		return isAutoTab(null);
368 	}
369 
370 	/**
371 	 * See {@link #isAutoTab() isAutoTab()} for more details
372 	 */
373 	public boolean isAutoTab(javax.faces.context.FacesContext facesContext) {
374 		return engine.getBoolProperty(Properties.AUTO_TAB, false, facesContext);
375 	}
376 
377 	/**
378 	 * Returns <code>true</code> if the attribute "autoTab" is set.
379 	 * @return <code>true</code> if the attribute is set.
380 	 */
381 	public final boolean isAutoTabSetted() {
382 		return engine.isPropertySetted(Properties.AUTO_TAB);
383 	}
384 
385 	public void setAutoTab(boolean autoTab) {
386 		engine.setProperty(Properties.AUTO_TAB, autoTab);
387 	}
388 
389 	public final void addValueChangeListener(javax.faces.event.ValueChangeListener listener) {
390 		addFacesListener(listener);
391 	}
392 
393 	public final void removeValueChangeListener(javax.faces.event.ValueChangeListener listener) {
394 		removeFacesListener(listener);
395 	}
396 
397 	public final javax.faces.event.FacesListener [] listValueChangeListeners() {
398 		return getFacesListeners(javax.faces.event.ValueChangeListener.class);
399 	}
400 
401 	public java.lang.String getFocusStyleClass() {
402 		return getFocusStyleClass(null);
403 	}
404 
405 	/**
406 	 * See {@link #getFocusStyleClass() getFocusStyleClass()} for more details
407 	 */
408 	public java.lang.String getFocusStyleClass(javax.faces.context.FacesContext facesContext) {
409 		return engine.getStringProperty(Properties.FOCUS_STYLE_CLASS, facesContext);
410 	}
411 
412 	/**
413 	 * Returns <code>true</code> if the attribute "focusStyleClass" is set.
414 	 * @return <code>true</code> if the attribute is set.
415 	 */
416 	public final boolean isFocusStyleClassSetted() {
417 		return engine.isPropertySetted(Properties.FOCUS_STYLE_CLASS);
418 	}
419 
420 	public void setFocusStyleClass(java.lang.String focusStyleClass) {
421 		engine.setProperty(Properties.FOCUS_STYLE_CLASS, focusStyleClass);
422 	}
423 
424 	public final void addSelectionListener(org.rcfaces.core.event.ISelectionListener listener) {
425 		addFacesListener(listener);
426 	}
427 
428 	public final void removeSelectionListener(org.rcfaces.core.event.ISelectionListener listener) {
429 		removeFacesListener(listener);
430 	}
431 
432 	public final javax.faces.event.FacesListener [] listSelectionListeners() {
433 		return getFacesListeners(org.rcfaces.core.event.ISelectionListener.class);
434 	}
435 
436 	public boolean isReadOnly() {
437 		return isReadOnly(null);
438 	}
439 
440 	/**
441 	 * See {@link #isReadOnly() isReadOnly()} for more details
442 	 */
443 	public boolean isReadOnly(javax.faces.context.FacesContext facesContext) {
444 		return engine.getBoolProperty(Properties.READ_ONLY, false, facesContext);
445 	}
446 
447 	/**
448 	 * Returns <code>true</code> if the attribute "readOnly" is set.
449 	 * @return <code>true</code> if the attribute is set.
450 	 */
451 	public final boolean isReadOnlySetted() {
452 		return engine.isPropertySetted(Properties.READ_ONLY);
453 	}
454 
455 	public void setReadOnly(boolean readOnly) {
456 		engine.setProperty(Properties.READ_ONLY, readOnly);
457 	}
458 
459 	public int getNumberFormatType() {
460 		return getNumberFormatType(null);
461 	}
462 
463 	/**
464 	 * See {@link #getNumberFormatType() getNumberFormatType()} for more details
465 	 */
466 	public int getNumberFormatType(javax.faces.context.FacesContext facesContext) {
467 		return engine.getIntProperty(Properties.NUMBER_FORMAT_TYPE,0, facesContext);
468 	}
469 
470 	/**
471 	 * Returns <code>true</code> if the attribute "numberFormatType" is set.
472 	 * @return <code>true</code> if the attribute is set.
473 	 */
474 	public final boolean isNumberFormatTypeSetted() {
475 		return engine.isPropertySetted(Properties.NUMBER_FORMAT_TYPE);
476 	}
477 
478 	public void setNumberFormatType(int numberFormatType) {
479 		engine.setProperty(Properties.NUMBER_FORMAT_TYPE, numberFormatType);
480 	}
481 
482 	public java.util.Locale getLiteralLocale() {
483 		return getLiteralLocale(null);
484 	}
485 
486 	/**
487 	 * See {@link #getLiteralLocale() getLiteralLocale()} for more details
488 	 */
489 	public java.util.Locale getLiteralLocale(javax.faces.context.FacesContext facesContext) {
490 		return (java.util.Locale)engine.getProperty(Properties.LITERAL_LOCALE, facesContext);
491 	}
492 
493 	/**
494 	 * Returns <code>true</code> if the attribute "literalLocale" is set.
495 	 * @return <code>true</code> if the attribute is set.
496 	 */
497 	public final boolean isLiteralLocaleSetted() {
498 		return engine.isPropertySetted(Properties.LITERAL_LOCALE);
499 	}
500 
501 	public void setLiteralLocale(java.util.Locale literalLocale) {
502 		engine.setProperty(Properties.LITERAL_LOCALE, literalLocale);
503 	}
504 
505 	public java.util.Locale getComponentLocale() {
506 		return getComponentLocale(null);
507 	}
508 
509 	/**
510 	 * See {@link #getComponentLocale() getComponentLocale()} for more details
511 	 */
512 	public java.util.Locale getComponentLocale(javax.faces.context.FacesContext facesContext) {
513 		return (java.util.Locale)engine.getProperty(Properties.COMPONENT_LOCALE, facesContext);
514 	}
515 
516 	/**
517 	 * Returns <code>true</code> if the attribute "componentLocale" is set.
518 	 * @return <code>true</code> if the attribute is set.
519 	 */
520 	public final boolean isComponentLocaleSetted() {
521 		return engine.isPropertySetted(Properties.COMPONENT_LOCALE);
522 	}
523 
524 	public void setComponentLocale(java.util.Locale componentLocale) {
525 		engine.setProperty(Properties.COMPONENT_LOCALE, componentLocale);
526 	}
527 
528 	public java.lang.String getErrorStyleClass() {
529 		return getErrorStyleClass(null);
530 	}
531 
532 	/**
533 	 * See {@link #getErrorStyleClass() getErrorStyleClass()} for more details
534 	 */
535 	public java.lang.String getErrorStyleClass(javax.faces.context.FacesContext facesContext) {
536 		return engine.getStringProperty(Properties.ERROR_STYLE_CLASS, facesContext);
537 	}
538 
539 	/**
540 	 * Returns <code>true</code> if the attribute "errorStyleClass" is set.
541 	 * @return <code>true</code> if the attribute is set.
542 	 */
543 	public final boolean isErrorStyleClassSetted() {
544 		return engine.isPropertySetted(Properties.ERROR_STYLE_CLASS);
545 	}
546 
547 	public void setErrorStyleClass(java.lang.String errorStyleClass) {
548 		engine.setProperty(Properties.ERROR_STYLE_CLASS, errorStyleClass);
549 	}
550 
551 	public java.lang.String getFatalStyleClass() {
552 		return getFatalStyleClass(null);
553 	}
554 
555 	/**
556 	 * See {@link #getFatalStyleClass() getFatalStyleClass()} for more details
557 	 */
558 	public java.lang.String getFatalStyleClass(javax.faces.context.FacesContext facesContext) {
559 		return engine.getStringProperty(Properties.FATAL_STYLE_CLASS, facesContext);
560 	}
561 
562 	/**
563 	 * Returns <code>true</code> if the attribute "fatalStyleClass" is set.
564 	 * @return <code>true</code> if the attribute is set.
565 	 */
566 	public final boolean isFatalStyleClassSetted() {
567 		return engine.isPropertySetted(Properties.FATAL_STYLE_CLASS);
568 	}
569 
570 	public void setFatalStyleClass(java.lang.String fatalStyleClass) {
571 		engine.setProperty(Properties.FATAL_STYLE_CLASS, fatalStyleClass);
572 	}
573 
574 	public java.lang.String getInfoStyleClass() {
575 		return getInfoStyleClass(null);
576 	}
577 
578 	/**
579 	 * See {@link #getInfoStyleClass() getInfoStyleClass()} for more details
580 	 */
581 	public java.lang.String getInfoStyleClass(javax.faces.context.FacesContext facesContext) {
582 		return engine.getStringProperty(Properties.INFO_STYLE_CLASS, facesContext);
583 	}
584 
585 	/**
586 	 * Returns <code>true</code> if the attribute "infoStyleClass" is set.
587 	 * @return <code>true</code> if the attribute is set.
588 	 */
589 	public final boolean isInfoStyleClassSetted() {
590 		return engine.isPropertySetted(Properties.INFO_STYLE_CLASS);
591 	}
592 
593 	public void setInfoStyleClass(java.lang.String infoStyleClass) {
594 		engine.setProperty(Properties.INFO_STYLE_CLASS, infoStyleClass);
595 	}
596 
597 	public java.lang.String getWarnStyleClass() {
598 		return getWarnStyleClass(null);
599 	}
600 
601 	/**
602 	 * See {@link #getWarnStyleClass() getWarnStyleClass()} for more details
603 	 */
604 	public java.lang.String getWarnStyleClass(javax.faces.context.FacesContext facesContext) {
605 		return engine.getStringProperty(Properties.WARN_STYLE_CLASS, facesContext);
606 	}
607 
608 	/**
609 	 * Returns <code>true</code> if the attribute "warnStyleClass" is set.
610 	 * @return <code>true</code> if the attribute is set.
611 	 */
612 	public final boolean isWarnStyleClassSetted() {
613 		return engine.isPropertySetted(Properties.WARN_STYLE_CLASS);
614 	}
615 
616 	public void setWarnStyleClass(java.lang.String warnStyleClass) {
617 		engine.setProperty(Properties.WARN_STYLE_CLASS, warnStyleClass);
618 	}
619 
620 	public java.lang.String getAlternateText() {
621 		return getAlternateText(null);
622 	}
623 
624 	/**
625 	 * See {@link #getAlternateText() getAlternateText()} for more details
626 	 */
627 	public java.lang.String getAlternateText(javax.faces.context.FacesContext facesContext) {
628 		return engine.getStringProperty(Properties.ALTERNATE_TEXT, facesContext);
629 	}
630 
631 	/**
632 	 * Returns <code>true</code> if the attribute "alternateText" is set.
633 	 * @return <code>true</code> if the attribute is set.
634 	 */
635 	public final boolean isAlternateTextSetted() {
636 		return engine.isPropertySetted(Properties.ALTERNATE_TEXT);
637 	}
638 
639 	public void setAlternateText(java.lang.String alternateText) {
640 		engine.setProperty(Properties.ALTERNATE_TEXT, alternateText);
641 	}
642 
643 	/**
644 	 * Returns a boolean value indicating if the component should complete automaticaly the user entry.
645 	 * @return true if the user entry must completed
646 	 */
647 	public boolean isAutoCompletion() {
648 		return isAutoCompletion(null);
649 	}
650 
651 	/**
652 	 * Returns a boolean value indicating if the component should complete automaticaly the user entry.
653 	 * @return true if the user entry must completed
654 	 */
655 	public boolean isAutoCompletion(javax.faces.context.FacesContext facesContext) {
656 		return engine.getBoolProperty(Properties.AUTO_COMPLETION, true, facesContext);
657 	}
658 
659 	/**
660 	 * Sets a boolean value indicating if the component should complete automaticaly the user entry.
661 	 * @param autoCompletion true if the user entry must completed
662 	 */
663 	public void setAutoCompletion(boolean autoCompletion) {
664 		engine.setProperty(Properties.AUTO_COMPLETION, autoCompletion);
665 	}
666 
667 	/**
668 	 * Sets a boolean value indicating if the component should complete automaticaly the user entry.
669 	 * @param autoCompletion true if the user entry must completed
670 	 */
671 	/**
672 	 * Returns <code>true</code> if the attribute "autoCompletion" is set.
673 	 * @return <code>true</code> if the attribute is set.
674 	 */
675 	public boolean isAutoCompletionSetted() {
676 		return engine.isPropertySetted(Properties.AUTO_COMPLETION);
677 	}
678 
679 	/**
680 	 * Returns an int value indicating the number of digits to show before the decimal separator.
681 	 * @return number of integer digits
682 	 */
683 	public int getIntegerDigits() {
684 		return getIntegerDigits(null);
685 	}
686 
687 	/**
688 	 * Returns an int value indicating the number of digits to show before the decimal separator.
689 	 * @return number of integer digits
690 	 */
691 	public int getIntegerDigits(javax.faces.context.FacesContext facesContext) {
692 		return engine.getIntProperty(Properties.INTEGER_DIGITS, 0, facesContext);
693 	}
694 
695 	/**
696 	 * Sets an int value indicating the number of digits to show before the decimal separator.
697 	 * @param integerDigits number of integer digits
698 	 */
699 	public void setIntegerDigits(int integerDigits) {
700 		engine.setProperty(Properties.INTEGER_DIGITS, integerDigits);
701 	}
702 
703 	/**
704 	 * Sets an int value indicating the number of digits to show before the decimal separator.
705 	 * @param integerDigits number of integer digits
706 	 */
707 	/**
708 	 * Returns <code>true</code> if the attribute "integerDigits" is set.
709 	 * @return <code>true</code> if the attribute is set.
710 	 */
711 	public boolean isIntegerDigitsSetted() {
712 		return engine.isPropertySetted(Properties.INTEGER_DIGITS);
713 	}
714 
715 	/**
716 	 * Returns an int value indicating the number of digits to show after the decimal separator.
717 	 * @return number of fraction digits
718 	 */
719 	public int getFractionDigits() {
720 		return getFractionDigits(null);
721 	}
722 
723 	/**
724 	 * Returns an int value indicating the number of digits to show after the decimal separator.
725 	 * @return number of fraction digits
726 	 */
727 	public int getFractionDigits(javax.faces.context.FacesContext facesContext) {
728 		return engine.getIntProperty(Properties.FRACTION_DIGITS, 0, facesContext);
729 	}
730 
731 	/**
732 	 * Sets an int value indicating the number of digits to show after the decimal separator.
733 	 * @param fractionDigits number of fraction digits
734 	 */
735 	public void setFractionDigits(int fractionDigits) {
736 		engine.setProperty(Properties.FRACTION_DIGITS, fractionDigits);
737 	}
738 
739 	/**
740 	 * Sets an int value indicating the number of digits to show after the decimal separator.
741 	 * @param fractionDigits number of fraction digits
742 	 */
743 	/**
744 	 * Returns <code>true</code> if the attribute "fractionDigits" is set.
745 	 * @return <code>true</code> if the attribute is set.
746 	 */
747 	public boolean isFractionDigitsSetted() {
748 		return engine.isPropertySetted(Properties.FRACTION_DIGITS);
749 	}
750 
751 	/**
752 	 * Returns a string value specifying the format to use (compliant with java format).
753 	 * @return number format
754 	 */
755 	public String getNumberFormat() {
756 		return getNumberFormat(null);
757 	}
758 
759 	/**
760 	 * Returns a string value specifying the format to use (compliant with java format).
761 	 * @return number format
762 	 */
763 	public String getNumberFormat(javax.faces.context.FacesContext facesContext) {
764 		return engine.getStringProperty(Properties.NUMBER_FORMAT, facesContext);
765 	}
766 
767 	/**
768 	 * Sets a string value specifying the format to use (compliant with java format).
769 	 * @param numberFormat number format
770 	 */
771 	public void setNumberFormat(String numberFormat) {
772 		engine.setProperty(Properties.NUMBER_FORMAT, numberFormat);
773 	}
774 
775 	/**
776 	 * Sets a string value specifying the format to use (compliant with java format).
777 	 * @param numberFormat number format
778 	 */
779 	/**
780 	 * Returns <code>true</code> if the attribute "numberFormat" is set.
781 	 * @return <code>true</code> if the attribute is set.
782 	 */
783 	public boolean isNumberFormatSetted() {
784 		return engine.isPropertySetted(Properties.NUMBER_FORMAT);
785 	}
786 
787 	/**
788 	 * Returns an int value specifying the step used for the integer field when increasing/decreasing the value with the up/down arrows.
789 	 * @return step
790 	 */
791 	public String getIntegerStep() {
792 		return getIntegerStep(null);
793 	}
794 
795 	/**
796 	 * Returns an int value specifying the step used for the integer field when increasing/decreasing the value with the up/down arrows.
797 	 * @return step
798 	 */
799 	public String getIntegerStep(javax.faces.context.FacesContext facesContext) {
800 		return engine.getStringProperty(Properties.INTEGER_STEP, facesContext);
801 	}
802 
803 	/**
804 	 * Sets an int value specifying the step used for the integer field when increasing/decreasing the value with the up/down arrows.
805 	 * @param integerStep step
806 	 */
807 	public void setIntegerStep(String integerStep) {
808 		engine.setProperty(Properties.INTEGER_STEP, integerStep);
809 	}
810 
811 	/**
812 	 * Sets an int value specifying the step used for the integer field when increasing/decreasing the value with the up/down arrows.
813 	 * @param integerStep step
814 	 */
815 	/**
816 	 * Returns <code>true</code> if the attribute "integerStep" is set.
817 	 * @return <code>true</code> if the attribute is set.
818 	 */
819 	public boolean isIntegerStepSetted() {
820 		return engine.isPropertySetted(Properties.INTEGER_STEP);
821 	}
822 
823 	/**
824 	 * Experimental Do not use.
825 	 */
826 	public String getFractionStep() {
827 		return getFractionStep(null);
828 	}
829 
830 	/**
831 	 * Experimental Do not use.
832 	 */
833 	public String getFractionStep(javax.faces.context.FacesContext facesContext) {
834 		return engine.getStringProperty(Properties.FRACTION_STEP, facesContext);
835 	}
836 
837 	/**
838 	 * Experimental Do not use.
839 	 */
840 	public void setFractionStep(String fractionStep) {
841 		engine.setProperty(Properties.FRACTION_STEP, fractionStep);
842 	}
843 
844 	/**
845 	 * Experimental Do not use.
846 	 */
847 	/**
848 	 * Returns <code>true</code> if the attribute "fractionStep" is set.
849 	 * @return <code>true</code> if the attribute is set.
850 	 */
851 	public boolean isFractionStepSetted() {
852 		return engine.isPropertySetted(Properties.FRACTION_STEP);
853 	}
854 
855 	public Number getMinimum() {
856 		return getMinimum(null);
857 	}
858 
859 	public Number getMinimum(javax.faces.context.FacesContext facesContext) {
860 		return (Number)engine.getValue(Properties.MINIMUM, facesContext);
861 	}
862 
863 	public void setMinimum(Number minimum) {
864 		engine.setProperty(Properties.MINIMUM, minimum);
865 	}
866 
867 	/**
868 	 * Returns <code>true</code> if the attribute "minimum" is set.
869 	 * @return <code>true</code> if the attribute is set.
870 	 */
871 	public boolean isMinimumSetted() {
872 		return engine.isPropertySetted(Properties.MINIMUM);
873 	}
874 
875 	/**
876 	 * Returns the default value.
877 	 * @return default value
878 	 */
879 	public Number getDefaultNumber() {
880 		return getDefaultNumber(null);
881 	}
882 
883 	/**
884 	 * Returns the default value.
885 	 * @return default value
886 	 */
887 	public Number getDefaultNumber(javax.faces.context.FacesContext facesContext) {
888 		return (Number)engine.getValue(Properties.DEFAULT_NUMBER, facesContext);
889 	}
890 
891 	/**
892 	 * Sets the default value.
893 	 * @param defaultNumber default value
894 	 */
895 	public void setDefaultNumber(Number defaultNumber) {
896 		engine.setProperty(Properties.DEFAULT_NUMBER, defaultNumber);
897 	}
898 
899 	/**
900 	 * Sets the default value.
901 	 * @param defaultNumber default value
902 	 */
903 	/**
904 	 * Returns <code>true</code> if the attribute "defaultNumber" is set.
905 	 * @return <code>true</code> if the attribute is set.
906 	 */
907 	public boolean isDefaultNumberSetted() {
908 		return engine.isPropertySetted(Properties.DEFAULT_NUMBER);
909 	}
910 
911 	/**
912 	 * Returns an int value specifying the upper limit for the value of the component.
913 	 * @return maximum
914 	 */
915 	public Number getMaximum() {
916 		return getMaximum(null);
917 	}
918 
919 	/**
920 	 * Returns an int value specifying the upper limit for the value of the component.
921 	 * @return maximum
922 	 */
923 	public Number getMaximum(javax.faces.context.FacesContext facesContext) {
924 		return (Number)engine.getValue(Properties.MAXIMUM, facesContext);
925 	}
926 
927 	/**
928 	 * Sets an int value specifying the upper limit for the value of the component.
929 	 * @param maximum maximum
930 	 */
931 	public void setMaximum(Number maximum) {
932 		engine.setProperty(Properties.MAXIMUM, maximum);
933 	}
934 
935 	/**
936 	 * Sets an int value specifying the upper limit for the value of the component.
937 	 * @param maximum maximum
938 	 */
939 	/**
940 	 * Returns <code>true</code> if the attribute "maximum" is set.
941 	 * @return <code>true</code> if the attribute is set.
942 	 */
943 	public boolean isMaximumSetted() {
944 		return engine.isPropertySetted(Properties.MAXIMUM);
945 	}
946 
947 	protected Set getCameliaFields() {
948 		return CAMELIA_ATTRIBUTES;
949 	}
950 
951 	protected String getCameliaValueAlias() {
952 		return CAMELIA_VALUE_ALIAS;
953 	}
954 }