Package ch.bailu.gtk.gtk
Class TreeListRow
java.lang.Object
ch.bailu.gtk.type.Type
ch.bailu.gtk.type.Pointer
ch.bailu.gtk.gobject.Object
ch.bailu.gtk.gtk.TreeListRow
- All Implemented Interfaces:
PointerInterface
`GtkTreeListRow` is used by `GtkTreeListModel` to represent items.
It allows navigating the model as a tree and modify the state of rows.
`GtkTreeListRow` instances are created by a `GtkTreeListModel` only
when the [property@Gtk.TreeListModel:passthrough] property is not set.
There are various support objects that can make use of `GtkTreeListRow`
objects, such as the [class@Gtk.TreeExpander] widget that allows displaying
an icon to expand or collapse a row or [class@Gtk.TreeListRowSorter] that
makes it possible to sort trees properly.
It allows navigating the model as a tree and modify the state of rows.
`GtkTreeListRow` instances are created by a `GtkTreeListModel` only
when the [property@Gtk.TreeListModel:passthrough] property is not set.
There are various support objects that can make use of `GtkTreeListRow`
objects, such as the [class@Gtk.TreeExpander] widget that allows displaying
an icon to expand or collapse a row or [class@Gtk.TreeListRowSorter] that
makes it possible to sort trees properly.
-
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
-
Method Summary
Modifier and TypeMethodDescriptionIf the row is expanded, gets the model holding the children of @self.getChildRow
(int position) If @self is not expanded or @position is greater than the
number of children, %NULL is returned.static ClassHandler
int
getDepth()
Gets the depth of this row.boolean
Gets if a row is currently expanded.static int
getItem()
Gets the item corresponding to this row,
The value returned by this function never changes until the
row is destroyed.Gets the row representing the parent for @self.static long
static TypeSystem.TypeSize
int
Returns the position in the `GtkTreeListModel` that @self occupies
at the moment.static long
static TypeSystem.TypeSize
boolean
Checks if a row can be expanded.void
setExpanded
(boolean expanded) Expands or collapses a row.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
-
TreeListRow
-
-
Method Details
-
getClassHandler
-
getChildRow
If @self is not expanded or @position is greater than the
number of children, %NULL is returned.- Parameters:
position
- position of the child to get- Returns:
- the child in @position
-
getChildren
If the row is expanded, gets the model holding the children of @self.
This model is the model created by the
[callback@Gtk.TreeListModelCreateModelFunc]
and contains the original items, no matter what value
[property@Gtk.TreeListModel:passthrough] is set to.- Returns:
- The model containing the children
-
getDepth
public int getDepth()Gets the depth of this row.
Rows that correspond to items in the root model have a depth
of zero, rows corresponding to items of models of direct children
of the root model have a depth of 1 and so on.
The depth of a row never changes until the row is destroyed.- Returns:
- The depth of this row
-
getExpanded
public boolean getExpanded()Gets if a row is currently expanded.- Returns:
- %TRUE if the row is expanded
-
getItem
Gets the item corresponding to this row,
The value returned by this function never changes until the
row is destroyed.- Returns:
- The item of this row or %NULL when the row was destroyed
-
getParent
Gets the row representing the parent for @self.
That is the row that would need to be collapsed
to make this row disappear.
If @self is a row corresponding to the root model,
%NULL is returned.
The value returned by this function never changes
until the row is destroyed.- Returns:
- The parent of @self
-
getPosition
public int getPosition()Returns the position in the `GtkTreeListModel` that @self occupies
at the moment.- Returns:
- The position in the model
-
isExpandable
public boolean isExpandable()Checks if a row can be expanded.
This does not mean that the row is actually expanded,
this can be checked with [method@Gtk.TreeListRow.get_expanded].
If a row is expandable never changes until the row is destroyed.- Returns:
- %TRUE if the row is expandable
-
setExpanded
public void setExpanded(boolean expanded) Expands or collapses a row.
If a row is expanded, the model of calling the
[callback@Gtk.TreeListModelCreateModelFunc] for the row's
item will be inserted after this row. If a row is collapsed,
those items will be removed from the model.
If the row is not expandable, this function does nothing.- Parameters:
expanded
- %TRUE if the row should be expanded
-
getTypeID
public static long getTypeID() -
getParentTypeID
public static long getParentTypeID() -
getTypeSize
-
getParentTypeSize
-
getInstanceSize
public static int getInstanceSize()
-