Class TreeListRow
- All Implemented Interfaces:
Proxy
GtkTreeListModel.
It allows navigating the model as a tree and modify the state of rows.
GtkTreeListRow instances are created by a GtkTreeListModel only
when the Gtk.TreeListModel:passthrough property is not set.
There are various support objects that can make use of GtkTreeListRow
objects, such as the TreeExpander widget that allows displaying
an icon to expand or collapse a row or TreeListRowSorter that
makes it possible to sort trees properly.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classTreeListRow.Builder<B extends TreeListRow.Builder<B>>Inner class implementing a builder pattern to construct a GObject with properties.static classNested classes/interfaces inherited from class org.gnome.gobject.GObject
GObject.NotifyCallback, GObject.ObjectClass -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new TreeListRow.TreeListRow(MemorySegment address) Create a TreeListRow proxy instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionprotected TreeListRowasParent()Returns this instance as if it were its parent type.static TreeListRow.Builder<? extends TreeListRow.Builder> builder()ATreeListRow.Builderobject constructs aTreeListRowwith the specified properties.@Nullable ListModelIf the row is expanded, gets the model holding the children ofself.@Nullable TreeListRowgetChildRow(int position) If this TreeListRow is not expanded orpositionis greater than the number of children,nullis returned.intgetDepth()Gets the depth of this row.booleanGets if a row is currently expanded.@Nullable GObjectgetItem()Gets the item corresponding to this row,@Nullable TreeListRowGets the row representing the parent forself.intReturns the position in theGtkTreeListModelthat this TreeListRow occupies at the moment.static @Nullable TypegetType()Get the GType of the TreeListRow classbooleanChecks if a row can be expanded.voidsetExpanded(boolean expanded) Expands or collapses a row.Methods 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, getMemoryLayout, 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
-
TreeListRow
Create a TreeListRow proxy instance for the provided memory address.- Parameters:
address- the memory address of the native object
-
TreeListRow
public TreeListRow()Creates a new TreeListRow.
-
-
Method Details
-
getType
-
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. -
getChildRow
If this TreeListRow is not expanded orpositionis greater than the number of children,nullis 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 ofself.This model is the model created by the
Gtk.TreeListModelCreateModelFuncand contains the original items, no matter what valueGtk.TreeListModel:passthroughis 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 removed from its model at which point it will forever return 0.
- Returns:
- The depth of this row
-
getExpanded
public boolean getExpanded()Gets if a row is currently expanded.- Returns:
trueif the row is expanded
-
getItem
Gets the item corresponding to this row,- Returns:
- The item of this row. This function is only marked as nullable for backwards compatibility reasons.
-
getParent
Gets the row representing the parent forself.That is the row that would need to be collapsed to make this row disappear.
If this TreeListRow is a row corresponding to the root model,
nullis returned.The value returned by this function never changes until the row is removed from its model at which point it will forever return
null.- Returns:
- The parent of this TreeListRow
-
getPosition
public int getPosition()Returns the position in theGtkTreeListModelthat this TreeListRow 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
getExpanded().If a row is expandable never changes until the row is removed from its model at which point it will forever return
false.- Returns:
trueif 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
Gtk.TreeListModelCreateModelFuncfor 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-trueif the row should be expanded
-
builder
ATreeListRow.Builderobject constructs aTreeListRowwith the specified properties. Use the variousset...()methods to set properties, and finish construction withTreeListRow.Builder.build().- Returns:
- the builder object
-