Package ch.bailu.gtk.gtk
Class TreeSortable
java.lang.Object
ch.bailu.gtk.type.Type
ch.bailu.gtk.type.Pointer
ch.bailu.gtk.gobject.Object
ch.bailu.gtk.type.Interface
ch.bailu.gtk.gtk.TreeSortable
- All Implemented Interfaces:
PointerInterface
The interface for sortable models used by GtkTreeView
`GtkTreeSortable` is an interface to be implemented by tree models which
support sorting. The `GtkTreeView` uses the methods provided by this interface
to sort the model.
`GtkTreeSortable` is an interface to be implemented by tree models which
support sorting. The `GtkTreeView` uses the methods provided by this interface
to sort the model.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
static interface
static interface
Nested classes/interfaces inherited from class ch.bailu.gtk.gobject.Object
Object.OnBindingTransformFunc, 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 TypeMethodDescriptionstatic ClassHandler
static int
static long
static TypeSystem.TypeSize
boolean
getSortColumnId
(Int sort_column_id, Int order) Fills in @sort_column_id and @order with the current sort column and the
order.static long
static TypeSystem.TypeSize
boolean
Returns %TRUE if the model has a default sort function.Connect to signal "sort-column-changed".void
setDefaultSortFunc
(TreeSortable.OnTreeIterCompareFunc sort_func, Pointer user_data, TreeSortable.OnDestroyNotify destroy) Sets the default comparison function used when sorting to be @sort_func.void
setSortColumnId
(int sort_column_id, int order) Sets the current sort column to be @sort_column_id.void
setSortFunc
(int sort_column_id, TreeSortable.OnTreeIterCompareFunc sort_func, Pointer user_data, TreeSortable.OnDestroyNotify destroy) Sets the comparison function used when sorting to be @sort_func.void
Emits a `GtkTreeSortable::sort-column-changed` signal on @sortable.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_SORT_COLUMN_CHANGED
- See Also:
-
-
Constructor Details
-
TreeSortable
-
-
Method Details
-
getClassHandler
-
getSortColumnId
Fills in @sort_column_id and @order with the current sort column and the
order. It returns %TRUE unless the @sort_column_id is
%GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID or
%GTK_TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID.- Parameters:
sort_column_id
- The sort column id to be filled inorder
- The `GtkSortType` to be filled in- Returns:
- %TRUE if the sort column is not one of the special sort column ids.
-
hasDefaultSortFunc
public boolean hasDefaultSortFunc()Returns %TRUE if the model has a default sort function. This is used
primarily by GtkTreeViewColumns in order to determine if a model can
go back to the default state, or not.- Returns:
- %TRUE, if the model has a default sort function
-
setDefaultSortFunc
public void setDefaultSortFunc(TreeSortable.OnTreeIterCompareFunc sort_func, @Nullable Pointer user_data, TreeSortable.OnDestroyNotify destroy) Sets the default comparison function used when sorting to be @sort_func.
If the current sort column id of @sortable is
%GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID, then the model will sort using
this function.
If @sort_func is %NULL, then there will be no default comparison function.
This means that once the model has been sorted, it can’t go back to the
default state. In this case, when the current sort column id of @sortable
is %GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID, the model will be unsorted.- Parameters:
sort_func
- The comparison functionuser_data
- User data to pass to @sort_funcdestroy
- Destroy notifier of @user_data
-
setSortColumnId
public void setSortColumnId(int sort_column_id, int order) Sets the current sort column to be @sort_column_id. The @sortable will
resort itself to reflect this change, after emitting a
`GtkTreeSortable::sort-column-changed` signal. @sort_column_id may either be
a regular column id, or one of the following special values:
- %GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID: the default sort function
will be used, if it is set
- %GTK_TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID: no sorting will occur- Parameters:
sort_column_id
- the sort column id to setorder
- The sort order of the column
-
setSortFunc
public void setSortFunc(int sort_column_id, TreeSortable.OnTreeIterCompareFunc sort_func, @Nullable Pointer user_data, TreeSortable.OnDestroyNotify destroy) Sets the comparison function used when sorting to be @sort_func. If the
current sort column id of @sortable is the same as @sort_column_id, then
the model will sort using this function.- Parameters:
sort_column_id
- the sort column id to set the function forsort_func
- The comparison functionuser_data
- User data to pass to @sort_funcdestroy
- Destroy notifier of @user_data
-
sortColumnChanged
public void sortColumnChanged()Emits a `GtkTreeSortable::sort-column-changed` signal on @sortable. -
onSortColumnChanged
Connect to signal "sort-column-changed".
SeeTreeSortable.OnSortColumnChanged.onSortColumnChanged()
for signal description.
FieldSIGNAL_ON_SORT_COLUMN_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()
-