Copyright © 2011 Citra Technologies. All Rights Reserved.

com.citra.filter
Class VisualFilter

java.lang.Object
  extended by com.citra.filter.VisualFilter
Direct Known Subclasses:
BooleanVisualFilter, DateVisualFilter, NumericalVisualFilter, StringVisualFilter

public abstract class VisualFilter
extends Object

This class represents an object through which filters can be manipulated visually in a FilterTablePanel.


Field Summary
protected  boolean anyKey
          boolean flag that if true, filter events are fired whenever a key press is detected on a text field, otherwise the user must press the Enter key.
protected  FilterModel filterModel
          the filter model
 
Constructor Summary
VisualFilter()
          Creates a new VisualFilter object with users required to press the enter key on textfields so that the filter can be applied.
 
Method Summary
 void fireFilter()
          Generates and forwards a filter event to the listeners of the filter model.
abstract  Filter getFilter()
          Returns the filter object that this component uses to filter the values.
 FilterModel getFilterModel()
          Returns the filter model.
 boolean getFilterOnKey()
          Returns a boolean value that if true, filter events are fired whenever a key press is detected on a text field, otherwise the user must press the Enter key for this to happen.
abstract  JPanel getPanel()
          Returns the panel containing the controls used to manipulate the filter.
abstract  TableFilter getTableFilter()
          Returns a table filter object corresponding to the visual controls of the filter.
abstract  void setFilter(Filter filter)
          Assigns a filter object that this component uses to filter the values.
 void setFilterOnKey(boolean key)
          Set key to true for filter events to be fired upon key detection.
abstract  void setTableFilter(TableFilter tf)
          This method should modify the visual control's values to those corresponding to the supplied TableFilter object.
abstract  boolean shouldApplyFilter()
          Returns true if the current filter should be applied, false otherwise.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

anyKey

protected boolean anyKey
boolean flag that if true, filter events are fired whenever a key press is detected on a text field, otherwise the user must press the Enter key.


filterModel

protected FilterModel filterModel
the filter model

Constructor Detail

VisualFilter

public VisualFilter()
Creates a new VisualFilter object with users required to press the enter key on textfields so that the filter can be applied.

Method Detail

fireFilter

public void fireFilter()
Generates and forwards a filter event to the listeners of the filter model. The filter event is initialized with a TableFilter taken by calling the getTableFilter() method.


getFilter

public abstract Filter getFilter()
Returns the filter object that this component uses to filter the values.

Returns:
a filter

getFilterModel

public FilterModel getFilterModel()
Returns the filter model.

Returns:
the filter model.

getFilterOnKey

public boolean getFilterOnKey()
Returns a boolean value that if true, filter events are fired whenever a key press is detected on a text field, otherwise the user must press the Enter key for this to happen.

Returns:
true for filter events to be fired upon key detection

getPanel

public abstract JPanel getPanel()
Returns the panel containing the controls used to manipulate the filter.

Returns:
a panel with controls used in filtering.

getTableFilter

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

Returns:
a table filter

setFilter

public abstract void setFilter(Filter filter)
Assigns a filter object that this component uses to filter the values.

Parameters:
filter - the filter to assign

setFilterOnKey

public void setFilterOnKey(boolean key)
Set key to true for filter events to be fired upon key detection.

Parameters:
key - true if filter events are to be fired upon key detection

setTableFilter

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

Parameters:
tf - the TableFilter to set.

shouldApplyFilter

public abstract 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.

Returns:
true if the filter should be applied

Copyright © 2011 Citra Technologies. All Rights Reserved.