Class TreeViewColumn
- All Implemented Interfaces:
Buildable,CellLayout,Proxy
TreeView widget
The GtkTreeViewColumn object represents a visible column in a GtkTreeView widget.
It allows to set properties of the column header, and functions as a holding pen
for the cell renderers which determine how the data in the column is displayed.
Please refer to the tree widget conceptual overview
for an overview of all the objects and data types related to the tree widget and
how they work together, and to the TreeView documentation for specifics
about the CSS node structure for treeviews and their headers.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classTreeViewColumn.Builder<B extends TreeViewColumn.Builder<B>>Deprecated.Inner class implementing a builder pattern to construct a GObject with properties.static interfaceDeprecated.Functional interface declaration of theClickedCallbackcallback.Nested classes/interfaces inherited from class org.gnome.gobject.InitiallyUnowned
InitiallyUnowned.InitiallyUnownedClassNested classes/interfaces inherited from class org.gnome.gobject.GObject
GObject.NotifyCallback, GObject.ObjectClassNested classes/interfaces inherited from interface org.gnome.gtk.Buildable
Buildable.Buildable$Impl, Buildable.BuildableIfaceNested classes/interfaces inherited from interface org.gnome.gtk.CellLayout
CellLayout.CellLayout$Impl, CellLayout.CellLayoutIface -
Constructor Summary
ConstructorsConstructorDescriptionDeprecated.Creates a new TreeViewColumn.TreeViewColumn(MemorySegment address) Deprecated.Create a TreeViewColumn proxy instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAttribute(CellRenderer cellRenderer, String attribute, int column) Deprecated.Use GtkColumnView insteadprotected TreeViewColumnasParent()Deprecated.Returns this instance as if it were its parent type.static TreeViewColumn.Builder<? extends TreeViewColumn.Builder> builder()Deprecated.ATreeViewColumn.Builderobject constructs aTreeViewColumnwith the specified properties.booleancellGetPosition(CellRenderer cellRenderer, @Nullable Out<Integer> xOffset, @Nullable Out<Integer> width) Deprecated.Use GtkColumnView insteadvoidcellGetSize(@Nullable Out<Integer> xOffset, @Nullable Out<Integer> yOffset, @Nullable Out<Integer> width, @Nullable Out<Integer> height) Deprecated.Use GtkColumnView insteadbooleanDeprecated.Use GtkColumnView insteadvoidcellSetCellData(TreeModel treeModel, TreeIter iter, boolean isExpander, boolean isExpanded) Deprecated.Use GtkColumnView insteadvoidclear()Deprecated.Use GtkColumnView insteadvoidclearAttributes(CellRenderer cellRenderer) Deprecated.Use GtkColumnView insteadvoidclicked()Deprecated.Use GtkColumnView insteadvoidDeprecated.Emits the "clicked" signal.voidfocusCell(CellRenderer cell) Deprecated.Use GtkColumnView insteadfloatDeprecated.Use GtkColumnView insteadDeprecated.Use GtkColumnView insteadbooleanDeprecated.Use GtkColumnView insteadbooleanDeprecated.Use GtkColumnView insteadintDeprecated.Use GtkColumnView insteadintDeprecated.Use GtkColumnView insteadintDeprecated.Use GtkColumnView insteadbooleanDeprecated.Use GtkColumnView insteadbooleanDeprecated.Use GtkColumnView insteadDeprecated.Use GtkColumnView insteadintDeprecated.Use GtkColumnView insteadbooleanDeprecated.Use GtkColumnView insteadDeprecated.Use GtkColumnView insteadintDeprecated.Use GtkColumnView insteadgetTitle()Deprecated.Use GtkColumnView instead@Nullable WidgetDeprecated.Use GtkColumnView insteadstatic @Nullable TypegetType()Deprecated.Get the GType of the TreeViewColumn classbooleanDeprecated.Use GtkColumnView instead@Nullable WidgetDeprecated.Use GtkColumnView insteadintgetWidth()Deprecated.Use GtkColumnView insteadintDeprecated.Use GtkColumnView insteadonClicked(TreeViewColumn.ClickedCallback handler) Deprecated.Emitted when the column's header has been clicked.voidpackEnd(CellRenderer cell, boolean expand) Deprecated.Use GtkColumnView insteadvoidpackStart(CellRenderer cell, boolean expand) Deprecated.Use GtkColumnView insteadvoidDeprecated.Use GtkColumnView insteadvoidsetAlignment(float xalign) Deprecated.Use GtkColumnView insteadvoidsetAttributes(CellRenderer cellRenderer, Object... varargs) Deprecated.Use GtkColumnView insteadvoidsetCellDataFunc(CellRenderer cellRenderer, @Nullable TreeCellDataFunc func) Deprecated.Use GtkColumnView insteadvoidsetClickable(boolean clickable) Deprecated.Use GtkColumnView insteadvoidsetExpand(boolean expand) Deprecated.Use GtkColumnView insteadvoidsetFixedWidth(int fixedWidth) Deprecated.Use GtkColumnView insteadvoidsetMaxWidth(int maxWidth) Deprecated.Use GtkColumnView insteadvoidsetMinWidth(int minWidth) Deprecated.Use GtkColumnView insteadvoidsetReorderable(boolean reorderable) Deprecated.Use GtkColumnView insteadvoidsetResizable(boolean resizable) Deprecated.Use GtkColumnView insteadvoidDeprecated.Use GtkColumnView insteadvoidsetSortColumnId(int sortColumnId) Deprecated.Use GtkColumnView insteadvoidsetSortIndicator(boolean setting) Deprecated.Use GtkColumnView insteadvoidsetSortOrder(SortType order) Deprecated.Use GtkColumnView insteadvoidsetSpacing(int spacing) Deprecated.Use GtkColumnView insteadvoidDeprecated.Use GtkColumnView insteadvoidsetVisible(boolean visible) Deprecated.Use GtkColumnView insteadvoidDeprecated.Use GtkColumnView insteadstatic TreeViewColumnDeprecated.Use GtkColumnView insteadstatic TreeViewColumnwithAttributes(String title, CellRenderer cell, Object... varargs) Deprecated.Use GtkColumnView insteadMethods inherited from class org.gnome.gobject.InitiallyUnowned
getMemoryLayoutMethods 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, 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, hashCodeMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.gnome.gtk.Buildable
getBuildableIdMethods inherited from interface org.gnome.gtk.CellLayout
getArea, getCells, reorder, setCellDataFunc
-
Constructor Details
-
TreeViewColumn
Deprecated.Create a TreeViewColumn proxy instance for the provided memory address.- Parameters:
address- the memory address of the native object
-
TreeViewColumn
public TreeViewColumn()Deprecated.Creates a new TreeViewColumn.
-
-
Method Details
-
getType
Deprecated.Get the GType of the TreeViewColumn class- Returns:
- the GType
-
asParent
Deprecated.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.- Overrides:
asParentin classInitiallyUnowned
-
withArea
Deprecated.Use GtkColumnView insteadCreates a newGtkTreeViewColumnusingareato render its cells.- Parameters:
area- theGtkCellAreathat the newly created column should use to layout cells.- Returns:
- A newly created
GtkTreeViewColumn.
-
withAttributes
@Deprecated public static TreeViewColumn withAttributes(String title, CellRenderer cell, Object... varargs) Deprecated.Use GtkColumnView insteadCreates a newGtkTreeViewColumnwith a number of default values. This is equivalent to calling gtk_tree_view_column_set_title(), gtk_tree_view_column_pack_start(), and gtk_tree_view_column_set_attributes() on the newly createdGtkTreeViewColumn.Here’s a simple example:
enum { TEXT_COLUMN, COLOR_COLUMN, N_COLUMNS }; // ... { GtkTreeViewColumn *column; GtkCellRenderer *renderer = gtk_cell_renderer_text_new (); column = gtk_tree_view_column_new_with_attributes ("Title", renderer, "text", TEXT_COLUMN, "foreground", COLOR_COLUMN, NULL); }- Parameters:
title- The title to set the header tocell- TheGtkCellRenderervarargs- Anull-terminated list of attributes- Returns:
- A newly created
GtkTreeViewColumn.
-
addAttribute
Deprecated.Use GtkColumnView insteadAdds an attribute mapping to the list intreeColumn.The
columnis the column of the model to get a value from, and theattributeis the parameter oncellRendererto be set from the value. So for example if column 2 of the model contains strings, you could have the “text” attribute of aGtkCellRendererTextget its values from column 2.- Specified by:
addAttributein interfaceCellLayout- Parameters:
cellRenderer- theGtkCellRendererto set attributes onattribute- An attribute on the renderercolumn- The column position on the model to get the attribute from.
-
cellGetPosition
@Deprecated public boolean cellGetPosition(CellRenderer cellRenderer, @Nullable Out<Integer> xOffset, @Nullable Out<Integer> width) Deprecated.Use GtkColumnView insteadObtains the horizontal position and size of a cell in a column.If the cell is not found in the column,
startPosandwidthare not changed andfalseis returned.- Parameters:
cellRenderer- aGtkCellRendererxOffset- return location for the horizontal position ofcellwithin this TreeViewColumnwidth- return location for the width ofcell- Returns:
trueifcellbelongs to this TreeViewColumn
-
cellGetSize
@Deprecated public void cellGetSize(@Nullable Out<Integer> xOffset, @Nullable Out<Integer> yOffset, @Nullable Out<Integer> width, @Nullable Out<Integer> height) Deprecated.Use GtkColumnView insteadObtains the width and height needed to render the column. This is used primarily by theGtkTreeView.- Parameters:
xOffset- location to return x offset of a cell relative tocellAreayOffset- location to return y offset of a cell relative tocellAreawidth- location to return width needed to render a cellheight- location to return height needed to render a cell
-
cellIsVisible
Deprecated.Use GtkColumnView insteadReturnstrueif any of the cells packed into the this TreeViewColumn are visible. For this to be meaningful, you must first initialize the cells with gtk_tree_view_column_cell_set_cell_data()- Returns:
true, if any of the cells packed into the this TreeViewColumn are currently visible
-
cellSetCellData
@Deprecated public void cellSetCellData(TreeModel treeModel, TreeIter iter, boolean isExpander, boolean isExpanded) Deprecated.Use GtkColumnView insteadSets the cell renderer based on thetreeModelanditer.That is, for every attribute mapping intreeColumn,it will get a value from the set column on theiter,and use that value to set the attribute on the cell renderer. This is used primarily by theGtkTreeView.- Parameters:
treeModel- TheGtkTreeModelto get the cell renderers attributes from.iter- TheGtkTreeIterto get the cell renderer’s attributes from.isExpander-true, if the row has childrenisExpanded-true, if the row has visible children
-
clear
Deprecated.Use GtkColumnView insteadUnsets all the mappings on all renderers on thetreeColumn.- Specified by:
clearin interfaceCellLayout
-
clearAttributes
Deprecated.Use GtkColumnView insteadClears all existing attributes previously set with gtk_tree_view_column_set_attributes().- Specified by:
clearAttributesin interfaceCellLayout- Parameters:
cellRenderer- aGtkCellRendererto clear the attribute mapping on.
-
clicked
Deprecated.Use GtkColumnView insteadEmits the “clicked” signal on the column. This function will only work if this TreeViewColumn is clickable. -
focusCell
Deprecated.Use GtkColumnView insteadSets the current keyboard focus to be atcell,if the column contains 2 or more editable and activatable cells.- Parameters:
cell- AGtkCellRenderer
-
getAlignment
Deprecated.Use GtkColumnView insteadReturns the current x alignment oftreeColumn.This value can range between 0.0 and 1.0.- Returns:
- The current alignent of
treeColumn.
-
getButton
Deprecated.Use GtkColumnView insteadReturns the button used in the treeview column header- Returns:
- The button for the column header.
-
getClickable
Deprecated.Use GtkColumnView insteadReturnstrueif the user can click on the header for the column.- Returns:
trueif user can click the column header.
-
getExpand
Deprecated.Use GtkColumnView insteadReturnstrueif the column expands to fill available space.- Returns:
trueif the column expands to fill available space.
-
getFixedWidth
Deprecated.Use GtkColumnView insteadGets the fixed width of the column. This may not be the actual displayed width of the column; for that, use gtk_tree_view_column_get_width().- Returns:
- The fixed width of the column.
-
getMaxWidth
Deprecated.Use GtkColumnView insteadReturns the maximum width in pixels of thetreeColumn,or -1 if no maximum width is set.- Returns:
- The maximum width of the
treeColumn.
-
getMinWidth
Deprecated.Use GtkColumnView insteadReturns the minimum width in pixels of thetreeColumn,or -1 if no minimum width is set.- Returns:
- The minimum width of the
treeColumn.
-
getReorderable
Deprecated.Use GtkColumnView insteadReturnstrueif the this TreeViewColumn can be reordered by the user.- Returns:
trueif the this TreeViewColumn can be reordered by the user.
-
getResizable
Deprecated.Use GtkColumnView insteadReturnstrueif the this TreeViewColumn can be resized by the end user.- Returns:
true, if the this TreeViewColumn can be resized.
-
getSizing
Deprecated.Use GtkColumnView insteadReturns the current type oftreeColumn.- Returns:
- The type of
treeColumn.
-
getSortColumnId
Deprecated.Use GtkColumnView insteadGets the logicalsortColumnIdthat the model sorts on when this column is selected for sorting.See
setSortColumnId(int).- Returns:
- the current
sortColumnIdfor this column, or -1 if this column can’t be used for sorting
-
getSortIndicator
Deprecated.Use GtkColumnView insteadGets the value set by gtk_tree_view_column_set_sort_indicator().- Returns:
- whether the sort indicator arrow is displayed
-
getSortOrder
Deprecated.Use GtkColumnView insteadGets the value set by gtk_tree_view_column_set_sort_order().- Returns:
- the sort order the sort indicator is indicating
-
getSpacing
Deprecated.Use GtkColumnView insteadReturns the spacing oftreeColumn.- Returns:
- the spacing of
treeColumn.
-
getTitle
Deprecated.Use GtkColumnView insteadReturns the title of the widget.- Returns:
- the title of the column. This string should not be modified or freed.
-
getTreeView
Deprecated.Use GtkColumnView insteadReturns theGtkTreeViewwherein this TreeViewColumn has been inserted. Ifcolumnis currently not inserted in any tree view,nullis returned.- Returns:
- The tree view wherein
columnhas been inserted
-
getVisible
Deprecated.Use GtkColumnView insteadReturnstrueif this TreeViewColumn is visible.- Returns:
- whether the column is visible or not. If it is visible, then the tree will show the column.
-
getWidget
Deprecated.Use GtkColumnView insteadReturns theGtkWidgetin the button on the column header.If a custom widget has not been set then
nullis returned.- Returns:
- The
GtkWidgetin the column header
-
getWidth
Deprecated.Use GtkColumnView insteadReturns the current size of this TreeViewColumn in pixels.- Returns:
- The current width of
treeColumn.
-
getXOffset
Deprecated.Use GtkColumnView insteadReturns the current X offset of this TreeViewColumn in pixels.- Returns:
- The current X offset of
treeColumn.
-
packEnd
Deprecated.Use GtkColumnView insteadAdds thecellto end of the column. Ifexpandisfalse, then thecellis allocated no more space than it needs. Any unused space is divided evenly between cells for whichexpandistrue.- Specified by:
packEndin interfaceCellLayout- Parameters:
cell- TheGtkCellRendererexpand-trueifcellis to be given extra space allocated totreeColumn.
-
packStart
Deprecated.Use GtkColumnView insteadPacks thecellinto the beginning of the column. Ifexpandisfalse, then thecellis allocated no more space than it needs. Any unused space is divided evenly between cells for whichexpandistrue.- Specified by:
packStartin interfaceCellLayout- Parameters:
cell- TheGtkCellRendererexpand-trueifcellis to be given extra space allocated totreeColumn.
-
queueResize
Deprecated.Use GtkColumnView insteadFlags the column, and the cell renderers added to this column, to have their sizes renegotiated. -
setAlignment
Deprecated.Use GtkColumnView insteadSets the alignment of the title or custom widget inside the column header. The alignment determines its location inside the button -- 0.0 for left, 0.5 for center, 1.0 for right.- Parameters:
xalign- The alignment, which is between [0.0 and 1.0] inclusive.
-
setAttributes
Deprecated.Use GtkColumnView insteadSets the attributes in the list as the attributes oftreeColumn.The attributes should be in attribute/column order, as in gtk_tree_view_column_add_attribute(). All existing attributes are removed, and replaced with the new attributes.
- Specified by:
setAttributesin interfaceCellLayout- Parameters:
cellRenderer- theGtkCellRendererwe’re setting the attributes ofvarargs- Anull-terminated list of attributes
-
setCellDataFunc
Deprecated.Use GtkColumnView insteadSets theGtkTreeCellDataFuncto use for the column.This function is used instead of the standard attributes mapping for setting the column value, and should set the value of
treeColumn'scell renderer as appropriate.funcmay benullto remove an older one.- Parameters:
cellRenderer- AGtkCellRendererfunc- TheGtkTreeCellDataFuncto use.
-
setClickable
Deprecated.Use GtkColumnView insteadSets the header to be active ifclickableistrue. When the header is active, then it can take keyboard focus, and can be clicked.- Parameters:
clickable-trueif the header is active.
-
setExpand
Deprecated.Use GtkColumnView insteadSets the column to take available extra space. This space is shared equally amongst all columns that have the expand set totrue. If no column has this option set, then the last column gets all extra space. By default, every column is created with thisfalse.Along with “fixed-width”, the “expand” property changes when the column is resized by the user.
- Parameters:
expand-trueif the column should expand to fill available space.
-
setFixedWidth
Deprecated.Use GtkColumnView insteadIffixedWidthis not -1, sets the fixed width oftreeColumn;otherwise unsets it. The effective value offixedWidthis clamped between the minimum and maximum width of the column; however, the value stored in the “fixed-width” property is not clamped. If the column sizing isTreeViewColumnSizing.GROW_ONLYorTreeViewColumnSizing.AUTOSIZE, setting a fixed width overrides the automatically calculated width. Note thatfixedWidthis only a hint to GTK; the width actually allocated to the column may be greater or less than requested.Along with “expand”, the “fixed-width” property changes when the column is resized by the user.
- Parameters:
fixedWidth- The new fixed width, in pixels, or -1.
-
setMaxWidth
Deprecated.Use GtkColumnView insteadSets the maximum width of thetreeColumn.IfmaxWidthis -1, then the maximum width is unset. Note, the column can actually be wider than max width if it’s the last column in a view. In this case, the column expands to fill any extra space.- Parameters:
maxWidth- The maximum width of the column in pixels, or -1.
-
setMinWidth
Deprecated.Use GtkColumnView insteadSets the minimum width of thetreeColumn.IfminWidthis -1, then the minimum width is unset.- Parameters:
minWidth- The minimum width of the column in pixels, or -1.
-
setReorderable
Deprecated.Use GtkColumnView insteadIfreorderableistrue, then the column can be reordered by the end user dragging the header.- Parameters:
reorderable-true, if the column can be reordered.
-
setResizable
Deprecated.Use GtkColumnView insteadIfresizableistrue, then the user can explicitly resize the column by grabbing the outer edge of the column button.If resizable is
trueand sizing mode of the column isTreeViewColumnSizing.AUTOSIZE, then the sizing mode is changed toTreeViewColumnSizing.GROW_ONLY.- Parameters:
resizable-true, if the column can be resized
-
setSizing
Deprecated.Use GtkColumnView insteadSets the growth behavior of this TreeViewColumn totype.- Parameters:
type- TheGtkTreeViewColumnSizing.
-
setSortColumnId
Deprecated.Use GtkColumnView insteadSets the logicalsortColumnIdthat this column sorts on when this column is selected for sorting. Doing so makes the column header clickable.- Parameters:
sortColumnId- ThesortColumnIdof the model to sort on.
-
setSortIndicator
Deprecated.Use GtkColumnView insteadCall this function with asettingoftrueto display an arrow in the header button indicating the column is sorted. Call gtk_tree_view_column_set_sort_order() to change the direction of the arrow.- Parameters:
setting-trueto display an indicator that the column is sorted
-
setSortOrder
Deprecated.Use GtkColumnView insteadChanges the appearance of the sort indicator.This does not actually sort the model. Use gtk_tree_view_column_set_sort_column_id() if you want automatic sorting support. This function is primarily for custom sorting behavior, and should be used in conjunction with gtk_tree_sortable_set_sort_column_id() to do that. For custom models, the mechanism will vary.
The sort indicator changes direction to indicate normal sort or reverse sort. Note that you must have the sort indicator enabled to see anything when calling this function; see gtk_tree_view_column_set_sort_indicator().
- Parameters:
order- sort order that the sort indicator should indicate
-
setSpacing
Deprecated.Use GtkColumnView insteadSets the spacing field oftreeColumn,which is the number of pixels to place between cell renderers packed into it.- Parameters:
spacing- distance between cell renderers in pixels.
-
setTitle
Deprecated.Use GtkColumnView insteadSets the title of thetreeColumn.If a custom widget has been set, then this value is ignored.- Parameters:
title- The title of thetreeColumn.
-
setVisible
Deprecated.Use GtkColumnView insteadSets the visibility oftreeColumn.- Parameters:
visible-trueif the this TreeViewColumn is visible.
-
setWidget
Deprecated.Use GtkColumnView insteadSets the widget in the header to bewidget.If widget isnull, then the header button is set with aGtkLabelset to the title oftreeColumn.- Parameters:
widget- A childGtkWidget
-
onClicked
public SignalConnection<TreeViewColumn.ClickedCallback> onClicked(TreeViewColumn.ClickedCallback handler) Deprecated.Emitted when the column's header has been clicked.- Parameters:
handler- the signal handler- Returns:
- a signal handler ID to keep track of the signal connection
- See Also:
-
emitClicked
public void emitClicked()Deprecated.Emits the "clicked" signal. SeeonClicked(org.gnome.gtk.TreeViewColumn.ClickedCallback). -
builder
Deprecated.ATreeViewColumn.Builderobject constructs aTreeViewColumnwith the specified properties. Use the variousset...()methods to set properties, and finish construction withTreeViewColumn.Builder.build().- Returns:
- the builder object
-
ColumnViewandColumnViewColumninstead ofTreeViewto show a tabular list