com.sencha.gxt.widget.core.client.grid.filters
Class NumericFilter<M,V extends java.lang.Number>

java.lang.Object
  extended by com.sencha.gxt.widget.core.client.grid.filters.Filter<M,V>
      extended by com.sencha.gxt.widget.core.client.grid.filters.NumericFilter<M,V>
Type Parameters:
M - the model in the store and in each grid row
V - the numeric type in the column to filter
All Implemented Interfaces:
ActivateEvent.HasActivateHandlers<Filter<M,?>>, DeactivateEvent.HasDeactivateHandlers<Filter<M,?>>, UpdateEvent.HasUpdateHandlers

public class NumericFilter<M,V extends java.lang.Number>
extends Filter<M,V>

Filter class for numeric fields. by default, converts data to double before comparing, but this behavior can be change by overriding equals(Number, Number) and greaterThan(Number, Number). See Filter for more information.


Nested Class Summary
 class NumericFilter.DefaultNumericFilterMessages
          The default locale-sensitive messages used by this class.
static interface NumericFilter.NumericFilterMessages
          The locale-sensitive messages used by this class.
 
Constructor Summary
NumericFilter(ValueProvider<? super M,V> valueProvider, NumberPropertyEditor<V> propertyEditor)
          Creates a numeric filter for the specified value provider.
 
Method Summary
 java.util.List<FilterConfig> getFilterConfig()
          Returns a list of filter configurations.
 NumericFilter.NumericFilterMessages getMessages()
          Returns the locale-sensitive messages used by this class.
 java.lang.Object getValue()
          Template method to be implemented by all subclasses that is to get and return the value of the filter.
 int getWidth()
          Returns the width used for the range sub-menu.
 boolean isActivatable()
          Template method to be implemented by all subclasses that is to return true if the filter has enough configuration information to be activated.
 void setMessages(NumericFilter.NumericFilterMessages messages)
           
 void setWidth(int width)
          Sets the width to use for the range sub-menu (defaults to 125).
 
Methods inherited from class com.sencha.gxt.widget.core.client.grid.filters.Filter
addActivateHandler, addDeactivateHandler, addUpdateHandler, getHandler, getMenu, getUpdateBuffer, getValueProvider, isActive, setActive, setHandler, setUpdateBuffer
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NumericFilter

public NumericFilter(ValueProvider<? super M,V> valueProvider,
                     NumberPropertyEditor<V> propertyEditor)
Creates a numeric filter for the specified value provider. See Filter.Filter(ValueProvider) for more information.

Parameters:
valueProvider - the value provider
propertyEditor - property editor for numeric type <V>
Method Detail

getFilterConfig

public java.util.List<FilterConfig> getFilterConfig()
Description copied from class: Filter
Returns a list of filter configurations. Note that a filter may consist of multiple criteria (e.g. "date after" and "date before"). There is a filter configuration for each of these criteria.

Specified by:
getFilterConfig in class Filter<M,V extends java.lang.Number>
Returns:
a list of filter configurations

getMessages

public NumericFilter.NumericFilterMessages getMessages()
Returns the locale-sensitive messages used by this class.

Returns:
the local-sensitive messages used by this class.

getValue

public java.lang.Object getValue()
Description copied from class: Filter
Template method to be implemented by all subclasses that is to get and return the value of the filter.

Specified by:
getValue in class Filter<M,V extends java.lang.Number>

getWidth

public int getWidth()
Returns the width used for the range sub-menu.

Returns:
the width used for the range sub-menu

isActivatable

public boolean isActivatable()
Description copied from class: Filter
Template method to be implemented by all subclasses that is to return true if the filter has enough configuration information to be activated.

Returns:
true if if the filter has enough configuration information to be activated

setMessages

public void setMessages(NumericFilter.NumericFilterMessages messages)

setWidth

public void setWidth(int width)
Sets the width to use for the range sub-menu (defaults to 125).

Parameters:
width - the width used for the range sub-menu.


Copyright © 2012. All Rights Reserved.