Class ColumnViewColumn
- All Implemented Interfaces:
Proxy
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
Nested ClassesModifier and TypeClassDescriptionstatic classColumnViewColumn.Builder<B extends ColumnViewColumn.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 ColumnViewColumn.ColumnViewColumn(@Nullable String title, @Nullable ListItemFactory factory) Creates a newGtkColumnViewColumnthat uses the givenfactoryfor mapping items to widgets.ColumnViewColumn(MemorySegment address) Create a ColumnViewColumn proxy instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionprotected ColumnViewColumnasParent()Returns this instance as if it were its parent type.static ColumnViewColumn.Builder<? extends ColumnViewColumn.Builder> builder()AColumnViewColumn.Builderobject constructs aColumnViewColumnwith the specified properties.@Nullable ColumnViewGets the column view that's currently displaying this column.booleanReturns whether this column should expand.@Nullable ListItemFactoryGets the factory that's currently used to populate list items for this column.intGets the fixed width of the column.@Nullable MenuModelGets the menu model that is used to create the context menu for the column header.@Nullable StringgetId()Returns the ID set withsetId(java.lang.String).booleanReturns whether this column is resizable.@Nullable SorterReturns the sorter that is associated with the column.@Nullable StringgetTitle()Returns the title set withsetTitle(java.lang.String).static @Nullable TypegetType()Get the GType of the ColumnViewColumn classbooleanReturns whether this column is visible.voidsetExpand(boolean expand) Sets the column to take available extra space.voidsetFactory(@Nullable ListItemFactory factory) Sets theGtkListItemFactoryto use for populating list items for this column.voidsetFixedWidth(int fixedWidth) Sets the fixed width of the column.voidsetHeaderMenu(@Nullable MenuModel menu) Sets the menu model that is used to create the context menu for the column header.voidSets the id of this column.voidsetResizable(boolean resizable) Sets whether this column should be resizable by dragging.voidAssociates a sorter with the column.voidSets the title of this column.voidsetVisible(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, 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
-
ColumnViewColumn
Create a ColumnViewColumn proxy instance for the provided memory address.- Parameters:
address- the memory address of the native object
-
ColumnViewColumn
Creates a newGtkColumnViewColumnthat uses the givenfactoryfor 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
-
ColumnViewColumn
public ColumnViewColumn()Creates a new ColumnViewColumn.
-
-
Method Details
-
getType
Get the GType of the ColumnViewColumn class- Returns:
- the GType
-
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. -
getColumnView
Gets the column view that's currently displaying this column.If this ColumnViewColumn has not been added to a column view yet,
NULLis returned.- Returns:
- The column view displaying
self.
-
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 withsetId(java.lang.String).- Returns:
- The column's ID
- Since:
- 4.10
-
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
GtkSorterof this ColumnViewColumn
-
getTitle
Returns the title set withsetTitle(java.lang.String).- 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 are set to expand.
- Parameters:
expand- whether this column should expand to fill available space
-
setFactory
Sets theGtkListItemFactoryto use for populating list items for this column.- Parameters:
factory- the factory to use
-
setFixedWidth
public void setFixedWidth(int fixedWidth) Sets the fixed width of the column.If
fixedWidthis -1, the fixed width of the column is unset.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- Since:
- 4.10
-
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
sorteris unset, 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- theGtkSorterto associate withcolumn
-
setTitle
Sets the title of this column.The title is displayed in the header of a
GtkColumnViewfor 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.Builderobject constructs aColumnViewColumnwith the specified properties. Use the variousset...()methods to set properties, and finish construction withColumnViewColumn.Builder.build().- Returns:
- the builder object
-