Package ch.bailu.gtk.gtk
Klasse SingleSelection
java.lang.Object
ch.bailu.gtk.type.Type
ch.bailu.gtk.type.Pointer
ch.bailu.gtk.gobject.Object
ch.bailu.gtk.type.PropertyHolder
ch.bailu.gtk.gtk.SingleSelection
- Alle implementierten Schnittstellen:
PointerInterface
A selection model that allows selecting a single item.
Note that the selection is *persistent* -- if the selected item is removed
and re-added in the same [signal@Gio.ListModel::items-changed] emission, it
stays selected. In particular, this means that changing the sort order of an
underlying sort model will preserve the selection.
Note that the selection is *persistent* -- if the selected item is removed
and re-added in the same [signal@Gio.ListModel::items-changed] emission, it
stays selected. In particular, this means that changing the sort order of an
underlying sort model will preserve the selection.
-
Verschachtelte Klassen - Übersicht
Von Klasse geerbte verschachtelte Klassen/Schnittstellen ch.bailu.gtk.gobject.Object
Object.OnBindingTransformFunc, Object.OnDestroyNotify, Object.OnDuplicateFunc, Object.OnNotify, Object.OnToggleNotify, Object.OnWeakNotify
-
Feldübersicht
Von Klasse geerbte Felder ch.bailu.gtk.gobject.Object
SIGNAL_ON_NOTIFY
-
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungSingleSelection
(ListModel model) Creates a new selection to handle @model.SingleSelection
(PointerContainer pointer) -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungImplements interfaceListModel
.Implements interfaceSectionModel
.Implements interfaceSelectionModel
.boolean
Checks if autoselect has been enabled or disabled via
gtk_single_selection_set_autoselect().boolean
If %TRUE, gtk_selection_model_unselect_item() is supported and allows
unselecting the selected item.static ClassHandler
static int
getModel()
Gets the model that @self is wrapping.static long
static TypeSystem.TypeSize
int
Gets the position of the selected item.Gets the selected item.static long
static TypeSystem.TypeSize
void
setAutoselect
(boolean autoselect) Enables or disables autoselect.void
setCanUnselect
(boolean can_unselect) If %TRUE, unselecting the current item via
gtk_selection_model_unselect_item() is supported.void
Sets the model that @self should wrap.void
setSelected
(int position) Selects the item at the given position.Von Klasse geerbte Methoden ch.bailu.gtk.type.PropertyHolder
getBooleanProperty, getIntProperty, getObjectProperty, getStringProperty, getStrProperty, setBooleanProperty, setIntProperty, setObjectProperty, setStringProperty, setStrProperty
Von Klasse geerbte Methoden ch.bailu.gtk.gobject.Object
addToggleRef, bindProperty, bindProperty, bindPropertyFull, bindPropertyFull, bindPropertyWithClosures, bindPropertyWithClosures, compatControl, connect, connect, disconnect, disconnect, dupData, dupData, dupQdata, forceFloating, freezeNotify, get, get, getData, getData, getProperty, getProperty, getQdata, interfaceFindProperty, interfaceInstallProperty, isFloating, notify, notify, notifyByPspec, onNotify, ref, refSink, removeToggleRef, replaceData, replaceData, replaceQdata, runDispose, set, set, setData, setData, setDataFull, setDataFull, setProperty, setProperty, setQdata, setQdataFull, stealData, stealData, stealQdata, takeRef, thawNotify, unref, watchClosure, weakRef, weakUnref
Von Klasse geerbte Methoden ch.bailu.gtk.type.Pointer
asCPointer, cast, connectSignal, disconnectSignals, disconnectSignals, equals, hashCode, throwIfNull, throwNullPointerException, toString, unregisterCallbacks, unregisterCallbacks
Von Klasse geerbte Methoden ch.bailu.gtk.type.Type
asCPointer, asCPointer, asCPointerNotNull, asJnaPointer, asJnaPointer, asPointer, asPointer, cast, cast, throwIfNull
Von Klasse geerbte Methoden java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Von Schnittstelle geerbte Methoden ch.bailu.gtk.type.PointerInterface
asCPointerNotNull, asJnaPointer, asPointer, isNotNull, isNull
-
Konstruktordetails
-
SingleSelection
-
SingleSelection
Creates a new selection to handle @model.- Parameter:
model
- the `GListModel` to manage
-
-
Methodendetails
-
getClassHandler
-
getAutoselect
public boolean getAutoselect()Checks if autoselect has been enabled or disabled via
gtk_single_selection_set_autoselect().- Gibt zurück:
- %TRUE if autoselect is enabled
-
getCanUnselect
public boolean getCanUnselect()If %TRUE, gtk_selection_model_unselect_item() is supported and allows
unselecting the selected item.- Gibt zurück:
- %TRUE to support unselecting
-
getModel
Gets the model that @self is wrapping.- Gibt zurück:
- The model being wrapped
-
getSelected
public int getSelected()Gets the position of the selected item.
If no item is selected, %GTK_INVALID_LIST_POSITION is returned.- Gibt zurück:
- The position of the selected item
-
getSelectedItem
Gets the selected item.
If no item is selected, %NULL is returned.- Gibt zurück:
- The selected item
-
setAutoselect
public void setAutoselect(boolean autoselect) Enables or disables autoselect.
If @autoselect is %TRUE, @self will enforce that an item is always
selected. It will select a new item when the currently selected
item is deleted and it will disallow unselecting the current item.- Parameter:
autoselect
- %TRUE to always select an item
-
setCanUnselect
public void setCanUnselect(boolean can_unselect) If %TRUE, unselecting the current item via
gtk_selection_model_unselect_item() is supported.
Note that setting [property@Gtk.SingleSelection:autoselect] will
cause unselecting to not work, so it practically makes no sense
to set both at the same time.- Parameter:
can_unselect
- %TRUE to allow unselecting
-
setModel
Sets the model that @self should wrap.
If @model is %NULL, @self will be empty.- Parameter:
model
- A `GListModel` to wrap
-
setSelected
public void setSelected(int position) Selects the item at the given position.
If the list does not have an item at @position or
%GTK_INVALID_LIST_POSITION is given, the behavior depends on the
value of the [property@Gtk.SingleSelection:autoselect] property:
If it is set, no change will occur and the old item will stay
selected. If it is unset, the selection will be unset and no item
will be selected. This also applies if [property@Gtk.SingleSelection:can-unselect]
is set to %FALSE.- Parameter:
position
- the item to select or %GTK_INVALID_LIST_POSITION
-
asListModel
Implements interfaceListModel
. Call this to get access to interface functions.- Gibt zurück:
ListModel
-
asSectionModel
Implements interfaceSectionModel
. Call this to get access to interface functions.- Gibt zurück:
SectionModel
-
asSelectionModel
Implements interfaceSelectionModel
. Call this to get access to interface functions.- Gibt zurück:
SelectionModel
-
getTypeID
public static long getTypeID() -
getParentTypeID
public static long getParentTypeID() -
getTypeSize
-
getParentTypeSize
-
getInstanceSize
public static int getInstanceSize()
-