Copyright © 2011 Citra Technologies. All Rights Reserved.

com.citra.filter
Class CustomPopupFilterHeaderModel

java.lang.Object
  extended by com.citra.filter.FilterHeaderModel
      extended by com.citra.filter.PopupFilterHeaderModel
          extended by com.citra.filter.CustomPopupFilterHeaderModel
All Implemented Interfaces:
FilterHeaderCallback, Serializable

public class CustomPopupFilterHeaderModel
extends PopupFilterHeaderModel

CustomPopupFilterHeaderModel overrides PopupFilterHeaderModel in order to supply a custom filter.

See Also:
Serialized Form

Field Summary
protected  JAutoFilter autoFilter
          the auto filter component
protected  String CUSTOM_STRING
          a string for the 'custom' filter selection
protected  JDialog dialog
          the dialog component.
 
Fields inherited from class com.citra.filter.PopupFilterHeaderModel
allString, BLANK_STRING, box, defaultHeaderCursor, filterRenderer, hidePopupOnSelection, multipleSelection, multipleSelectionMap, NON_BLANK_STRING
 
Fields inherited from class com.citra.filter.FilterHeaderModel
ALL_VALUES_MODE, autoCreateAllFilters, columnShowing, defaultFiltersByColumnClass, filterHeader, filterMode, filterModel, ORDERED_MODE, PROGRESSIVE_MODE, removeOnInvisible, tableModel
 
Constructor Summary
CustomPopupFilterHeaderModel()
          Creates a new CustomPopupFilterHeaderModel object.
 
Method Summary
 void bringUpDialog(int c)
          Displays the custom auto filter dialog for column c.
protected  JAutoFilter createAutoFilter()
          Returns a new instance of a custom auto filter.
 JAutoFilter getAutoFilter()
          Returns the custom auto filter.
 String getCUSTOM_String()
          Returns the string used for the 'CUSTOM' filter selection.
 JDialog getDialog()
          Returns the dialog to show when a custom filter is selected.
 void installCustomFilter(TableFilter tableFilter, int c, boolean showPopup)
          Assigns a new custom table filter to the column at c.
 void installCustomFilterToModel(TableFilter tableFilter, int modelIndex, boolean showPopup)
          Assigns a new custom table filter to the column at c.
 void installFilter(Object listValue, int c)
          Assigns a new table filter to the column c.
 void installFilter(Object listValue, Object filterValue, int c)
          Assigns a new table filter to the column c. The table filter will be retrieved by calling getTableFilterForObject(filterValue, c).
 void installFilter(TableFilter tableFilter, Object listValue, Object filterValue, int c)
          Assigns a new table filter to the column c.
 void installFilterToModel(Object listValue, int modelIndex)
          Assigns a new table filter to the column with model indexmodelIndex.
 void installFilterToModel(Object listValue, Object filterValue, int modelIndex)
          Assigns a new table filter to the column with model index modelIndex.
 void installFilterToModel(TableFilter tableFilter, Object listValue, Object filterValue, int modelIndex)
          Assigns a new table filter to the column with model index modelIndex.
protected  void preparePopup(int c)
          Makes final preparations before the popup is shown on screen.
 void setAutoFilter(JAutoFilter autoFilter)
          Sets the custom auto filter.
 void updateUI()
          Calls to this method should update all components that are used to display the filter on the header.
 
Methods inherited from class com.citra.filter.PopupFilterHeaderModel
attachToTable, createDefaultFilterRenderer, createFilterWrapper, getALL_String, getBLANKS_String, getCollectionForClass, getCollectionForColumn, getComboBox, getDefaultHeaderCursor, getFilterRenderer, getHidePopupOnSelection, getMultipleSelection, getMultipleSelection, getNON_BLANKS_String, populatePopup, popupWillShow, removeFromTable, removeRenderer, retrieveMultipleSelection, setDefaultHeaderCursor, setFilterRenderer, setHidePopupOnSelection, setMultipleSelection, setMultipleSelection, setRenderer, setTableHeader, shouldProcessEvent, showPopup
 
Methods inherited from class com.citra.filter.FilterHeaderModel
addFilterInColumn, addFilterInColumns, attachToTable, convertFilterState, convertFilterState, createDefaultFilters, createTableHeader, filterIterator, getAutoCreateAllFilters, getColumnShowing, getDefaultFilter, getFilter, getFilterMode, getFilterModel, getFilterOrder, getFilterValue, getFilterValues, getFilterValues, getFilterValuesFromModel, getFilterValuesFromModel, getListValue, getRemoveOnInvisible, getTableFilter, getTableFilterForModel, getTableFilterForObject, getTableFilterForObjectToModel, getTableFilters, getTableHeader, hasFilter, inferColumnClass, inferColumnClassModel, loadFilterState, removeFilter, removeFilterFromColumn, removeFilterFromModel, removeFilterInColumns, saveFilterState, sendFilterEvent, setAutoCreateAllFilters, setColumnShowing, setDefaultFilter, setFilterMode, setFilterModel, setModel, setModel, setRemoveOnInvisible, setTableFilters
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CUSTOM_STRING

protected String CUSTOM_STRING
a string for the 'custom' filter selection


dialog

protected JDialog dialog
the dialog component.


autoFilter

protected JAutoFilter autoFilter
the auto filter component

Constructor Detail

CustomPopupFilterHeaderModel

public CustomPopupFilterHeaderModel()
Creates a new CustomPopupFilterHeaderModel object.

Method Detail

bringUpDialog

public void bringUpDialog(int c)
Displays the custom auto filter dialog for column c.

Parameters:
c - the column

createAutoFilter

protected JAutoFilter createAutoFilter()
Returns a new instance of a custom auto filter.

Returns:
a new instance of an auto filter.

getAutoFilter

public JAutoFilter getAutoFilter()
Returns the custom auto filter.

Returns:
the auto filter.

getCUSTOM_String

public String getCUSTOM_String()
Returns the string used for the 'CUSTOM' filter selection.

Returns:
the 'CUSTOM' string.

getDialog

public JDialog getDialog()
Returns the dialog to show when a custom filter is selected.

Returns:
the dialog that contains the custom filter panel.

installFilter

public void installFilter(TableFilter tableFilter,
                          Object listValue,
                          Object filterValue,
                          int c)
Assigns a new table filter to the column c.

Overrides:
installFilter in class PopupFilterHeaderModel
Parameters:
tableFilter - the new table filter to assign.
listValue - the label of the filter.
filterValue - the value of the filter.
c - the view index of the column.

installFilterToModel

public void installFilterToModel(TableFilter tableFilter,
                                 Object listValue,
                                 Object filterValue,
                                 int modelIndex)
Assigns a new table filter to the column with model index modelIndex.

Overrides:
installFilterToModel in class FilterHeaderModel
Parameters:
tableFilter - the new table filter to assign.
listValue - the label of the filter.
filterValue - the value of the filter.
modelIndex - the model index of the column.

preparePopup

protected void preparePopup(int c)
Makes final preparations before the popup is shown on screen. This implementation will add an "ALL" filter option to the popup at the top for all columns, and a "Blanks" and "Non Blanks" for String and Date column classes.

Overrides:
preparePopup in class PopupFilterHeaderModel
Parameters:
c - the column for which the popup filter will be displayed.

setAutoFilter

public void setAutoFilter(JAutoFilter autoFilter)
Sets the custom auto filter.

Parameters:
autoFilter - the auto filter to set

updateUI

public void updateUI()
Calls to this method should update all components that are used to display the filter on the header.

Overrides:
updateUI in class PopupFilterHeaderModel

installFilterToModel

public void installFilterToModel(Object listValue,
                                 int modelIndex)
Assigns a new table filter to the column with model indexmodelIndex. The table filter will be retrieved by calling getTableFilterForObjectToModel(filterValue, modelIndex), whereas the filter value will be the same as the supplied list value.

Overrides:
installFilterToModel in class FilterHeaderModel
Parameters:
listValue - the label of the filter.
modelIndex - the model index of the column.

installFilterToModel

public void installFilterToModel(Object listValue,
                                 Object filterValue,
                                 int modelIndex)
Assigns a new table filter to the column with model index modelIndex. The table filter will be retrieved by calling getTableFilterForObjectToModel(filterValue, modelIndex).

Overrides:
installFilterToModel in class FilterHeaderModel
Parameters:
listValue - the label of the filter.
filterValue - the value of the filter.
modelIndex - the model index of the column.

installFilter

public void installFilter(Object listValue,
                          int c)
Assigns a new table filter to the column c. The table filter will be retrieved by calling getTableFilterForObject(filterValue, c), whereas the filter value will be the same as the supplied list value.

Overrides:
installFilter in class FilterHeaderModel
Parameters:
listValue - the label of the filter.
c - the view index of the column.

installFilter

public void installFilter(Object listValue,
                          Object filterValue,
                          int c)
Assigns a new table filter to the column c. The table filter will be retrieved by calling getTableFilterForObject(filterValue, c).

Overrides:
installFilter in class PopupFilterHeaderModel
Parameters:
listValue - the label of the filter.
filterValue - the value of the filter.
c - the view index of the column.

installCustomFilter

public void installCustomFilter(TableFilter tableFilter,
                                int c,
                                boolean showPopup)
Assigns a new custom table filter to the column at c.

Parameters:
tableFilter - the new table filter to assign
c - the view index of the column
showPopup - true, if the custom autofilter dialog is to be displayed, false otherwise

installCustomFilterToModel

public void installCustomFilterToModel(TableFilter tableFilter,
                                       int modelIndex,
                                       boolean showPopup)
Assigns a new custom table filter to the column at c.

Parameters:
tableFilter - the new table filter to assign
modelIndex - the model index of the column
showPopup - true, if the custom autofilter dialog is to be displayed, false otherwise

Copyright © 2011 Citra Technologies. All Rights Reserved.