Class ColumnViewSorter
- All Implemented Interfaces:
Proxy
ColumnView columns.
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, org.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);
}
- Since:
- 4.10
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classColumnViewSorter.Builder<B extends ColumnViewSorter.Builder<B>>Inner class implementing a builder pattern to construct a GObject with properties.static classNested classes/interfaces inherited from class org.gnome.gtk.Sorter
Sorter.ChangedCallback, Sorter.SorterClassNested classes/interfaces inherited from class org.gnome.gobject.GObject
GObject.NotifyCallback, GObject.ObjectClass -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new ColumnViewSorter.ColumnViewSorter(MemorySegment address) Create a ColumnViewSorter proxy instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionprotected ColumnViewSorterasParent()Returns this instance as if it were its parent type.static ColumnViewSorter.Builder<? extends ColumnViewSorter.Builder> builder()AColumnViewSorter.Builderobject constructs aColumnViewSorterwith the specified properties.intReturns the number of columns by which the sorter sorts.@Nullable ColumnViewColumngetNthSortColumn(int position, Out<SortType> sortOrder) Gets theposition'thsort column and its associated sort order.@Nullable ColumnViewColumnReturns the primary sort column.Returns the primary sort order.static @Nullable TypegetType()Get the GType of the ColumnViewSorter classMethods inherited from class org.gnome.gtk.Sorter
changed, compare, emitChanged, getMemoryLayout, getOrder, onChangedMethods 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, 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, withPropertiesMethods inherited from class org.gnome.gobject.TypeInstance
callParent, callParent, cast, getPrivate, readGClass, writeGClassMethods inherited from class org.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
-
ColumnViewSorter
public ColumnViewSorter()Creates a new ColumnViewSorter.
-
-
Method Details
-
getType
Get the GType of the ColumnViewSorter class- Returns:
- the GType
-
asParent
Returns this instance as if it were its parent type. This is mostly synonymous to the Javasuperkeyword, 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::changedsignal to get notified when the number of sort columns changes.- Returns:
- the number of sort columns
- Since:
- 4.10
-
getNthSortColumn
Gets theposition'thsort column and its associated sort order.Use the
Gtk.Sorter::changedsignal 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 sort column at the
position - Since:
- 4.10
-
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
- Since:
- 4.10
-
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
- Since:
- 4.10
-
builder
AColumnViewSorter.Builderobject constructs aColumnViewSorterwith the specified properties. Use the variousset...()methods to set properties, and finish construction withColumnViewSorter.Builder.build().- Returns:
- the builder object
-