Package ch.bailu.gtk.gtk
Klasse EntryCompletion
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.EntryCompletion
- Alle implementierten Schnittstellen:
PointerInterface
`GtkEntryCompletion` is an auxiliary object to provide completion functionality
for `GtkEntry`.
It implements the [iface@Gtk.CellLayout] interface, to allow the user
to add extra cells to the `GtkTreeView` with completion matches.
“Completion functionality” means that when the user modifies the text
in the entry, `GtkEntryCompletion` checks which rows in the model match
the current content of the entry, and displays a list of matches.
By default, the matching is done by comparing the entry text
case-insensitively against the text column of the model (see
[method@Gtk.EntryCompletion.set_text_column]), but this can be overridden
with a custom match function (see [method@Gtk.EntryCompletion.set_match_func]).
When the user selects a completion, the content of the entry is
updated. By default, the content of the entry is replaced by the
text column of the model, but this can be overridden by connecting
to the [signal@Gtk.EntryCompletion::match-selected] signal and updating the
entry in the signal handler. Note that you should return %TRUE from
the signal handler to suppress the default behaviour.
To add completion functionality to an entry, use
[method@Gtk.Entry.set_completion].
`GtkEntryCompletion` uses a [class@Gtk.TreeModelFilter] model to
represent the subset of the entire model that is currently matching.
While the `GtkEntryCompletion` signals
[signal@Gtk.EntryCompletion::match-selected] and
[signal@Gtk.EntryCompletion::cursor-on-match] take the original model
and an iter pointing to that model as arguments, other callbacks and
signals (such as `GtkCellLayoutDataFunc` or
[signal@Gtk.CellArea::apply-attributes)]
will generally take the filter model as argument. As long as you are
only calling [method@Gtk.TreeModel.get], this will make no difference to
you. If for some reason, you need the original model, use
[method@Gtk.TreeModelFilter.get_model]. Don’t forget to use
[method@Gtk.TreeModelFilter.convert_iter_to_child_iter] to obtain a
matching iter.
for `GtkEntry`.
It implements the [iface@Gtk.CellLayout] interface, to allow the user
to add extra cells to the `GtkTreeView` with completion matches.
“Completion functionality” means that when the user modifies the text
in the entry, `GtkEntryCompletion` checks which rows in the model match
the current content of the entry, and displays a list of matches.
By default, the matching is done by comparing the entry text
case-insensitively against the text column of the model (see
[method@Gtk.EntryCompletion.set_text_column]), but this can be overridden
with a custom match function (see [method@Gtk.EntryCompletion.set_match_func]).
When the user selects a completion, the content of the entry is
updated. By default, the content of the entry is replaced by the
text column of the model, but this can be overridden by connecting
to the [signal@Gtk.EntryCompletion::match-selected] signal and updating the
entry in the signal handler. Note that you should return %TRUE from
the signal handler to suppress the default behaviour.
To add completion functionality to an entry, use
[method@Gtk.Entry.set_completion].
`GtkEntryCompletion` uses a [class@Gtk.TreeModelFilter] model to
represent the subset of the entire model that is currently matching.
While the `GtkEntryCompletion` signals
[signal@Gtk.EntryCompletion::match-selected] and
[signal@Gtk.EntryCompletion::cursor-on-match] take the original model
and an iter pointing to that model as arguments, other callbacks and
signals (such as `GtkCellLayoutDataFunc` or
[signal@Gtk.CellArea::apply-attributes)]
will generally take the filter model as argument. As long as you are
only calling [method@Gtk.TreeModel.get], this will make no difference to
you. If for some reason, you need the original model, use
[method@Gtk.TreeModelFilter.get_model]. Don’t forget to use
[method@Gtk.TreeModelFilter.convert_iter_to_child_iter] to obtain a
matching iter.
-
Verschachtelte Klassen - Übersicht
Verschachtelte KlassenModifizierer und TypKlasseBeschreibungstatic interfacestatic interfacestatic interfacestatic interfacestatic interfacestatic interfaceVon Klasse geerbte verschachtelte Klassen/Schnittstellen ch.bailu.gtk.gobject.Object
Object.OnBindingTransformFunc, Object.OnDuplicateFunc, Object.OnNotify, Object.OnToggleNotify, Object.OnWeakNotify -
Feldübersicht
FelderModifizierer und TypFeldBeschreibungstatic final Stringstatic final Stringstatic final Stringstatic final StringVon Klasse geerbte Felder ch.bailu.gtk.gobject.Object
SIGNAL_ON_NOTIFY -
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungImplements interfaceBuildable.Implements interfaceCellLayout.voidcomplete()Veraltet.computePrefix(Str key) Veraltet.computePrefix(String key) Veraltet.static ClassHandlerVeraltet.getEntry()Veraltet.booleanVeraltet.booleanVeraltet.static intintVeraltet.getModel()Veraltet.static longstatic TypeSystem.TypeSizebooleanVeraltet.booleanVeraltet.booleanVeraltet.intVeraltet.static longstatic TypeSystem.TypeSizevoidVeraltet.static EntryCompletionVeraltet.Connect to signal "cursor-on-match".Connect to signal "insert-prefix".Connect to signal "match-selected".Connect to signal "no-matches".voidsetInlineCompletion(boolean inline_completion) Veraltet.voidsetInlineSelection(boolean inline_selection) Veraltet.voidsetMatchFunc(EntryCompletion.OnEntryCompletionMatchFunc func, Pointer func_data, EntryCompletion.OnDestroyNotify func_notify) Veraltet.voidsetMinimumKeyLength(int length) Veraltet.voidVeraltet.voidsetPopupCompletion(boolean popup_completion) Veraltet.voidsetPopupSetWidth(boolean popup_set_width) Veraltet.voidsetPopupSingleMatch(boolean popup_single_match) Veraltet.voidsetTextColumn(int column) Veraltet.Von Klasse geerbte Methoden ch.bailu.gtk.type.PropertyHolder
getBooleanProperty, getIntProperty, getObjectProperty, getStringProperty, getStrProperty, setBooleanProperty, setIntProperty, setObjectProperty, setStringProperty, setStrPropertyVon 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, weakUnrefVon Klasse geerbte Methoden ch.bailu.gtk.type.Pointer
asCPointer, cast, connectSignal, disconnectSignals, disconnectSignals, equals, hashCode, throwIfNull, throwNullPointerException, toString, unregisterCallbacks, unregisterCallbacksVon Klasse geerbte Methoden ch.bailu.gtk.type.Type
asCPointer, asCPointer, asCPointerNotNull, asJnaPointer, asJnaPointer, asPointer, asPointer, cast, cast, throwIfNullVon Klasse geerbte Methoden java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitVon Schnittstelle geerbte Methoden ch.bailu.gtk.type.PointerInterface
asCPointerNotNull, asJnaPointer, asPointer, isNotNull, isNull
-
Felddetails
-
SIGNAL_ON_CURSOR_ON_MATCH
- Siehe auch:
-
SIGNAL_ON_INSERT_PREFIX
- Siehe auch:
-
SIGNAL_ON_MATCH_SELECTED
- Siehe auch:
-
SIGNAL_ON_NO_MATCHES
- Siehe auch:
-
-
Konstruktordetails
-
EntryCompletion
-
EntryCompletion
Veraltet.Creates a new `GtkEntryCompletion` object.
-
-
Methodendetails
-
getClassHandler
-
newWithAreaEntryCompletion
Veraltet.Creates a new `GtkEntryCompletion` object using the
specified @area.
The `GtkCellArea` is used to layout cells in the underlying
`GtkTreeViewColumn` for the drop-down menu.- Parameter:
area- the `GtkCellArea` used to layout cells- Gibt zurück:
- A newly created `GtkEntryCompletion` object
-
complete
Veraltet.Requests a completion operation, or in other words a refiltering of the
current list with completions, using the current key.
The completion list view will be updated accordingly. -
computePrefix
Veraltet.Computes the common prefix that is shared by all rows in @completion
that start with @key.
If no row matches @key, %NULL will be returned.
Note that a text column must have been set for this function to work,
see [method@Gtk.EntryCompletion.set_text_column] for details.- Parameter:
key- The text to complete for- Gibt zurück:
- The common prefix all rows starting with @key
-
computePrefix
Veraltet.Computes the common prefix that is shared by all rows in @completion
that start with @key.
If no row matches @key, %NULL will be returned.
Note that a text column must have been set for this function to work,
see [method@Gtk.EntryCompletion.set_text_column] for details.- Parameter:
key- The text to complete for- Gibt zurück:
- The common prefix all rows starting with @key
-
getCompletionPrefix
Veraltet.Get the original text entered by the user that triggered
the completion or %NULL if there’s no completion ongoing.- Gibt zurück:
- the prefix for the current completion
-
getEntry
Veraltet.Gets the entry @completion has been attached to.- Gibt zurück:
- The entry @completion has been attached to
-
getInlineCompletion
Veraltet.Returns whether the common prefix of the possible completions should
be automatically inserted in the entry.- Gibt zurück:
- %TRUE if inline completion is turned on
-
getInlineSelection
Veraltet.Returns %TRUE if inline-selection mode is turned on.- Gibt zurück:
- %TRUE if inline-selection mode is on
-
getMinimumKeyLength
Veraltet.Returns the minimum key length as set for @completion.- Gibt zurück:
- The currently used minimum key length
-
getModel
Veraltet.Returns the model the `GtkEntryCompletion` is using as data source.
Returns %NULL if the model is unset.- Gibt zurück:
- A `GtkTreeModel`
-
getPopupCompletion
Veraltet.Returns whether the completions should be presented in a popup window.- Gibt zurück:
- %TRUE if popup completion is turned on
-
getPopupSetWidth
Veraltet.Returns whether the completion popup window will be resized to the
width of the entry.- Gibt zurück:
- %TRUE if the popup window will be resized to the width of the entry
-
getPopupSingleMatch
Veraltet.Returns whether the completion popup window will appear even if there is
only a single match.- Gibt zurück:
- %TRUE if the popup window will appear regardless of the number of matches
-
getTextColumn
Veraltet.Returns the column in the model of @completion to get strings from.- Gibt zurück:
- the column containing the strings
-
insertPrefix
Veraltet.Requests a prefix insertion. -
setInlineCompletion
Veraltet.Sets whether the common prefix of the possible completions should
be automatically inserted in the entry.- Parameter:
inline_completion- %TRUE to do inline completion
-
setInlineSelection
Veraltet.Sets whether it is possible to cycle through the possible completions
inside the entry.- Parameter:
inline_selection- %TRUE to do inline selection
-
setMatchFunc
@Deprecated public void setMatchFunc(EntryCompletion.OnEntryCompletionMatchFunc func, @Nullable Pointer func_data, EntryCompletion.OnDestroyNotify func_notify) Veraltet.Sets the match function for @completion to be @func.
The match function is used to determine if a row should or
should not be in the completion list.- Parameter:
func- the `GtkEntryCompletion`MatchFunc to usefunc_data- user data for @funcfunc_notify- destroy notify for @func_data.
-
setMinimumKeyLength
Veraltet.Requires the length of the search key for @completion to be at least
@length.
This is useful for long lists, where completing using a small
key takes a lot of time and will come up with meaningless results anyway
(ie, a too large dataset).- Parameter:
length- the minimum length of the key in order to start completing
-
setModel
Veraltet.Sets the model for a `GtkEntryCompletion`.
If @completion already has a model set, it will remove it
before setting the new model. If model is %NULL, then it
will unset the model.- Parameter:
model- the `GtkTreeModel`
-
setPopupCompletion
Veraltet.Sets whether the completions should be presented in a popup window.- Parameter:
popup_completion- %TRUE to do popup completion
-
setPopupSetWidth
Veraltet.Sets whether the completion popup window will be resized to be the same
width as the entry.- Parameter:
popup_set_width- %TRUE to make the width of the popup the same as the entry
-
setPopupSingleMatch
Veraltet.Sets whether the completion popup window will appear even if there is
only a single match.
You may want to set this to %FALSE if you
are using [property@Gtk.EntryCompletion:inline-completion].- Parameter:
popup_single_match- %TRUE if the popup should appear even for a single match
-
setTextColumn
Veraltet.Convenience function for setting up the most used case of this code: a
completion list with just strings.
This function will set up @completion
to have a list displaying all (and just) strings in the completion list,
and to get those strings from @column in the model of @completion.
This functions creates and adds a `GtkCellRendererText` for the selected
column. If you need to set the text column, but don't want the cell
renderer, use g_object_set() to set the
[property@Gtk.EntryCompletion:text-column] property directly.- Parameter:
column- the column in the model of @completion to get strings from
-
onCursorOnMatch
Connect to signal "cursor-on-match".
SeeEntryCompletion.OnCursorOnMatch.onCursorOnMatch(ch.bailu.gtk.gtk.TreeModel, ch.bailu.gtk.gtk.TreeIter)for signal description.
FieldSIGNAL_ON_CURSOR_ON_MATCHcontains original signal name and can be used as resource reference.- Parameter:
signal- callback function (lambda).- Gibt zurück:
SignalHandler. Can be used to disconnect signal and to release callback function.
-
onInsertPrefix
Connect to signal "insert-prefix".
SeeEntryCompletion.OnInsertPrefix.onInsertPrefix(ch.bailu.gtk.type.Str)for signal description.
FieldSIGNAL_ON_INSERT_PREFIXcontains original signal name and can be used as resource reference.- Parameter:
signal- callback function (lambda).- Gibt zurück:
SignalHandler. Can be used to disconnect signal and to release callback function.
-
onMatchSelected
Connect to signal "match-selected".
SeeEntryCompletion.OnMatchSelected.onMatchSelected(ch.bailu.gtk.gtk.TreeModel, ch.bailu.gtk.gtk.TreeIter)for signal description.
FieldSIGNAL_ON_MATCH_SELECTEDcontains original signal name and can be used as resource reference.- Parameter:
signal- callback function (lambda).- Gibt zurück:
SignalHandler. Can be used to disconnect signal and to release callback function.
-
onNoMatches
Connect to signal "no-matches".
SeeEntryCompletion.OnNoMatches.onNoMatches()for signal description.
FieldSIGNAL_ON_NO_MATCHEScontains original signal name and can be used as resource reference.- Parameter:
signal- callback function (lambda).- Gibt zurück:
SignalHandler. Can be used to disconnect signal and to release callback function.
-
asBuildable
Implements interfaceBuildable. Call this to get access to interface functions.- Gibt zurück:
Buildable
-
asCellLayout
Implements interfaceCellLayout. Call this to get access to interface functions.- Gibt zurück:
CellLayout
-
getTypeID
public static long getTypeID() -
getParentTypeID
public static long getParentTypeID() -
getTypeSize
-
getParentTypeSize
-
getInstanceSize
public static int getInstanceSize()
-