Class EntryRow
- All Implemented Interfaces:
Proxy
,Accessible
,Actionable
,Buildable
,ConstraintTarget
,Editable
- Direct Known Subclasses:
PasswordEntryRow
ListBoxRow
with an embedded text entry.
AdwEntryRow
has a title that doubles as placeholder text. It shows an icon
indicating that it's editable and can receive additional widgets before or
after the editable part.
If EntryRow:show-apply-button
is set to TRUE
, AdwEntryRow
can
show an apply button when editing its contents. This can be useful if
changing its contents can result in an expensive operation, such as network
activity.
AdwEntryRow
provides only minimal API and should be used with the
Editable
API.
See also PasswordEntryRow
.
AdwEntryRow as GtkBuildable
The AdwEntryRow
implementation of the Buildable
interface
supports adding a child at its end by specifying “suffix” or omitting the
“type” attribute of a <child> element.
It also supports adding a child as a prefix widget by specifying “prefix” as the “type” attribute of a <child> element.
CSS nodes
AdwEntryRow
has a single CSS node with name row
and the .entry
style
class.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
Functional interface declaration of theApplyCallback
callback.static class
EntryRow.Builder<B extends EntryRow.Builder<B>>
Inner class implementing a builder pattern to construct a GObject with properties.static interface
Functional interface declaration of theEntryActivatedCallback
callback.static class
Nested classes/interfaces inherited from class org.gnome.adw.PreferencesRow
PreferencesRow.PreferencesRowClass
Nested classes/interfaces inherited from class org.gnome.gtk.ListBoxRow
ListBoxRow.ActivateCallback, ListBoxRow.ListBoxRowClass
Nested classes/interfaces inherited from class org.gnome.gtk.Widget
Widget.DestroyCallback, Widget.DirectionChangedCallback, Widget.HideCallback, Widget.KeynavFailedCallback, Widget.MapCallback, Widget.MnemonicActivateCallback, Widget.MoveFocusCallback, Widget.QueryTooltipCallback, Widget.RealizeCallback, Widget.ShowCallback, Widget.StateFlagsChangedCallback, Widget.UnmapCallback, Widget.UnrealizeCallback, Widget.WidgetClass, Widget.WidgetImpl
Nested classes/interfaces inherited from class org.gnome.gobject.InitiallyUnowned
InitiallyUnowned.InitiallyUnownedClass
Nested classes/interfaces inherited from class org.gnome.gobject.GObject
GObject.NotifyCallback, GObject.ObjectClass
Nested classes/interfaces inherited from interface org.gnome.gtk.Accessible
Accessible.AccessibleImpl, Accessible.AccessibleInterface
Nested classes/interfaces inherited from interface org.gnome.gtk.Actionable
Actionable.ActionableImpl, Actionable.ActionableInterface
Nested classes/interfaces inherited from interface org.gnome.gtk.Buildable
Buildable.BuildableIface, Buildable.BuildableImpl
Nested classes/interfaces inherited from interface org.gnome.gtk.ConstraintTarget
ConstraintTarget.ConstraintTargetImpl, ConstraintTarget.ConstraintTargetInterface
Nested classes/interfaces inherited from interface org.gnome.gtk.Editable
Editable.ChangedCallback, Editable.DeleteTextCallback, Editable.EditableImpl, Editable.EditableInterface, Editable.InsertTextCallback
-
Constructor Summary
ConstructorDescriptionEntryRow()
Creates a newAdwEntryRow
.EntryRow
(MemorySegment address) Create a EntryRow proxy instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a prefix widget to this EntryRow.void
Adds a suffix widget to this EntryRow.protected EntryRow
asParent()
Returns this instance as if it were its parent type.static EntryRow.Builder
<? extends EntryRow.Builder> builder()
AEntryRow.Builder
object constructs aEntryRow
with the specified properties.void
Emits the "apply" signal.void
Emits the "entry-activated" signal.boolean
Gets whether activating the embedded entry can activate the default widget.Gets Pango attributes applied to the text of the embedded entry.boolean
Gets whether to suggest emoji replacements on this EntryRow.Gets the additional input hints of this EntryRow.Gets the input purpose of this EntryRow.int
Retrieves the maximum length of the entry.static MemoryLayout
The memory layout of the native struct.boolean
Gets whether this EntryRow can show the apply button.int
Retrieves the current length of the text in this EntryRow.static Type
getType()
Get the GType of the EntryRow classboolean
Causes this EntryRow to have keyboard focus without selecting the text.onApply
(EntryRow.ApplyCallback handler) Emitted when the apply button is pressed.Emitted when the embedded entry is activated.void
Removes a child from this EntryRow.void
setActivatesDefault
(boolean activates) Sets whether activating the embedded entry can activate the default widget.void
setAttributes
(@Nullable AttrList attributes) Sets Pango attributes to apply to the text of the embedded entry.void
setEnableEmojiCompletion
(boolean enableEmojiCompletion) Sets whether to suggest emoji replacements on this EntryRow.void
setInputHints
(Set<InputHints> hints) Set additional input hints for this EntryRow.void
setInputHints
(InputHints... hints) Set additional input hints for this EntryRow.void
setInputPurpose
(InputPurpose purpose) Sets the input purpose of this EntryRow.void
setMaxLength
(int maxLength) Sets the maximum length of the entry.void
setShowApplyButton
(boolean showApplyButton) Sets whether this EntryRow can show the apply button.Methods inherited from class org.gnome.adw.PreferencesRow
getTitle, getTitleSelectable, getUseMarkup, getUseUnderline, setTitle, setTitleSelectable, setUseMarkup, setUseUnderline
Methods inherited from class org.gnome.gtk.ListBoxRow
activate, changed, emitActivate, getActivatable, getChild, getHeader, getIndex, getSelectable, isSelected, onActivate, setActivatable, setChild, setHeader, setSelectable
Methods inherited from class org.gnome.gtk.Widget
actionSetEnabled, activateActionIfExists, activateDefault, activateWidget, addController, addCssClass, addMnemonicLabel, addTickCallback, allocate, childFocus, computeBounds, computeExpand, computeExpand, computePoint, computeTransform, contains, createPangoContext, createPangoLayout, cssChanged, directionChanged, disposeTemplate, dragCheckThreshold, emitDestroy, emitDirectionChanged, emitHide, emitKeynavFailed, emitMap, emitMnemonicActivate, emitMoveFocus, emitQueryTooltip, emitRealize, emitShow, emitStateFlagsChanged, emitUnmap, emitUnrealize, errorBell, focus, getAllocatedBaseline, getAllocatedHeight, getAllocatedWidth, getAllocation, getAncestor, getBaseline, getCanFocus, getCanTarget, getChildVisible, getClipboard, getColor, getCssClasses, getCssName, getCursor, getDefaultDirection, getDirection, getDisplay, getFirstChild, getFocusable, getFocusChild, getFocusOnClick, getFontMap, getFontOptions, getFrameClock, getHalign, getHasTooltip, getHeight, getHexpand, getHexpandSet, getLastChild, getLayoutManager, getMapped, getMarginBottom, getMarginEnd, getMarginStart, getMarginTop, getName, getNative, getNextSibling, getOpacity, getOverflow, getPangoContext, getParent, getPreferredSize, getPrevSibling, getPrimaryClipboard, getRealized, getReceivesDefault, getRequestMode, getRoot, getScaleFactor, getSensitive, getSettings, getSize, getSizeRequest, getStateFlags, getStyleContext, getTemplateChild, getTooltipMarkup, getTooltipText, getValign, getVexpand, getVexpandSet, getVisible, getWidth, grabFocus, hasCssClass, hasDefault, hasFocus, hasVisibleFocus, hide, inDestruction, initTemplate, insertActionGroup, insertAfter, insertBefore, isAncestor, isDrawable, isFocus, isSensitive, isVisible, keynavFailed, listMnemonicLabels, map, measure, mnemonicActivate, moveFocus, observeChildren, observeControllers, onDestroy, onDirectionChanged, onHide, onKeynavFailed, onMap, onMnemonicActivate, onMoveFocus, onQueryTooltip, onRealize, onShow, onStateFlagsChanged, onUnmap, onUnrealize, pick, pick, queryTooltip, queueAllocate, queueDraw, queueResize, realize, removeController, removeCssClass, removeMnemonicLabel, removeTickCallback, root, setCanFocus, setCanTarget, setChildVisible, setCssClasses, setCursor, setCursorFromName, setDefaultDirection, setDirection, setFocusable, setFocusChild, setFocusOnClick, setFontMap, setFontOptions, setHalign, setHasTooltip, setHexpand, setHexpandSet, setLayoutManager, setMarginBottom, setMarginEnd, setMarginStart, setMarginTop, setName, setOpacity, setOverflow, setParent, setReceivesDefault, setSensitive, setSizeRequest, setStateFlags, setStateFlags, setTooltipMarkup, setTooltipText, setValign, setVexpand, setVexpandSet, setVisible, shouldLayout, show, sizeAllocate, sizeAllocate, snapshot, snapshotChild, stateFlagsChanged, systemSettingChanged, translateCoordinates, triggerTooltipQuery, unmap, unparent, unrealize, unroot, unsetStateFlags, unsetStateFlags
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, 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
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.gnome.gtk.Accessible
announce, getAccessibleParent, getAccessibleRole, getAtContext, getBounds, getFirstAccessibleChild, getNextAccessibleSibling, getPlatformState, resetProperty, resetRelation, resetState, setAccessibleParent, updateNextAccessibleSibling, updateProperty, updateRelation, updateState
Methods inherited from interface org.gnome.gtk.Actionable
getActionName, getActionTargetValue, setActionName, setActionTarget, setActionTargetValue, setDetailedActionName
Methods inherited from interface org.gnome.gtk.Buildable
getBuildableId
Methods inherited from interface org.gnome.gtk.Editable
delegateGetAccessiblePlatformState, deleteSelection, deleteText, emitChanged, emitDeleteText, emitInsertText, finishDelegate, getAlignment, getChars, getDelegate, getEditable, getEnableUndo, getMaxWidthChars, getPosition, getSelectionBounds, getText, getWidthChars, initDelegate, insertText, onChanged, onDeleteText, onInsertText, selectRegion, setAlignment, setEditable, setEnableUndo, setMaxWidthChars, setPosition, setText, setWidthChars
-
Constructor Details
-
EntryRow
Create a EntryRow proxy instance for the provided memory address.- Parameters:
address
- the memory address of the native object
-
EntryRow
public EntryRow()Creates a newAdwEntryRow
.
-
-
Method Details
-
getType
-
getMemoryLayout
The memory layout of the native struct.- Returns:
- the memory layout
-
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 classPreferencesRow
-
addPrefix
Adds a prefix widget to this EntryRow.- Parameters:
widget
- a widget
-
addSuffix
Adds a suffix widget to this EntryRow.- Parameters:
widget
- a widget
-
getActivatesDefault
public boolean getActivatesDefault()Gets whether activating the embedded entry can activate the default widget.- Returns:
- whether to activate the default widget
-
getAttributes
Gets Pango attributes applied to the text of the embedded entry.- Returns:
- the list of attributes
-
getEnableEmojiCompletion
public boolean getEnableEmojiCompletion()Gets whether to suggest emoji replacements on this EntryRow.- Returns:
- whether or not emoji completion is enabled
-
getInputHints
Gets the additional input hints of this EntryRow.- Returns:
- The input hints
-
getInputPurpose
Gets the input purpose of this EntryRow.- Returns:
- the input purpose
-
getMaxLength
public int getMaxLength()Retrieves the maximum length of the entry.- Returns:
- The maximum length of the entry.
-
getShowApplyButton
public boolean getShowApplyButton()Gets whether this EntryRow can show the apply button.- Returns:
- whether to show the apply button
-
getTextLength
public int getTextLength()Retrieves the current length of the text in this EntryRow.- Returns:
- The current number of characters in this EntryRow, or 0 if there are none.
-
grabFocusWithoutSelecting
public boolean grabFocusWithoutSelecting()Causes this EntryRow to have keyboard focus without selecting the text.See
Text.grabFocusWithoutSelecting()
for more information.- Returns:
- whether the focus is now inside this EntryRow
-
remove
Removes a child from this EntryRow.- Parameters:
widget
- the child to be removed
-
setActivatesDefault
public void setActivatesDefault(boolean activates) Sets whether activating the embedded entry can activate the default widget.- Parameters:
activates
- whether to activate the default widget
-
setAttributes
Sets Pango attributes to apply to the text of the embedded entry.The
Pango.Attribute
'sstart_index
andend_index
must refer to theEntryBuffer
text, i.e. without the preedit string.- Parameters:
attributes
- a list of attributes
-
setEnableEmojiCompletion
public void setEnableEmojiCompletion(boolean enableEmojiCompletion) Sets whether to suggest emoji replacements on this EntryRow.Emoji replacement is done with :-delimited names, like
:heart:
.- Parameters:
enableEmojiCompletion
- Whether emoji completion should be enabled or not
-
setInputHints
Set additional input hints for this EntryRow.Input hints allow input methods to fine-tune their behavior.
See also:
AdwEntryRow:input-purpose
- Parameters:
hints
- the hints
-
setInputHints
Set additional input hints for this EntryRow.Input hints allow input methods to fine-tune their behavior.
See also:
AdwEntryRow:input-purpose
- Parameters:
hints
- the hints
-
setInputPurpose
Sets the input purpose of this EntryRow.The input purpose can be used by input methods to adjust their behavior.
- Parameters:
purpose
- the purpose
-
setMaxLength
public void setMaxLength(int maxLength) Sets the maximum length of the entry.- Parameters:
maxLength
- maximum length of the entry
-
setShowApplyButton
public void setShowApplyButton(boolean showApplyButton) Sets whether this EntryRow can show the apply button.When set to
TRUE
, typing text in the entry will reveal an apply button. Clicking it or pressing theEnter
key will hide the button and emit theEntryRow::apply
signal.This is useful if changing the entry contents can trigger an expensive operation, e.g. network activity, to avoid triggering it after typing every character.
- Parameters:
showApplyButton
- whether to show the apply button
-
onApply
Emitted when the apply button is pressed.See
EntryRow:show-apply-button
.- Parameters:
handler
- the signal handler- Returns:
- a signal handler ID to keep track of the signal connection
- See Also:
-
emitApply
public void emitApply()Emits the "apply" signal. SeeonApply(org.gnome.adw.EntryRow.ApplyCallback)
. -
onEntryActivated
public SignalConnection<EntryRow.EntryActivatedCallback> onEntryActivated(EntryRow.EntryActivatedCallback handler) Emitted when the embedded entry is activated.- Parameters:
handler
- the signal handler- Returns:
- a signal handler ID to keep track of the signal connection
- See Also:
-
emitEntryActivated
public void emitEntryActivated()Emits the "entry-activated" signal. SeeonEntryActivated(org.gnome.adw.EntryRow.EntryActivatedCallback)
. -
builder
AEntryRow.Builder
object constructs aEntryRow
with the specified properties. Use the variousset...()
methods to set properties, and finish construction withEntryRow.Builder.build()
.
-