Class SignalListItemFactory
- All Implemented Interfaces:
Proxy
GtkSignalListItemFactory
is a GtkListItemFactory
that emits signals
to manage listitems.
Signals are emitted for every listitem in the same order:
1. Gtk.SignalListItemFactory::setup
is emitted to set up permanent
things on the listitem. This usually means constructing the widgets used in
the row and adding them to the listitem.
2. Gtk.SignalListItemFactory::bind
is emitted to bind the item passed
via Gtk.ListItem:item
to the widgets that have been created in
step 1 or to add item-specific widgets. Signals are connected to listen to
changes - both to changes in the item to update the widgets or to changes
in the widgets to update the item. After this signal has been called, the
listitem may be shown in a list widget.
3. Gtk.SignalListItemFactory::unbind
is emitted to undo everything
done in step 2. Usually this means disconnecting signal handlers. Once this
signal has been called, the listitem will no longer be used in a list
widget.
4. Gtk.SignalListItemFactory::bind
and
Gtk.SignalListItemFactory::unbind
may be emitted multiple times
again to bind the listitem for use with new items. By reusing listitems,
potentially costly setup can be avoided. However, it means code needs to
make sure to properly clean up the listitem in step 3 so that no information
from the previous use leaks into the next use.
5. Gtk.SignalListItemFactory::teardown
is emitted to allow undoing
the effects of Gtk.SignalListItemFactory::setup
. After this signal
was emitted on a listitem, the listitem will be destroyed and not be used again.
Note that during the signal emissions, changing properties on the listitems passed will not trigger notify signals as the listitem's notifications are frozen. See g_object_freeze_notify() for details.
For tracking changes in other properties in the listitem, the
::notify signal is recommended. The signal can be connected in the
Gtk.SignalListItemFactory::setup
signal and removed again during
Gtk.SignalListItemFactory::teardown
.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
Functional interface declaration of theBindCallback
callback.static class
Inner class implementing a builder pattern to construct a GObject with properties.static interface
Functional interface declaration of theSetupCallback
callback.static class
static interface
Functional interface declaration of theTeardownCallback
callback.static interface
Functional interface declaration of theUnbindCallback
callback.Nested classes/interfaces inherited from class org.gnome.gtk.ListItemFactory
ListItemFactory.ListItemFactoryClass
Nested classes/interfaces inherited from class org.gnome.gobject.GObject
GObject.NotifyCallback, GObject.ObjectClass
-
Constructor Summary
ConstructorDescriptionCreates a newGtkSignalListItemFactory
.SignalListItemFactory
(MemorySegment address) Create a SignalListItemFactory proxy instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionprotected SignalListItemFactory
asParent()
Returns this instance as if it were its parent type.static SignalListItemFactory.Builder
<? extends SignalListItemFactory.Builder> builder()
ASignalListItemFactory.Builder
object constructs aSignalListItemFactory
with the specified properties.void
Emits the "bind" signal.void
Emits the "setup" signal.void
emitTeardown
(GObject object) Emits the "teardown" signal.void
emitUnbind
(GObject object) Emits the "unbind" signal.static Type
getType()
Get the GType of the SignalListItemFactory classonBind
(SignalListItemFactory.BindCallback handler) Emitted when an object has been bound, for example when a newGtk.ListItem:item
has been set on a listitem and should be bound for use.Emitted when a new listitem has been created and needs to be setup for use.Emitted when an object is about to be destroyed.Emitted when an object has been unbound from its item, for example when a listitem was removed from use in a list widget and itsGtk.ListItem:item
is about to be unset.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
-
SignalListItemFactory
Create a SignalListItemFactory proxy instance for the provided memory address.- Parameters:
address
- the memory address of the native object
-
SignalListItemFactory
public SignalListItemFactory()Creates a newGtkSignalListItemFactory
.You need to connect signal handlers before you use it.
-
-
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.- Overrides:
asParent
in classListItemFactory
-
onBind
public SignalConnection<SignalListItemFactory.BindCallback> onBind(SignalListItemFactory.BindCallback handler) Emitted when an object has been bound, for example when a newGtk.ListItem:item
has been set on a listitem and should be bound for use.After this signal was emitted, the object might be shown in a
ListView
or other widget.The
Gtk.SignalListItemFactory::unbind
signal is the opposite of this signal and can be used to undo everything done in this signal.- Parameters:
handler
- the signal handler- Returns:
- a signal handler ID to keep track of the signal connection
- See Also:
-
emitBind
Emits the "bind" signal. SeeonBind(org.gnome.gtk.SignalListItemFactory.BindCallback)
. -
onSetup
public SignalConnection<SignalListItemFactory.SetupCallback> onSetup(SignalListItemFactory.SetupCallback handler) Emitted when a new listitem has been created and needs to be setup for use.It is the first signal emitted for every listitem.
The
Gtk.SignalListItemFactory::teardown
signal is the opposite of this signal and can be used to undo everything done in this signal.- Parameters:
handler
- the signal handler- Returns:
- a signal handler ID to keep track of the signal connection
- See Also:
-
emitSetup
Emits the "setup" signal. SeeonSetup(org.gnome.gtk.SignalListItemFactory.SetupCallback)
. -
onTeardown
public SignalConnection<SignalListItemFactory.TeardownCallback> onTeardown(SignalListItemFactory.TeardownCallback handler) Emitted when an object is about to be destroyed.It is the last signal ever emitted for this
object
.This signal is the opposite of the
Gtk.SignalListItemFactory::setup
signal and should be used to undo everything done in that signal.- Parameters:
handler
- the signal handler- Returns:
- a signal handler ID to keep track of the signal connection
- See Also:
-
emitTeardown
Emits the "teardown" signal. SeeonTeardown(org.gnome.gtk.SignalListItemFactory.TeardownCallback)
. -
onUnbind
public SignalConnection<SignalListItemFactory.UnbindCallback> onUnbind(SignalListItemFactory.UnbindCallback handler) Emitted when an object has been unbound from its item, for example when a listitem was removed from use in a list widget and itsGtk.ListItem:item
is about to be unset.This signal is the opposite of the
Gtk.SignalListItemFactory::bind
signal and should be used to undo everything done in that signal.- Parameters:
handler
- the signal handler- Returns:
- a signal handler ID to keep track of the signal connection
- See Also:
-
emitUnbind
Emits the "unbind" signal. SeeonUnbind(org.gnome.gtk.SignalListItemFactory.UnbindCallback)
. -
builder
ASignalListItemFactory.Builder
object constructs aSignalListItemFactory
with the specified properties. Use the variousset...()
methods to set properties, and finish construction withSignalListItemFactory.Builder.build()
.
-