com.sencha.gxt.widget.core.client.form
Class NumberPropertyEditor<N extends Number>

java.lang.Object
  extended by com.sencha.gxt.widget.core.client.form.PropertyEditor<N>
      extended by com.sencha.gxt.widget.core.client.form.NumberPropertyEditor<N>
Type Parameters:
N - the number type
All Implemented Interfaces:
Parser<N>, Renderer<N>
Direct Known Subclasses:
NumberPropertyEditor.BigDecimalPropertyEditor, NumberPropertyEditor.DoublePropertyEditor, NumberPropertyEditor.FloatPropertyEditor, NumberPropertyEditor.IntegerPropertyEditor, NumberPropertyEditor.LongPropertyEditor, NumberPropertyEditor.ShortPropertyEditor

public abstract class NumberPropertyEditor<N extends Number>
extends PropertyEditor<N>

Property editors convert typed number to strings and strings back to numbers. Editors also handle incrementing and decrementing the typed numbers.


Nested Class Summary
static class NumberPropertyEditor.BigDecimalPropertyEditor
           
static class NumberPropertyEditor.DoublePropertyEditor
           
static class NumberPropertyEditor.FloatPropertyEditor
           
static class NumberPropertyEditor.IntegerPropertyEditor
           
static class NumberPropertyEditor.LongPropertyEditor
           
static class NumberPropertyEditor.ShortPropertyEditor
           
 
Field Summary
 
Fields inherited from class com.sencha.gxt.widget.core.client.form.PropertyEditor
DEFAULT
 
Constructor Summary
NumberPropertyEditor(N incrAmount)
          Creates a new number property editor with the default number type (Double).
NumberPropertyEditor(NumberFormat format, N incrAmount)
          Creates a new number property editor.
NumberPropertyEditor(String pattern, N incrAmount)
          Creates a new number property editor.
 
Method Summary
 N decr(N value)
           
 NumberFormat getFormat()
          Returns the editor's format.
 N getIncrement()
           
 N incr(N value)
           
 N parse(CharSequence text)
           
 String render(Number value)
           
 void setFormat(NumberFormat format)
          Sets the editor's format.
 void setIncrement(N value)
           
 
Methods inherited from class com.sencha.gxt.widget.core.client.form.PropertyEditor
render
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NumberPropertyEditor

public NumberPropertyEditor(N incrAmount)
Creates a new number property editor with the default number type (Double).


NumberPropertyEditor

public NumberPropertyEditor(NumberFormat format,
                            N incrAmount)
Creates a new number property editor.

Parameters:
format - the number format

NumberPropertyEditor

public NumberPropertyEditor(String pattern,
                            N incrAmount)
Creates a new number property editor.

Parameters:
pattern - the number format pattern
Method Detail

getFormat

public NumberFormat getFormat()
Returns the editor's format.

Returns:
the number format

parse

public N parse(CharSequence text)
                       throws ParseException
Throws:
ParseException

render

public String render(Number value)

setFormat

public void setFormat(NumberFormat format)
Sets the editor's format.

Parameters:
format - the format

incr

public N incr(N value)

decr

public N decr(N value)

getIncrement

public N getIncrement()

setIncrement

public void setIncrement(N value)


Copyright © 2012. All Rights Reserved.