Package ch.bailu.gtk.gtk
Class SliceListModel
java.lang.Object
ch.bailu.gtk.type.Type
ch.bailu.gtk.type.Pointer
ch.bailu.gtk.gobject.Object
ch.bailu.gtk.gtk.SliceListModel
- All Implemented Interfaces:
PointerInterface
`GtkSliceListModel` is a list model that presents a slice of another model.
This is useful when implementing paging by setting the size to the number
of elements per page and updating the offset whenever a different page is
opened.
This is useful when implementing paging by setting the size to the number
of elements per page and updating the offset whenever a different page is
opened.
-
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
ConstructorDescriptionSliceListModel
(ListModel model, int offset, int size) Creates a new slice model.SliceListModel
(PointerContainer pointer) -
Method Summary
Modifier and TypeMethodDescriptionImplements interfaceListModel
.static ClassHandler
static int
getModel()
Gets the model that is currently being used or %NULL if none.int
Gets the offset set via gtk_slice_list_model_set_offset().static long
static TypeSystem.TypeSize
int
getSize()
Gets the size set via gtk_slice_list_model_set_size().static long
static TypeSystem.TypeSize
void
Sets the model to show a slice of.void
setOffset
(int offset) Sets the offset into the original model for this slice.void
setSize
(int size) Sets the maximum size.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
-
Constructor Details
-
SliceListModel
-
SliceListModel
Creates a new slice model.
It presents the slice from @offset to offset + @size
of the given @model.- Parameters:
model
- The model to useoffset
- the offset of the slicesize
- maximum size of the slice
-
-
Method Details
-
getClassHandler
-
getModel
Gets the model that is currently being used or %NULL if none.- Returns:
- The model in use
-
getOffset
public int getOffset()Gets the offset set via gtk_slice_list_model_set_offset().- Returns:
- The offset
-
getSize
public int getSize()Gets the size set via gtk_slice_list_model_set_size().- Returns:
- The size
-
setModel
Sets the model to show a slice of.
The model's item type must conform to @self's item type.- Parameters:
model
- The model to be sliced
-
setOffset
public void setOffset(int offset) Sets the offset into the original model for this slice.
If the offset is too large for the sliced model,
@self will end up empty.- Parameters:
offset
- the new offset to use
-
setSize
public void setSize(int size) Sets the maximum size. @self will never have more items
than @size.
It can however have fewer items if the offset is too large
or the model sliced from doesn't have enough items.- Parameters:
size
- the maximum size
-
asListModel
Implements interfaceListModel
. Call this to get access to interface functions.- Returns:
ListModel
-
getTypeID
public static long getTypeID() -
getParentTypeID
public static long getParentTypeID() -
getTypeSize
-
getParentTypeSize
-
getInstanceSize
public static int getInstanceSize()
-