Class ColumnViewColumn
- All Implemented Interfaces:
Proxy
GtkColumnViewColumn
represents the columns being added to a GtkColumnView
.
The main ingredient for a GtkColumnViewColumn
is the GtkListItemFactory
that tells the columnview how to create cells for this column from items in
the model.
Columns have a title, and can optionally have a header menu set
with setHeaderMenu(org.gnome.gio.MenuModel)
.
A sorter can be associated with a column using
setSorter(org.gnome.gtk.Sorter)
, to let users influence sorting
by clicking on the column header.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
ColumnViewColumn.Builder<B extends ColumnViewColumn.Builder<B>>
Inner class implementing a builder pattern to construct a GObject with properties.static class
Nested classes/interfaces inherited from class org.gnome.gobject.GObject
GObject.NotifyCallback, GObject.ObjectClass
-
Constructor Summary
ConstructorDescriptionColumnViewColumn
(@Nullable String title, @Nullable ListItemFactory factory) Creates a newGtkColumnViewColumn
that uses the givenfactory
for mapping items to widgets.ColumnViewColumn
(MemorySegment address) Create a ColumnViewColumn proxy instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionprotected ColumnViewColumn
asParent()
Returns this instance as if it were its parent type.static ColumnViewColumn.Builder
<? extends ColumnViewColumn.Builder> builder()
AColumnViewColumn.Builder
object constructs aColumnViewColumn
with the specified properties.Gets the column view that's currently displaying this column.boolean
Returns whether this column should expand.Gets the factory that's currently used to populate list items for this column.int
Gets the fixed width of the column.Gets the menu model that is used to create the context menu for the column header.getId()
Returns the ID set with gtk_column_view_column_set_id().boolean
Returns whether this column is resizable.Returns the sorter that is associated with the column.getTitle()
Returns the title set with gtk_column_view_column_set_title().static Type
getType()
Get the GType of the ColumnViewColumn classboolean
Returns whether this column is visible.void
setExpand
(boolean expand) Sets the column to take available extra space.void
setFactory
(@Nullable ListItemFactory factory) Sets theGtkListItemFactory
to use for populating list items for this column.void
setFixedWidth
(int fixedWidth) IffixedWidth
is not -1, sets the fixed width ofcolumn
; otherwise unsets it.void
setHeaderMenu
(@Nullable MenuModel menu) Sets the menu model that is used to create the context menu for the column header.void
Sets the id of this column.void
setResizable
(boolean resizable) Sets whether this column should be resizable by dragging.void
Associates a sorter with the column.void
Sets the title of this column.void
setVisible
(boolean visible) Sets whether this column should be visible in views.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, 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, withProperties
Methods inherited from class org.gnome.gobject.TypeInstance
callParent, callParent, getPrivate, readGClass, writeGClass
Methods inherited from class io.github.jwharm.javagi.base.ProxyInstance
equals, handle, hashCode
-
Constructor Details
-
ColumnViewColumn
Create a ColumnViewColumn proxy instance for the provided memory address.- Parameters:
address
- the memory address of the native object
-
ColumnViewColumn
public ColumnViewColumn(@Nullable @Nullable String title, @Nullable @Nullable ListItemFactory factory) Creates a newGtkColumnViewColumn
that uses the givenfactory
for mapping items to widgets.You most likely want to call
ColumnView.appendColumn(org.gnome.gtk.ColumnViewColumn)
next.The function takes ownership of the argument, so you can write code like:
column = gtk_column_view_column_new (_("Name"), gtk_builder_list_item_factory_new_from_resource ("/name.ui"));
- Parameters:
title
- Title to use for this columnfactory
- The factory to populate items with
-
-
Method Details
-
getType
-
asParent
Returns this instance as if it were its parent type. This is mostly synonymous to the Javasuper
keyword, 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. -
getColumnView
Gets the column view that's currently displaying this column.If this ColumnViewColumn has not been added to a column view yet,
null
is returned.- Returns:
- The column view displaying this ColumnViewColumn.
-
getExpand
public boolean getExpand()Returns whether this column should expand.- Returns:
true
if this column expands
-
getFactory
Gets the factory that's currently used to populate list items for this column.- Returns:
- The factory in use
-
getFixedWidth
public int getFixedWidth()Gets the fixed width of the column.- Returns:
- the fixed with of the column
-
getHeaderMenu
Gets the menu model that is used to create the context menu for the column header.- Returns:
- the
GMenuModel
-
getId
Returns the ID set with gtk_column_view_column_set_id().- Returns:
- The column's ID
-
getResizable
public boolean getResizable()Returns whether this column is resizable.- Returns:
true
if this column is resizable
-
getSorter
Returns the sorter that is associated with the column.- Returns:
- the
GtkSorter
of this ColumnViewColumn
-
getTitle
Returns the title set with gtk_column_view_column_set_title().- Returns:
- The column's title
-
getVisible
public boolean getVisible()Returns whether this column is visible.- Returns:
true
if this column is visible
-
setExpand
public void setExpand(boolean expand) Sets the column to take available extra space.The extra space is shared equally amongst all columns that have the expand set to
true
.- Parameters:
expand
-true
if this column should expand to fill available sace
-
setFactory
Sets theGtkListItemFactory
to use for populating list items for this column.- Parameters:
factory
- the factory to use
-
setFixedWidth
public void setFixedWidth(int fixedWidth) IffixedWidth
is not -1, sets the fixed width ofcolumn
; otherwise unsets it.Setting a fixed width overrides the automatically calculated width. Interactive resizing also sets the “fixed-width” property.
- Parameters:
fixedWidth
- the new fixed width, or -1
-
setHeaderMenu
Sets the menu model that is used to create the context menu for the column header.- Parameters:
menu
- aGMenuModel
-
setId
Sets the id of this column.GTK makes no use of this, but applications can use it when storing column view configuration.
It is up to callers to ensure uniqueness of IDs.
- Parameters:
id
- ID to use for this column
-
setResizable
public void setResizable(boolean resizable) Sets whether this column should be resizable by dragging.- Parameters:
resizable
- whether this column should be resizable
-
setSorter
Associates a sorter with the column.If
sorter
isnull
, the column will not let users change the sorting by clicking on its header.This sorter can be made active by clicking on the column header, or by calling
ColumnView.sortByColumn(org.gnome.gtk.ColumnViewColumn, org.gnome.gtk.SortType)
.See
ColumnView.getSorter()
for the necessary steps for setting up customizable sorting forColumnView
.- Parameters:
sorter
- theGtkSorter
to associate withcolumn
-
setTitle
Sets the title of this column.The title is displayed in the header of a
GtkColumnView
for this column and is therefore user-facing text that should be translated.- Parameters:
title
- Title to use for this column
-
setVisible
public void setVisible(boolean visible) Sets whether this column should be visible in views.- Parameters:
visible
- whether this column should be visible
-
builder
AColumnViewColumn.Builder
object constructs aColumnViewColumn
with the specified properties. Use the variousset...()
methods to set properties, and finish construction withColumnViewColumn.Builder.build()
.
-