Copyright © 2011 Citra Technologies. All Rights Reserved.

com.citra.filter
Class GenericVisualFilter

java.lang.Object
  extended by com.citra.filter.VisualFilter
      extended by com.citra.filter.StringVisualFilter
          extended by com.citra.filter.GenericVisualFilter

public class GenericVisualFilter
extends StringVisualFilter

GenericVisualFilter is a VisualFilter suitable for filtering Objects other than Strings, Numbers, Boolean and Dates. Its behaviour is similar to StringVisualFilter, from which it extends. However, it uses a combo box as input for the filter values only. Additionally, GenericVisualFilter uses a Format in order to convert the Objects to Strings and vice-versa. The default format is one that parses and formats strings with no alteration, so that in this case, GenericVisualFilter is identical to StringVisualFilter. Developers however can assign their own Format using the setFormat method.


Field Summary
protected  Format objectFormatter
          the format used to convert Objects to strings and vice-versa
 
Fields inherited from class com.citra.filter.StringVisualFilter
caseSensitive, expression, expressionBox, fieldBoxOptions, filterLabel, stringFilter, useComboBox
 
Fields inherited from class com.citra.filter.VisualFilter
anyKey, filterModel
 
Constructor Summary
GenericVisualFilter()
          Creates a new GenericVisualFilter.
 
Method Summary
 Format getFormat()
          Retrieves the format that will be used to convert Objects to strings and vice-versa.
 TableFilter getTableFilter()
          Returns a table filter object corresponding to the visual controls of the filter.
 void setFormat(Format objectFormatter)
          Assigns a new format that will be used to convert Objects to strings and vice-versa.
 void setTableFilter(TableFilter tf)
          This method should modify the visual control's values to those corresponding to the supplied TableFilter object.
 void setUseComboBox(boolean useComboBox)
          Determines whether a text field or a combo box is used to enter filter values.
 boolean shouldApplyFilter()
          Returns true if the current filter should be applied, false otherwise. Sometimes, can opt NOT to filter, e.g. if a number or a date is not parseable.
 
Methods inherited from class com.citra.filter.StringVisualFilter
fireFilter, getCaseSensitive, getExpression, getExpressionBox, getFieldBoxOptions, getFilter, getFilterLabel, getPanel, getUseComboBox, setFilter
 
Methods inherited from class com.citra.filter.VisualFilter
getFilterModel, getFilterOnKey, setFilterOnKey
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

objectFormatter

protected Format objectFormatter
the format used to convert Objects to strings and vice-versa

Constructor Detail

GenericVisualFilter

public GenericVisualFilter()
Creates a new GenericVisualFilter.

Method Detail

getFormat

public Format getFormat()
Retrieves the format that will be used to convert Objects to strings and vice-versa.

Returns:
the format used to convert Objects to strings and vice-versa

getTableFilter

public TableFilter getTableFilter()
Returns a table filter object corresponding to the visual controls of the filter.

Overrides:
getTableFilter in class StringVisualFilter
Returns:
a table filter

setUseComboBox

public void setUseComboBox(boolean useComboBox)
Determines whether a text field or a combo box is used to enter filter values.

Overrides:
setUseComboBox in class StringVisualFilter
Parameters:
useComboBox - true if a combo box is used, or false, in the case of a text field

setFormat

public void setFormat(Format objectFormatter)
Assigns a new format that will be used to convert Objects to strings and vice-versa.

Parameters:
objectFormatter - the format used to convert Objects to strings and vice-versa

setTableFilter

public void setTableFilter(TableFilter tf)
This method should modify the visual control's values to those corresponding to the supplied TableFilter object.

Overrides:
setTableFilter in class StringVisualFilter
Parameters:
tf - the TableFilter to set.

shouldApplyFilter

public boolean shouldApplyFilter()
Returns true if the current filter should be applied, false otherwise. Sometimes, can opt NOT to filter, e.g. if a number or a date is not parseable.

Overrides:
shouldApplyFilter in class StringVisualFilter
Returns:
true if the filter should be applied

Copyright © 2011 Citra Technologies. All Rights Reserved.