Package ch.bailu.gtk.gtk
Class Filter
java.lang.Object
ch.bailu.gtk.type.Type
ch.bailu.gtk.type.Pointer
ch.bailu.gtk.gobject.Object
ch.bailu.gtk.gtk.Filter
- All Implemented Interfaces:
PointerInterface
- Direct Known Subclasses:
BoolFilter
,CustomFilter
,FileFilter
,MultiFilter
,StringFilter
A `GtkFilter` object describes the filtering to be performed by a
[class@Gtk.FilterListModel].
The model will use the filter to determine if it should include items
or not by calling [method@Gtk.Filter.match] for each item and only
keeping the ones that the function returns %TRUE for.
Filters may change what items they match through their lifetime. In that
case, they will emit the [signal@Gtk.Filter::changed] signal to notify
that previous filter results are no longer valid and that items should
be checked again via [method@Gtk.Filter.match].
GTK provides various pre-made filter implementations for common filtering
operations. These filters often include properties that can be linked to
various widgets to easily allow searches.
However, in particular for large lists or complex search methods, it is
also possible to subclass `GtkFilter` and provide one's own filter.
[class@Gtk.FilterListModel].
The model will use the filter to determine if it should include items
or not by calling [method@Gtk.Filter.match] for each item and only
keeping the ones that the function returns %TRUE for.
Filters may change what items they match through their lifetime. In that
case, they will emit the [signal@Gtk.Filter::changed] signal to notify
that previous filter results are no longer valid and that items should
be checked again via [method@Gtk.Filter.match].
GTK provides various pre-made filter implementations for common filtering
operations. These filters often include properties that can be linked to
various widgets to easily allow searches.
However, in particular for large lists or complex search methods, it is
also possible to subclass `GtkFilter` and provide one's own filter.
-
Nested Class Summary
Nested classes/interfaces inherited from class ch.bailu.gtk.gobject.Object
Object.OnBindingTransformFunc, Object.OnDestroyNotify, Object.OnDuplicateFunc, Object.OnNotify, Object.OnToggleNotify, Object.OnWeakNotify
-
Field Summary
Fields inherited from class ch.bailu.gtk.gobject.Object
SIGNAL_ON_NOTIFY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
changed
(int change) Notifies all users of the filter that it has changed.static ClassHandler
static int
static long
static TypeSystem.TypeSize
int
Gets the known strictness of @filters.static long
static TypeSystem.TypeSize
boolean
Checks if the given @item is matched by the filter or not.onChanged
(Filter.OnChanged signal) Connect to signal "changed".Methods inherited from class ch.bailu.gtk.gobject.Object
addToggleRef, bindProperty, bindProperty, bindPropertyFull, bindPropertyFull, bindPropertyWithClosures, bindPropertyWithClosures, compatControl, connect, connect, disconnect, disconnect, dupData, dupData, dupQdata, forceFloating, freezeNotify, get, get, getData, getData, getProperty, getProperty, getQdata, interfaceFindProperty, interfaceInstallProperty, isFloating, notify, notify, notifyByPspec, onNotify, ref, refSink, removeToggleRef, replaceData, replaceData, replaceQdata, runDispose, set, set, setData, setData, setDataFull, setDataFull, setProperty, setProperty, setQdata, setQdataFull, stealData, stealData, stealQdata, takeRef, thawNotify, unref, watchClosure, weakRef, weakUnref
Methods inherited from class ch.bailu.gtk.type.Pointer
asCPointer, cast, connectSignal, disconnectSignals, disconnectSignals, equals, hashCode, throwIfNull, throwNullPointerException, toString, unregisterCallbacks, unregisterCallbacks
Methods inherited from class ch.bailu.gtk.type.Type
asCPointer, asCPointer, asCPointerNotNull, asJnaPointer, asJnaPointer, asPointer, asPointer, cast, cast, throwIfNull
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface ch.bailu.gtk.type.PointerInterface
asCPointerNotNull, asJnaPointer, asPointer, isNotNull, isNull
-
Field Details
-
SIGNAL_ON_CHANGED
- See Also:
-
-
Constructor Details
-
Filter
-
-
Method Details
-
getClassHandler
-
changed
public void changed(int change) Notifies all users of the filter that it has changed.
This emits the [signal@Gtk.Filter::changed] signal. Users
of the filter should then check items again via
[method@Gtk.Filter.match].
Depending on the @change parameter, not all items need to
be changed, but only some. Refer to the [enum@Gtk.FilterChange]
documentation for details.
This function is intended for implementors of `GtkFilter`
subclasses and should not be called from other functions.- Parameters:
change
- How the filter changed
-
getStrictness
public int getStrictness()Gets the known strictness of @filters.
If the strictness is not known, %GTK_FILTER_MATCH_SOME is returned.
This value may change after emission of the [signal@Gtk.Filter::changed]
signal.
This function is meant purely for optimization purposes, filters can
choose to omit implementing it, but `GtkFilterListModel` uses it.- Returns:
- the strictness of @self
-
match
Checks if the given @item is matched by the filter or not.- Parameters:
item
- The item to check- Returns:
- %TRUE if the filter matches the item and a filter model should keep it, %FALSE if not.
-
onChanged
Connect to signal "changed".
SeeFilter.OnChanged.onChanged(int)
for signal description.
FieldSIGNAL_ON_CHANGED
contains original signal name and can be used as resource reference.- Parameters:
signal
- callback function (lambda).- Returns:
SignalHandler
. Can be used to disconnect signal and to release callback function.
-
getTypeID
public static long getTypeID() -
getParentTypeID
public static long getParentTypeID() -
getTypeSize
-
getParentTypeSize
-
getInstanceSize
public static int getInstanceSize()
-