C# Class Habanero.Faces.Win.FilterControlWin

Manages a group of filter controls that create a filter clause used to limit which rows of data to show on a DataGridView
Inheritance: PanelWin, IFilterControl
Show file Open project: Chillisoft/habanero.faces

Private Properties

Property Type Description
AddCustomFilter IControlHabanero
CreateClearButton IButton
CreateFilterButton IButton
CreateFilterButtons void
EnsureButtonsFit void
Filter_Button_Click void
FireFilterEvent void

Public Methods

Method Description
AddBooleanFilterCheckBox ( string labelText, string propertyName, bool defaultValue ) : ICheckBox

Adds a CheckBox filter that displays only rows whose boolean value matches the on-off state of the CheckBox. The column of data must have "true" or "false" as its values (boolean database fields are usually converted to true/false string values by the Habanero object manager).

AddBooleanFilterComboBox ( string labelText, string propertyName, bool defaultValue ) : IComboBox

Adds a ComboBox filter that displays only rows whose boolean value matches the true/false or null value in the ComboBox. The column (propertyName) of data must have "true" or "false" as its values (boolean database fields are usually converted to true/false string values by the Habanero object manager).

AddCustomFilter ( string labelText, ICustomFilter customFilter ) : void

Adds a custom filter which allows filtering using an ICustomFilter

AddDateFilterDateTimePicker ( string labelText, string propertyName, System.DateTime defaultValue, FilterClauseOperator filterClauseOperator, bool nullable ) : IDateTimePicker

Adds a date-time picker that filters a date column on the date chosen by the user. The given operator compares the chosen date with the date shown in the given column name.

AddDateRangeFilterComboBox ( string labelText, string columnName ) : IDateRangeComboBox

Adds a DateRangeComboBox filter which provides common date ranges such as "Today" or "This Year", so that the grid will only show rows having a date property in the given range.
Includes all dates that match the start date exactly.
Includes all dates that match the end date exactly.

AddDateRangeFilterComboBox ( string labelText, string columnName, List options, bool includeStartDate, bool includeEndDate ) : IDateRangeComboBox

Adds a DateRangeComboBox filter which provides common date ranges such as "Today" or "This Year", so that the grid will only show rows having a date property in the given range

AddDateRangeFilterComboBox ( string labelText, string columnName, bool includeStartDate, bool includeEndDate ) : IDateRangeComboBox

Adds a DateRangeComboBox filter which provides common date ranges such as "Today" or "This Year", so that the grid will only show rows having a date property in the given range

AddDefaultClearClickEvent ( ) : void

Adds the default Click Event. Enables the developer to add the default functionality back on the button click if previously removed.

AddDefaultFilterClickEvent ( ) : void

Adds the default Click Event. Enables the developer to add the default functionality back on the button click if previously removed.

AddEnumFilterComboBox ( string labelText, string propertyName, Type enumType ) : IComboBox

Adds a Filter Combo box for filtering an enum data type.

AddMultiplePropStringTextBox ( string labelText, List propertyNames ) : ITextBox

Adds a TextBox filter in which users can specify text that multiple string-value columns will be filtered on. This uses a "like" operator and accepts any strings that contain the provided clause.

AddMultiplePropStringTextBox ( string labelText, List propertyNames, FilterClauseOperator filterClauseOperator ) : ITextBox

Adds a TextBox filter in which users can specify text that multiple string-value columns will be filtered on.

AddStaticStringFilterClause ( string propertyName, FilterClauseOperator filterClauseOperator, string filterValue ) : void

Adds a static string filter StringStaticFilter to the Filter Control. This allows the developer to set a filter that is always applied and is not modifiable by or visible to the end user.

AddStringFilterComboBox ( string labelText, string propertyName, ICollection options, bool strictMatch ) : IComboBox

Adds a ComboBox filter control

AddStringFilterTextBox ( string labelText, string propertyName ) : ITextBox

Adds a TextBox filter in which users can specify text that a string-value column will be filtered on. This uses a "like" operator and accepts any strings that contain the provided clause.

AddStringFilterTextBox ( string labelText, string propertyName, FilterClauseOperator filterClauseOperator ) : ITextBox

Adds a TextBox filter in which users can specify text that a string-value column will be filtered on.

ApplyFilter ( ) : void

Applies the filter that has been captured. This allows an external control (e.g. another button click) to be used as the event that causes the filter to fire. Typically used when the filter controls are being set manually.

ClearFilters ( ) : void

Clears all the values from the filter and calls IFilterControl.ApplyFilter

Clear_Filter_Click ( object sender, EventArgs e ) : void

Clears all the values from the filter and calls IFilterControl.ApplyFilter

FilterControlWin ( IControlFactory controlFactory ) : System

Constructor for FilterControlWin

GetChildControl ( string propertyName ) : IControlHabanero

Returns the filter control used to filter the column for the given property name

GetFilterClause ( ) : IFilterClause

Returns the filter clause as a composite of all the specific clauses in each filter control in the set

RemoveDefaultClearClickEvent ( ) : void

Removes the default Click Event. Enables the developer to add custom functionality on the button click before the Clear or search happens.

RemoveDefaultFilterClickEvent ( ) : void

Removes the default Click Event. Enables the developer to add custom functionality on the button click before the filter or search happens.

Private Methods

Method Description
AddCustomFilter ( string labelText, string propertyName, ICustomFilter customFilter ) : IControlHabanero
CreateClearButton ( int buttonWidth, int buttonHeight ) : IButton
CreateFilterButton ( int buttonWidth, int buttonHeight ) : IButton
CreateFilterButtons ( IPanel filterButtonPanel ) : void
EnsureButtonsFit ( ) : void
Filter_Button_Click ( object sender, EventArgs e ) : void
FireFilterEvent ( ) : void

Method Details

AddBooleanFilterCheckBox() public method

Adds a CheckBox filter that displays only rows whose boolean value matches the on-off state of the CheckBox. The column of data must have "true" or "false" as its values (boolean database fields are usually converted to true/false string values by the Habanero object manager).
public AddBooleanFilterCheckBox ( string labelText, string propertyName, bool defaultValue ) : ICheckBox
labelText string The label to appear before the control
propertyName string The business object property on which to filter
defaultValue bool Whether the CheckBox is checked
return ICheckBox

AddBooleanFilterComboBox() public method

Adds a ComboBox filter that displays only rows whose boolean value matches the true/false or null value in the ComboBox. The column (propertyName) of data must have "true" or "false" as its values (boolean database fields are usually converted to true/false string values by the Habanero object manager).
public AddBooleanFilterComboBox ( string labelText, string propertyName, bool defaultValue ) : IComboBox
labelText string The label to appear before the control
propertyName string The business object property on which to filter
defaultValue bool Whether the CheckBox is checked
return IComboBox

AddCustomFilter() public method

Adds a custom filter which allows filtering using an ICustomFilter
public AddCustomFilter ( string labelText, ICustomFilter customFilter ) : void
labelText string The Label to appear before the control
customFilter ICustomFilter The custom filter
return void

AddDateFilterDateTimePicker() public method

Adds a date-time picker that filters a date column on the date chosen by the user. The given operator compares the chosen date with the date shown in the given column name.
public AddDateFilterDateTimePicker ( string labelText, string propertyName, System.DateTime defaultValue, FilterClauseOperator filterClauseOperator, bool nullable ) : IDateTimePicker
labelText string The label to appear before the control
propertyName string The business object property on which to filter
defaultValue System.DateTime The default date or null
filterClauseOperator FilterClauseOperator The operator used to compare /// with the date chosen by the user. The chosen date is on the /// right side of the equation.
nullable bool Whether the datetime picker allows null values
return IDateTimePicker

AddDateRangeFilterComboBox() public method

Adds a DateRangeComboBox filter which provides common date ranges such as "Today" or "This Year", so that the grid will only show rows having a date property in the given range.
Includes all dates that match the start date exactly.
Includes all dates that match the end date exactly.
public AddDateRangeFilterComboBox ( string labelText, string columnName ) : IDateRangeComboBox
labelText string The label to appear before the control
columnName string The business object property on which to filter
return IDateRangeComboBox

AddDateRangeFilterComboBox() public method

Adds a DateRangeComboBox filter which provides common date ranges such as "Today" or "This Year", so that the grid will only show rows having a date property in the given range
public AddDateRangeFilterComboBox ( string labelText, string columnName, List options, bool includeStartDate, bool includeEndDate ) : IDateRangeComboBox
labelText string The label to appear before the control
columnName string The business object property on which to filter
options List Provides a specific set of date range options to show
includeStartDate bool Includes all dates that match the start date exactly
includeEndDate bool Includes all dates that match the end date exactly
return IDateRangeComboBox

AddDateRangeFilterComboBox() public method

Adds a DateRangeComboBox filter which provides common date ranges such as "Today" or "This Year", so that the grid will only show rows having a date property in the given range
public AddDateRangeFilterComboBox ( string labelText, string columnName, bool includeStartDate, bool includeEndDate ) : IDateRangeComboBox
labelText string The label to appear before the control
columnName string The business object property on which to filter
includeStartDate bool Includes all dates that match the start date exactly
includeEndDate bool Includes all dates that match the end date exactly
return IDateRangeComboBox

AddDefaultClearClickEvent() public method

Adds the default Click Event. Enables the developer to add the default functionality back on the button click if previously removed.
public AddDefaultClearClickEvent ( ) : void
return void

AddDefaultFilterClickEvent() public method

Adds the default Click Event. Enables the developer to add the default functionality back on the button click if previously removed.
public AddDefaultFilterClickEvent ( ) : void
return void

AddEnumFilterComboBox() public method

Adds a Filter Combo box for filtering an enum data type.
public AddEnumFilterComboBox ( string labelText, string propertyName, Type enumType ) : IComboBox
labelText string The label to appear before the control
propertyName string The business object property on which to filter
enumType System.Type The Type being showen in the ComboBox
return IComboBox

AddMultiplePropStringTextBox() public method

Adds a TextBox filter in which users can specify text that multiple string-value columns will be filtered on. This uses a "like" operator and accepts any strings that contain the provided clause.
public AddMultiplePropStringTextBox ( string labelText, List propertyNames ) : ITextBox
labelText string The label to appear before the control
propertyNames List The business object propertys on which to filter
return ITextBox

AddMultiplePropStringTextBox() public method

Adds a TextBox filter in which users can specify text that multiple string-value columns will be filtered on.
public AddMultiplePropStringTextBox ( string labelText, List propertyNames, FilterClauseOperator filterClauseOperator ) : ITextBox
labelText string The label to appear before the control
propertyNames List The business object propertys on which to filter
filterClauseOperator FilterClauseOperator The operator to use for the filter clause
return ITextBox

AddStaticStringFilterClause() public method

Adds a static string filter StringStaticFilter to the Filter Control. This allows the developer to set a filter that is always applied and is not modifiable by or visible to the end user.
public AddStaticStringFilterClause ( string propertyName, FilterClauseOperator filterClauseOperator, string filterValue ) : void
propertyName string
filterClauseOperator FilterClauseOperator
filterValue string
return void

AddStringFilterComboBox() public method

Adds a ComboBox filter control
public AddStringFilterComboBox ( string labelText, string propertyName, ICollection options, bool strictMatch ) : IComboBox
labelText string The label to appear before the control
propertyName string The business object property on which to filter
options ICollection The collection of items used to fill the combo box.
strictMatch bool Whether to filter the DataGridView column on a strict match or using a LIKE operator
return IComboBox

AddStringFilterTextBox() public method

Adds a TextBox filter in which users can specify text that a string-value column will be filtered on. This uses a "like" operator and accepts any strings that contain the provided clause.
public AddStringFilterTextBox ( string labelText, string propertyName ) : ITextBox
labelText string The label to appear before the control
propertyName string The business object property on which to filter
return ITextBox

AddStringFilterTextBox() public method

Adds a TextBox filter in which users can specify text that a string-value column will be filtered on.
public AddStringFilterTextBox ( string labelText, string propertyName, FilterClauseOperator filterClauseOperator ) : ITextBox
labelText string The label to appear before the control
propertyName string The business object property on which to filter
filterClauseOperator FilterClauseOperator The operator to use for the filter clause
return ITextBox

ApplyFilter() public method

Applies the filter that has been captured. This allows an external control (e.g. another button click) to be used as the event that causes the filter to fire. Typically used when the filter controls are being set manually.
public ApplyFilter ( ) : void
return void

ClearFilters() public method

Clears all the values from the filter and calls IFilterControl.ApplyFilter
public ClearFilters ( ) : void
return void

Clear_Filter_Click() public method

Clears all the values from the filter and calls IFilterControl.ApplyFilter
public Clear_Filter_Click ( object sender, EventArgs e ) : void
sender object
e System.EventArgs
return void

FilterControlWin() public method

Constructor for FilterControlWin
public FilterControlWin ( IControlFactory controlFactory ) : System
controlFactory IControlFactory
return System

GetChildControl() public method

Returns the filter control used to filter the column for the given property name
public GetChildControl ( string propertyName ) : IControlHabanero
propertyName string The property name on the business object
return IControlHabanero

GetFilterClause() public method

Returns the filter clause as a composite of all the specific clauses in each filter control in the set
public GetFilterClause ( ) : IFilterClause
return IFilterClause

RemoveDefaultClearClickEvent() public method

Removes the default Click Event. Enables the developer to add custom functionality on the button click before the Clear or search happens.
public RemoveDefaultClearClickEvent ( ) : void
return void

RemoveDefaultFilterClickEvent() public method

Removes the default Click Event. Enables the developer to add custom functionality on the button click before the filter or search happens.
public RemoveDefaultFilterClickEvent ( ) : void
return void