Class ColumnViewSorter
- All Implemented Interfaces:
Proxy
GtkColumnViewSorter
is a sorter implementation that
is geared towards the needs of GtkColumnView
.
The sorter returned by ColumnView.getSorter()
is
a GtkColumnViewSorter
.
In column views, sorting can be configured by associating
sorters with columns, and users can invert sort order by clicking
on column headers. The API of GtkColumnViewSorter
is designed
to allow saving and restoring this configuration.
If you are only interested in the primary sort column (i.e. the
column where a sort indicator is shown in the header), then
you can just look at Gtk.ColumnViewSorter:primary-sort-column
and Gtk.ColumnViewSorter:primary-sort-order
.
If you want to store the full sort configuration, including
secondary sort columns that are used for tie breaking, then
you can use getNthSortColumn(int, io.github.jwharm.javagi.base.Out<org.gnome.gtk.SortType>)
.
To get notified about changes, use Gtk.Sorter::changed
.
To restore a saved sort configuration on a GtkColumnView
,
use code like:
sorter = gtk_column_view_get_sorter (view);
for (i = gtk_column_view_sorter_get_n_sort_columns (sorter) - 1; i >= 0; i--)
{
column = gtk_column_view_sorter_get_nth_sort_column (sorter, i, &order);
gtk_column_view_sort_by_column (view, column, order);
}
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
ColumnViewSorter.Builder<B extends ColumnViewSorter.Builder<B>>
Inner class implementing a builder pattern to construct a GObject with properties.static class
Nested classes/interfaces inherited from class org.gnome.gtk.Sorter
Sorter.ChangedCallback, Sorter.SorterClass
Nested classes/interfaces inherited from class org.gnome.gobject.GObject
GObject.NotifyCallback, GObject.ObjectClass
-
Constructor Summary
ConstructorDescriptionColumnViewSorter
(MemorySegment address) Create a ColumnViewSorter proxy instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionprotected ColumnViewSorter
asParent()
Returns this instance as if it were its parent type.static ColumnViewSorter.Builder
<? extends ColumnViewSorter.Builder> builder()
AColumnViewSorter.Builder
object constructs aColumnViewSorter
with the specified properties.int
Returns the number of columns by which the sorter sorts.getNthSortColumn
(int position, Out<SortType> sortOrder) Gets theposition
'th sort column and its associated sort order.Returns the primary sort column.Returns the primary sort order.static Type
getType()
Get the GType of the ColumnViewSorter classMethods inherited from class org.gnome.gtk.Sorter
changed, compare, emitChanged, getMemoryLayout, getOrder, onChanged
Methods inherited from class org.gnome.gobject.GObject
addToggleRef, addWeakPointer, bindProperty, bindProperty, bindProperty, bindPropertyFull, bindPropertyFull, bindPropertyWithClosures, bindPropertyWithClosures, compatControl, connect, connect, connect, constructed, disconnect, dispatchPropertiesChanged, dispose, dupData, dupQdata, emit, emitNotify, finalize_, forceFloating, freezeNotify, get, getData, getProperty, getProperty, getProperty, getQdata, getv, interfaceFindProperty, interfaceInstallProperty, interfaceListProperties, isFloating, newInstance, newInstance, newInstance, newInstance, newv, notify_, notify_, notifyByPspec, onNotify, ref, refSink, removeToggleRef, removeWeakPointer, replaceData, replaceQdata, runDispose, set, setData, setDataFull, setProperty, setProperty, setProperty, setQdata, setQdataFull, setv, stealData, stealQdata, takeRef, thawNotify, unref, watchClosure, weakRef, weakUnref, withProperties
Methods inherited from class org.gnome.gobject.TypeInstance
callParent, callParent, getPrivate, readGClass, writeGClass
Methods inherited from class io.github.jwharm.javagi.base.ProxyInstance
equals, handle, hashCode
-
Constructor Details
-
ColumnViewSorter
Create a ColumnViewSorter proxy instance for the provided memory address.- Parameters:
address
- the memory address of the native object
-
-
Method Details
-
getType
-
asParent
Returns this instance as if it were its parent type. This is mostly synonymous to the Javasuper
keyword, but will set the native typeclass function pointers to the parent type. When overriding a native virtual method in Java, "chaining up" withsuper.methodName()
doesn't work, because it invokes the overridden function pointer again. To chain up, callasParent().methodName()
. This will call the native function pointer of this virtual method in the typeclass of the parent type. -
getNSortColumns
public int getNSortColumns()Returns the number of columns by which the sorter sorts.If the sorter of the primary sort column does not determine a total order, then the secondary sorters are consulted to break the ties.
Use the
Gtk.Sorter::changed
signal to get notified when the number of sort columns changes.- Returns:
- the number of sort columns
-
getNthSortColumn
Gets theposition
'th sort column and its associated sort order.Use the
Gtk.Sorter::changed
signal to get notified when sort columns change.- Parameters:
position
- the position of the sort column to retrieve (0 for the primary sort column)sortOrder
- return location for the sort order- Returns:
- the
positions
sort column
-
getPrimarySortColumn
Returns the primary sort column.The primary sort column is the one that displays the triangle in a column view header.
- Returns:
- the primary sort column
-
getPrimarySortOrder
Returns the primary sort order.The primary sort order determines whether the triangle displayed in the column view header of the primary sort column points upwards or downwards.
If there is no primary sort column, then this function returns
GTK_SORT_ASCENDING
.- Returns:
- the primary sort order
-
builder
AColumnViewSorter.Builder
object constructs aColumnViewSorter
with the specified properties. Use the variousset...()
methods to set properties, and finish construction withColumnViewSorter.Builder.build()
.
-