Copyright © 2011 Citra Technologies. All Rights Reserved.

com.citra.filter
Class StringVisualFilter

java.lang.Object
  extended by com.citra.filter.VisualFilter
      extended by com.citra.filter.StringVisualFilter
Direct Known Subclasses:
GenericVisualFilter

public class StringVisualFilter
extends VisualFilter

A VisualFilter for String values.


Field Summary
protected  JCheckBox caseSensitive
          a checkbox used to denote case(in)sensitivity.
protected  JTextField expression
          a textfield used to input the string expression.
protected  JComboBox expressionBox
          the combo box populated with the available filter values
protected  JComboBox fieldBoxOptions
          a combobox containing the filter options.
protected  JLabel filterLabel
          the label between the filter options combo box and the expression
protected  StringFilter stringFilter
          a string filter object used to filter Strings.
protected  boolean useComboBox
          flag that controls whether a text field or a combo box is used to enter filter values
 
Fields inherited from class com.citra.filter.VisualFilter
anyKey, filterModel
 
Constructor Summary
StringVisualFilter()
          Constructs a StringVisualFilter.
StringVisualFilter(boolean useComboBox)
          Constructs a StringVisualFilter.
 
Method Summary
 void fireFilter()
          Generates and forwards a filter event to the listeners of the filter model.
 JCheckBox getCaseSensitive()
          Returns a checkbox that is used to denote case(in)sensitivity for the string pattern.
 JTextField getExpression()
          Returns a textfield that is used to display and allow input of the string pattern.
 JComboBox getExpressionBox()
          Retrieves the combo box that provides the available filter values.
 JComboBox getFieldBoxOptions()
          Returns a combobox containing the filter options.
 Filter getFilter()
          Returns the filter object that this component uses to filter the values.
 JLabel getFilterLabel()
          Returns a label between the filter options combo box and the expression textfield.
 JPanel getPanel()
          Returns the panel containing the controls used to manipulate the filter.
 TableFilter getTableFilter()
          Returns a table filter object corresponding to the visual controls of the filter.
 boolean getUseComboBox()
          Determines whether a text field or a combo box is used to enter filter values.
 void setFilter(Filter filter)
          Assigns a filter object that this component uses to filter the values.
 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.
 
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

caseSensitive

protected JCheckBox caseSensitive
a checkbox used to denote case(in)sensitivity.


fieldBoxOptions

protected JComboBox fieldBoxOptions
a combobox containing the filter options.


stringFilter

protected StringFilter stringFilter
a string filter object used to filter Strings.


expression

protected JTextField expression
a textfield used to input the string expression.


filterLabel

protected JLabel filterLabel
the label between the filter options combo box and the expression


expressionBox

protected JComboBox expressionBox
the combo box populated with the available filter values


useComboBox

protected boolean useComboBox
flag that controls whether a text field or a combo box is used to enter filter values

Constructor Detail

StringVisualFilter

public StringVisualFilter()
Constructs a StringVisualFilter.


StringVisualFilter

public StringVisualFilter(boolean useComboBox)
Constructs a StringVisualFilter.

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.

Overrides:
fireFilter in class VisualFilter

getCaseSensitive

public JCheckBox getCaseSensitive()
Returns a checkbox that is used to denote case(in)sensitivity for the string pattern.

Returns:
the checkbox showing the case sensitivity

getExpression

public JTextField getExpression()
Returns a textfield that is used to display and allow input of the string pattern.

Returns:
the 'string' text field.

getExpressionBox

public JComboBox getExpressionBox()
Retrieves the combo box that provides the available filter values.

Returns:
the combo box populated with the available filter values

getFieldBoxOptions

public JComboBox getFieldBoxOptions()
Returns a combobox containing the filter options.

Returns:
the 'filter' combobox.

getFilter

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

Specified by:
getFilter in class VisualFilter
Returns:
a filter

getFilterLabel

public JLabel getFilterLabel()
Returns a label between the filter options combo box and the expression textfield.

Returns:
the 'filter' label.

getPanel

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

Specified by:
getPanel in class VisualFilter
Returns:
a panel with controls used in filtering.

getTableFilter

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

Specified by:
getTableFilter in class VisualFilter
Returns:
a table filter

getUseComboBox

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

Returns:
true, if a combo box is used, or false, in the case of a text field

setUseComboBox

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

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

setFilter

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

Specified by:
setFilter in class VisualFilter
Parameters:
filter - the filter to assign

setTableFilter

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

Specified by:
setTableFilter in class VisualFilter
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.

Specified by:
shouldApplyFilter in class VisualFilter
Returns:
true if the filter should be applied

Copyright © 2011 Citra Technologies. All Rights Reserved.