|
Copyright © 2011 Citra Technologies. All Rights Reserved. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
com.citra.filter.auto.JAutoFilter
public class JAutoFilter
JAutoFilter provides a panel for supplying custom filter options.
The visualization of the filter is implemented using the respective Object subclasses
of VisualFilter
, notably, BooleanVisualFilter, DateVisualFilter,
NumericalVisualFilter, StringVisualFilter and GenericVisualFilter.
When the custom auto filter dialog is displayed, a new instance of a suitable AutoFilterPanel is created, using Java's reflection API. The panel's class is associated with the class of the object being filtered. This association can be retrieved and assigned with the getDefaultFilterClass and setDefaultFilterClass methods respectively.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JPanel |
---|
JPanel.AccessibleJPanel |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary | |
---|---|
protected AbstractAutoFilterPanel |
currentAutoFilter
the currently assigned auto filter panel component |
protected Map |
filterClasses
a storage for associating filtered object classes versus AutoFilterPanel classes |
Fields inherited from class javax.swing.JComponent |
---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
JAutoFilter()
Creates a new JAutoFilter object with a border layout. |
Method Summary | |
---|---|
protected void |
createDefaultFilterClasses()
Assigns default AutoFilterPanel classes for Booleans, Numbers, Strings and Objects. |
static JDialog |
createDialog(Component parent,
String title,
boolean modal,
JAutoFilter autoFilter,
ActionListener okListener,
ActionListener cancelListener)
Creates and returns a new dialog containing the JAutoFilter object and buttons for controlling the dialog. |
AbstractAutoFilterPanel |
createNewFilterPanel(Class c)
Returns a new instance of an auto filter panel, based on the supplying class. |
Class |
getDefaultFilterClass(Class columnClass)
Returns the AutoFilterPanel class for the supplied column class. |
TableFilter |
getTableFilter()
Returns the table filter object associated with the currently showing auto filter panel. |
void |
prepareAutoFilter(Class objectClass,
String name,
int modelIndex,
Collection values,
PopupFilterHeaderModel headerModel)
Creates and adds the corresponding auto filter panel to the container. |
void |
setDefaultFilterClass(Class columnClass,
Class auto)
Assigns the AutoFilterPanel class for the supplied column class. |
void |
setTableFilter(TableFilter tf)
Assigns a new tablefilter object to the currently showing auto filter panel component. |
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected AbstractAutoFilterPanel currentAutoFilter
protected Map filterClasses
Constructor Detail |
---|
public JAutoFilter()
Method Detail |
---|
protected void createDefaultFilterClasses()
public static JDialog createDialog(Component parent, String title, boolean modal, JAutoFilter autoFilter, ActionListener okListener, ActionListener cancelListener)
The "OK" button hides the dialog and stores the selected date.
The "Cancel" button hides the dialog without storing the selected date.
Furthermore, the user can supply his own ActionListeners that will be invoked when the "OK" or "Cancel" buttons are pressed.
parent
- the parent component for the dialogtitle
- the title for the dialogmodal
- boolean specifying whether the dialog is modalautoFilter
- the auto filter panel that will be placed inside the dialogokListener
- the ActionListener invoked when "OK" is pressedcancelListener
- the ActionListener invoked when "Cancel" is pressed
public AbstractAutoFilterPanel createNewFilterPanel(Class c)
c
- the class
public Class getDefaultFilterClass(Class columnClass)
columnClass
- the class for which an AutoFilterPanel class is returned
public TableFilter getTableFilter()
public void prepareAutoFilter(Class objectClass, String name, int modelIndex, Collection values, PopupFilterHeaderModel headerModel)
values
parameter.
objectClass
- the class for which a custom filter has been requestedname
- the name of the table's columnmodelIndex
- the column's model indexvalues
- the available filter valuesheaderModel
- the header model populating the available filter valuespublic void setDefaultFilterClass(Class columnClass, Class auto)
columnClass
- the class for which an AutoFilterPanel class is assignedauto
- the AutoFilterPanel class to assignpublic void setTableFilter(TableFilter tf)
tf
- the new table filter to assign.
|
Copyright © 2011 Citra Technologies. All Rights Reserved. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |