Package ch.bailu.gtk.gtk
Klasse SortListModel
java.lang.Object
ch.bailu.gtk.type.Type
ch.bailu.gtk.type.Pointer
ch.bailu.gtk.gobject.Object
ch.bailu.gtk.type.PropertyHolder
ch.bailu.gtk.gtk.SortListModel
- Alle implementierten Schnittstellen:
PointerInterface
A list model that sorts the elements of another model.
The elements are sorted according to a `GtkSorter`.
The model is a stable sort. If two items compare equal according
to the sorter, the one that appears first in the original model will
also appear first after sorting.
Note that if you change the sorter, the previous order will have no
influence on the new order. If you want that, consider using a
`GtkMultiSorter` and appending the previous sorter to it.
The model can be set up to do incremental sorting, so that
sorting long lists doesn't block the UI. See
[method@Gtk.SortListModel.set_incremental] for details.
`GtkSortListModel` is a generic model and because of that it
cannot take advantage of any external knowledge when sorting.
If you run into performance issues with `GtkSortListModel`,
it is strongly recommended that you write your own sorting list
model.
`GtkSortListModel` allows sorting the items into sections. It
implements `GtkSectionModel` and when [property@Gtk.SortListModel:section-sorter]
is set, it will sort all items with that sorter and items comparing
equal with it will be put into the same section.
The [property@Gtk.SortListModel:sorter] will then be used to sort items
inside their sections.
The elements are sorted according to a `GtkSorter`.
The model is a stable sort. If two items compare equal according
to the sorter, the one that appears first in the original model will
also appear first after sorting.
Note that if you change the sorter, the previous order will have no
influence on the new order. If you want that, consider using a
`GtkMultiSorter` and appending the previous sorter to it.
The model can be set up to do incremental sorting, so that
sorting long lists doesn't block the UI. See
[method@Gtk.SortListModel.set_incremental] for details.
`GtkSortListModel` is a generic model and because of that it
cannot take advantage of any external knowledge when sorting.
If you run into performance issues with `GtkSortListModel`,
it is strongly recommended that you write your own sorting list
model.
`GtkSortListModel` allows sorting the items into sections. It
implements `GtkSectionModel` and when [property@Gtk.SortListModel:section-sorter]
is set, it will sort all items with that sorter and items comparing
equal with it will be put into the same section.
The [property@Gtk.SortListModel:sorter] will then be used to sort items
inside their sections.
-
Verschachtelte Klassen - Übersicht
Von Klasse geerbte verschachtelte Klassen/Schnittstellen ch.bailu.gtk.gobject.Object
Object.OnBindingTransformFunc, Object.OnDestroyNotify, Object.OnDuplicateFunc, Object.OnNotify, Object.OnToggleNotify, Object.OnWeakNotify
-
Feldübersicht
Von Klasse geerbte Felder ch.bailu.gtk.gobject.Object
SIGNAL_ON_NOTIFY
-
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungSortListModel
(ListModel model, Sorter sorter) Creates a new sort list model that uses the @sorter to sort @model.SortListModel
(PointerContainer pointer) -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungImplements interfaceListModel
.Implements interfaceSectionModel
.static ClassHandler
boolean
Returns whether incremental sorting is enabled.static int
getModel()
Gets the model currently sorted or %NULL if none.static long
static TypeSystem.TypeSize
int
Estimates progress of an ongoing sorting operation.Gets the section sorter that is used to sort items of @self into
sections.Gets the sorter that is used to sort @self.static long
static TypeSystem.TypeSize
void
setIncremental
(boolean incremental) Sets the sort model to do an incremental sort.void
Sets the model to be sorted.void
setSectionSorter
(Sorter sorter) Sets a new section sorter on @self.void
Sets a new sorter on @self.Von Klasse geerbte Methoden ch.bailu.gtk.type.PropertyHolder
getBooleanProperty, getIntProperty, getObjectProperty, getStringProperty, getStrProperty, setBooleanProperty, setIntProperty, setObjectProperty, setStringProperty, setStrProperty
Von Klasse geerbte Methoden 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
Von Klasse geerbte Methoden ch.bailu.gtk.type.Pointer
asCPointer, cast, connectSignal, disconnectSignals, disconnectSignals, equals, hashCode, throwIfNull, throwNullPointerException, toString, unregisterCallbacks, unregisterCallbacks
Von Klasse geerbte Methoden ch.bailu.gtk.type.Type
asCPointer, asCPointer, asCPointerNotNull, asJnaPointer, asJnaPointer, asPointer, asPointer, cast, cast, throwIfNull
Von Klasse geerbte Methoden java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Von Schnittstelle geerbte Methoden ch.bailu.gtk.type.PointerInterface
asCPointerNotNull, asJnaPointer, asPointer, isNotNull, isNull
-
Konstruktordetails
-
SortListModel
-
SortListModel
Creates a new sort list model that uses the @sorter to sort @model.- Parameter:
model
- the model to sortsorter
- the `GtkSorter` to sort @model with,
-
-
Methodendetails
-
getClassHandler
-
getIncremental
public boolean getIncremental()Returns whether incremental sorting is enabled.
See [method@Gtk.SortListModel.set_incremental].- Gibt zurück:
- %TRUE if incremental sorting is enabled
-
getModel
Gets the model currently sorted or %NULL if none.- Gibt zurück:
- The model that gets sorted
-
getPending
public int getPending()Estimates progress of an ongoing sorting operation.
The estimate is the number of items that would still need to be
sorted to finish the sorting operation if this was a linear
algorithm. So this number is not related to how many items are
already correctly sorted.
If you want to estimate the progress, you can use code like this:
```c
pending = gtk_sort_list_model_get_pending (self);
model = gtk_sort_list_model_get_model (self);
progress = 1.0 - pending / (double) MAX (1, g_list_model_get_n_items (model));
```
If no sort operation is ongoing - in particular when
[property@Gtk.SortListModel:incremental] is %FALSE - this
function returns 0.- Gibt zurück:
- a progress estimate of remaining items to sort
-
getSectionSorter
Gets the section sorter that is used to sort items of @self into
sections.- Gibt zurück:
- the sorter of #self
-
getSorter
Gets the sorter that is used to sort @self.- Gibt zurück:
- the sorter of #self
-
setIncremental
public void setIncremental(boolean incremental) Sets the sort model to do an incremental sort.
When incremental sorting is enabled, the `GtkSortListModel` will not do
a complete sort immediately, but will instead queue an idle handler that
incrementally sorts the items towards their correct position. This of
course means that items do not instantly appear in the right place. It
also means that the total sorting time is a lot slower.
When your filter blocks the UI while sorting, you might consider
turning this on. Depending on your model and sorters, this may become
interesting around 10,000 to 100,000 items.
By default, incremental sorting is disabled.
See [method@Gtk.SortListModel.get_pending] for progress information
about an ongoing incremental sorting operation.- Parameter:
incremental
- %TRUE to sort incrementally
-
setModel
Sets the model to be sorted.
The @model's item type must conform to the item type of @self.- Parameter:
model
- The model to be sorted
-
setSectionSorter
Sets a new section sorter on @self.- Parameter:
sorter
- the `GtkSorter` to sort @model with
-
setSorter
Sets a new sorter on @self.- Parameter:
sorter
- the `GtkSorter` to sort @model with
-
asListModel
Implements interfaceListModel
. Call this to get access to interface functions.- Gibt zurück:
ListModel
-
asSectionModel
Implements interfaceSectionModel
. Call this to get access to interface functions.- Gibt zurück:
SectionModel
-
getTypeID
public static long getTypeID() -
getParentTypeID
public static long getParentTypeID() -
getTypeSize
-
getParentTypeSize
-
getInstanceSize
public static int getInstanceSize()
-