Package ch.bailu.gtk.gtk
Class TreeListModel
java.lang.Object
ch.bailu.gtk.type.Type
ch.bailu.gtk.type.Pointer
ch.bailu.gtk.gobject.Object
ch.bailu.gtk.gtk.TreeListModel
- All Implemented Interfaces:
PointerInterface
`GtkTreeListModel` is a list model that can create child models on demand.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic 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
ConstructorDescriptionTreeListModel
(ListModel root, boolean passthrough, boolean autoexpand, TreeListModel.OnTreeListModelCreateModelFunc create_func, Pointer user_data, TreeListModel.OnDestroyNotify user_destroy) Creates a new empty `GtkTreeListModel` displaying @root
with all rows collapsed.TreeListModel
(PointerContainer pointer) -
Method Summary
Modifier and TypeMethodDescriptionImplements interfaceListModel
.boolean
Gets whether the model is set to automatically expand new rows
that get added.getChildRow
(int position) Gets the row item corresponding to the child at index @position for
@self's root model.static ClassHandler
static int
getModel()
Gets the root model that @self was created with.static long
static TypeSystem.TypeSize
boolean
Gets whether the model is passing through original row items.getRow
(int position) Gets the row object for the given row.static long
static TypeSystem.TypeSize
void
setAutoexpand
(boolean autoexpand) Sets whether the model should autoexpand.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
-
TreeListModel
-
TreeListModel
public TreeListModel(@Nonnull ListModel root, boolean passthrough, boolean autoexpand, TreeListModel.OnTreeListModelCreateModelFunc create_func, @Nullable Pointer user_data, TreeListModel.OnDestroyNotify user_destroy) Creates a new empty `GtkTreeListModel` displaying @root
with all rows collapsed.- Parameters:
root
- The `GListModel` to use as rootpassthrough
- %TRUE to pass through items from the modelsautoexpand
- %TRUE to set the autoexpand property and expand the @root modelcreate_func
- Function to call to create the `GListModel` for the children of an itemuser_data
- Data to pass to @create_funcuser_destroy
- Function to call to free @user_data
-
-
Method Details
-
getClassHandler
-
getAutoexpand
public boolean getAutoexpand()Gets whether the model is set to automatically expand new rows
that get added.
This can be either rows added by changes to the underlying
models or via [method@Gtk.TreeListRow.set_expanded].- Returns:
- %TRUE if the model is set to autoexpand
-
getChildRow
Gets the row item corresponding to the child at index @position for
@self's root model.
If @position is greater than the number of children in the root model,
%NULL is returned.
Do not confuse this function with [method@Gtk.TreeListModel.get_row].- Parameters:
position
- position of the child to get- Returns:
- the child in @position
-
getModel
Gets the root model that @self was created with.- Returns:
- the root model
-
getPassthrough
public boolean getPassthrough()Gets whether the model is passing through original row items.
If this function returns %FALSE, the `GListModel` functions for @self
return custom `GtkTreeListRow` objects. You need to call
[method@Gtk.TreeListRow.get_item] on these objects to get the original
item.
If %TRUE, the values of the child models are passed through in their
original state. You then need to call [method@Gtk.TreeListModel.get_row]
to get the custom `GtkTreeListRow`s.- Returns:
- %TRUE if the model is passing through original row items
-
getRow
Gets the row object for the given row.
If @position is greater than the number of items in @self,
%NULL is returned.
The row object can be used to expand and collapse rows as
well as to inspect its position in the tree. See its
documentation for details.
This row object is persistent and will refer to the current
item as long as the row is present in @self, independent of
other rows being added or removed.
If @self is set to not be passthrough, this function is
equivalent to calling g_list_model_get_item().
Do not confuse this function with [method@Gtk.TreeListModel.get_child_row].- Parameters:
position
- the position of the row to fetch- Returns:
- The row item
-
setAutoexpand
public void setAutoexpand(boolean autoexpand) Sets whether the model should autoexpand.
If set to %TRUE, the model will recursively expand all rows that
get added to the model. This can be either rows added by changes
to the underlying models or via [method@Gtk.TreeListRow.set_expanded].- Parameters:
autoexpand
- %TRUE to make the model autoexpand its rows
-
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()
-