|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jidesoft.filter.AbstractFilter<T>
public abstract class AbstractFilter<T>
This abstract class provides default implementations for most of the methods in the Filter
interface. It
takes care of the management of listeners and provides some conveniences for generating FilterEvent
and
dispatching them to the listeners. To create a concrete Filter
as a subclass of
AbstractTableModel
you need only provide implementations for the following one methods:
public boolean isValueFiltered();Please note, for backward compatible reason, this class implement com.jidesoft.grid.Filter which is deprecated already. It will be changed to implement com.jidesoft.filter.Filter after a few releases.
Field Summary |
---|
Fields inherited from interface com.jidesoft.filter.Filter |
---|
ALL, CUSTOM, NULL, SEPARATOR |
Constructor Summary | |
---|---|
AbstractFilter()
|
|
AbstractFilter(String name)
|
Method Summary | |
---|---|
void |
addFilterListener(FilterListener l)
Adds a listener to the list that's notified each time a change to the filter occurs. |
Object |
clone()
Creates and returns a copy of the filter. |
void |
fireFilterChanged(FilterEvent e)
Forwards the given notification event to all FilterListeners that registered themselves as listeners
for this table model. |
void |
fireFilterContentChanged()
Notifies all listeners that the filter content is changed. |
void |
fireFilterDisabled()
Notifies all listeners that the filter is disabled. |
void |
fireFilterEnabled()
Notifies all listeners that the filter is enabled. |
void |
fireFilterNameChanged()
Notifies all listeners that the filter's name is changed. |
static String |
getConditionString(Locale locale,
String dataType,
String resourceKey)
|
FilterFactory |
getFilterFactory()
Gets the FilterFactory that creates the Filter . |
String |
getFilterFactoryName()
Gets the FilterFactory name that creates the Filter . |
FilterListener[] |
getFilterListeners()
Returns an array of all the filter listeners registered on this filter. |
String |
getName()
Gets the name of the filter. |
ObjectGrouper |
getObjectGrouper()
Gets the current ObjectGrouper instance. |
String |
getObjectGrouperName()
Gets the name of object grouper. |
String |
getPreference(Class<?> clazz,
ConverterContext converterContext)
Gets the preference while persisting this filter. |
boolean |
isEnabled()
Checks if the filter is enabled. |
boolean |
isFilterValid()
Checks if the filter is valid or not. |
void |
removeFilterListener(FilterListener l)
Removes a listener from the list that's notified each time a change to the filter occurs. |
void |
setEnabled(boolean enabled)
Sets the filter enabled or disabled. |
void |
setFilterFactory(FilterFactory filterFactory)
Sets the FilterFactory . |
void |
setFilterFactoryName(String filterFactoryName)
Sets the name of the FilterFactory . |
void |
setName(String name)
Sets the name of the filter. |
void |
setObjectGrouper(ObjectGrouper objectGrouper)
Sets the current ObjectGrouper instance. |
void |
setObjectGrouperName(String grouperName)
Sets the name of object grouper. |
Object[] |
setPreference(String prefString,
Class<?> clazz,
ConverterContext converterContext)
Sets the preference to load the preference string back to this filter. |
boolean |
stricterThan(Filter inputFilter)
Checks if this filter is stricter than the input filter. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.jidesoft.filter.Filter |
---|
isValueFiltered |
Constructor Detail |
---|
public AbstractFilter()
public AbstractFilter(String name)
Method Detail |
---|
public String getName()
Filter
getName
in interface Filter<T>
public void setName(String name)
Filter
setName
in interface Filter<T>
name
- the name of the filter.public boolean isEnabled()
Filter
isEnabled
in interface Filter<T>
public void setEnabled(boolean enabled)
Filter
setEnabled
in interface Filter<T>
enabled
- true to enabled the filter; false to disable it.public FilterFactory getFilterFactory()
FilterFactory
that creates the Filter
. If this Filter is created by FilterFactoryManager.createFilter(String, Class, Object...)
or FilterFactoryManager.createFilter(FilterFactory,
Object...)
, this method will return that FilterFactory
.
getFilterFactory
in interface Filter<T>
FilterFactory
that creates the Filter
. It could be null if the Filter is
not created by FilterFactory
public void setFilterFactory(FilterFactory filterFactory)
FilterFactory
. You probably don't need to call this method unless you create a
Filter
by code but you want the CustomFilterEditor
to recognize it. In this case, you
can call FilterFactoryManager.findFilterFactoryByName(Class, String)
.
setFilterFactory
in interface Filter<T>
filterFactory
- the FilterFactory
.public String getFilterFactoryName()
FilterFactory
name that creates the Filter
. If this Filter is created by
FilterFactoryManager.createFilter(String, Class, Object...)
or FilterFactoryManager.createFilter(FilterFactory, Object...)
, this method will return that
FilterFactoryName
.
getFilterFactoryName
in interface Filter<T>
FilterFactory
that creates the Filter
. It could be null if the
Filter is not created by FilterFactory
.public void setFilterFactoryName(String filterFactoryName)
FilterFactory
. You probably don't need to call this method unless you create a
Filter
by code but you want the CustomFilterEditor
to recognize it. In this case, you
can call FilterFactoryManager.findFilterFactoryByName(Class, String)
. The other use
case is the Filter is persisted using Java Serialization and the FilterFactory field is transient so it won't be
persisted. In this case, you can call findFilterFactoryByName to find the FilterFactory based on the getFilterFactoryName()
.
setFilterFactoryName
in interface Filter<T>
filterFactoryName
- the name of the FilterFactory
.public void addFilterListener(FilterListener l)
addFilterListener
in interface Filter<T>
l
- the FilterListenerpublic void removeFilterListener(FilterListener l)
removeFilterListener
in interface Filter<T>
l
- the FilterListenerpublic FilterListener[] getFilterListeners()
FilterListener
s or an empty array if no filter listeners are currently
registeredaddFilterListener(com.jidesoft.grid.FilterListener)
,
removeFilterListener(com.jidesoft.grid.FilterListener)
public void fireFilterChanged(FilterEvent e)
FilterListeners
that registered themselves as listeners
for this table model.
e
- the event to be forwardedaddFilterListener(com.jidesoft.grid.FilterListener)
,
FilterEvent
,
EventListenerList
public void fireFilterEnabled()
FilterEvent
,
EventListenerList
public void fireFilterDisabled()
FilterEvent
,
EventListenerList
public void fireFilterNameChanged()
FilterEvent
,
EventListenerList
public void fireFilterContentChanged()
FilterEvent
,
EventListenerList
public static String getConditionString(Locale locale, String dataType, String resourceKey)
public boolean stricterThan(Filter inputFilter)
stricterThan
in interface Filter<T>
inputFilter
- the input filter
public ObjectGrouper getObjectGrouper()
ObjectGrouperSupport
getObjectGrouper
in interface ObjectGrouperSupport
public void setObjectGrouper(ObjectGrouper objectGrouper)
ObjectGrouperSupport
setObjectGrouper
in interface ObjectGrouperSupport
objectGrouper
- the grouperpublic void setObjectGrouperName(String grouperName)
ObjectGrouperSupport
setObjectGrouperName
in interface ObjectGrouperSupport
grouperName
- the grouper namepublic String getObjectGrouperName()
ObjectGrouperSupport
getObjectGrouperName
in interface ObjectGrouperSupport
public String getPreference(Class<?> clazz, ConverterContext converterContext)
Filter
getPreference
in interface Filter<T>
clazz
- the class type to convert the values inside the filter to stringconverterContext
- the converter context to convert the values inside the filter to string
public Object[] setPreference(String prefString, Class<?> clazz, ConverterContext converterContext)
Filter
setPreference
in interface Filter<T>
prefString
- the preference stringclazz
- the class type to convert the values inside the filter to stringconverterContext
- the converter context to convert the values inside the filter to string
public Object clone() throws CloneNotSupportedException
clone
in interface Filter<T>
clone
in class Object
CloneNotSupportedException
- if the cloning of the filter is not supported.public boolean isFilterValid()
setPreference(String, Class, com.jidesoft.converter.ConverterContext)
is valid or not.
|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |