Class EntryRow
- All Implemented Interfaces:
Accessible,Actionable,Buildable,ConstraintTarget,Editable,Proxy
- 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.
- Since:
- 1.2
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceFunctional interface declaration of theApplyCallbackcallback.static classEntryRow.Builder<B extends EntryRow.Builder<B>>Inner class implementing a builder pattern to construct a GObject with properties.static interfaceFunctional interface declaration of theEntryActivatedCallbackcallback.static classNested classes/interfaces inherited from class org.gnome.adw.PreferencesRow
PreferencesRow.PreferencesRowClassNested classes/interfaces inherited from class org.gnome.gtk.ListBoxRow
ListBoxRow.ActivateCallback, ListBoxRow.ListBoxRowClassNested 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.Widget$Impl, Widget.WidgetClassNested classes/interfaces inherited from class org.gnome.gobject.InitiallyUnowned
InitiallyUnowned.InitiallyUnownedClassNested classes/interfaces inherited from class org.gnome.gobject.GObject
GObject.NotifyCallback, GObject.ObjectClassNested classes/interfaces inherited from interface org.gnome.gtk.Accessible
Accessible.Accessible$Impl, Accessible.AccessibleInterfaceNested classes/interfaces inherited from interface org.gnome.gtk.Actionable
Actionable.Actionable$Impl, Actionable.ActionableInterfaceNested classes/interfaces inherited from interface org.gnome.gtk.Buildable
Buildable.Buildable$Impl, Buildable.BuildableIfaceNested classes/interfaces inherited from interface org.gnome.gtk.ConstraintTarget
ConstraintTarget.ConstraintTarget$Impl, ConstraintTarget.ConstraintTargetInterfaceNested classes/interfaces inherited from interface org.gnome.gtk.Editable
Editable.ChangedCallback, Editable.DeleteTextCallback, Editable.Editable$Impl, Editable.EditableInterface, Editable.InsertTextCallback -
Constructor Summary
ConstructorsConstructorDescriptionEntryRow()Creates a new EntryRow.EntryRow(MemorySegment address) Create a EntryRow proxy instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a prefix widget toself.voidAdds a suffix widget toself.protected EntryRowasParent()Returns this instance as if it were its parent type.static EntryRow.Builder<? extends EntryRow.Builder> builder()AEntryRow.Builderobject constructs aEntryRowwith the specified properties.voidEmits the "apply" signal.voidEmits the "entry-activated" signal.booleanGets whether activating the embedded entry can activate the default widget.@Nullable AttrListGets Pango attributes applied to the text of the embedded entry.booleanGets whether to suggest emoji replacements onself.Gets the additional input hints ofself.Gets the input purpose ofself.intRetrieves the maximum length of the entry.static MemoryLayoutThe memory layout of the native struct.booleanGets whether this EntryRow can show the apply button.intRetrieves the current length of the text inself.static @Nullable TypegetType()Get the GType of the EntryRow classbooleanCauses 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.voidRemoves a child fromself.voidsetActivatesDefault(boolean activates) Sets whether activating the embedded entry can activate the default widget.voidsetAttributes(@Nullable AttrList attributes) Sets Pango attributes to apply to the text of the embedded entry.voidsetEnableEmojiCompletion(boolean enableEmojiCompletion) Sets whether to suggest emoji replacements onself.voidsetInputHints(Set<InputHints> hints) Set additional input hints forself.voidsetInputHints(InputHints... hints) Set additional input hints forself.voidsetInputPurpose(InputPurpose purpose) Sets the input purpose ofself.voidsetMaxLength(int maxLength) Sets the maximum length of the entry.voidsetShowApplyButton(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, setUseUnderlineMethods inherited from class org.gnome.gtk.ListBoxRow
activate, changed, emitActivate, getActivatable, getChild, getHeader, getIndex, getSelectable, isSelected, onActivate, setActivatable, setChild, setHeader, setSelectableMethods 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, getLimitEvents, 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, setLimitEvents, 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, unsetStateFlagsMethods 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, 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, hashCodeMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.gnome.gtk.Accessible
announce, getAccessibleParent, getAccessibleRole, getAtContext, getBounds, getFirstAccessibleChild, getNextAccessibleSibling, getPlatformState, resetProperty, resetRelation, resetState, setAccessibleParent, updateNextAccessibleSibling, updatePlatformState, updateProperty, updateRelation, updateStateMethods inherited from interface org.gnome.gtk.Actionable
getActionName, getActionTargetValue, setActionName, setActionTarget, setActionTargetValue, setDetailedActionNameMethods inherited from interface org.gnome.gtk.Buildable
getBuildableIdMethods 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 new EntryRow.
-
-
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 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.- Overrides:
asParentin classPreferencesRow
-
addPrefix
Adds a prefix widget toself.- Parameters:
widget- a widget- Since:
- 1.2
-
addSuffix
Adds a suffix widget toself.- Parameters:
widget- a widget- Since:
- 1.2
-
getActivatesDefault
public boolean getActivatesDefault()Gets whether activating the embedded entry can activate the default widget.- Returns:
- whether to activate the default widget
- Since:
- 1.2
-
getAttributes
Gets Pango attributes applied to the text of the embedded entry.- Returns:
- the list of attributes
- Since:
- 1.2
-
getEnableEmojiCompletion
public boolean getEnableEmojiCompletion()Gets whether to suggest emoji replacements onself.- Returns:
- whether or not emoji completion is enabled
- Since:
- 1.2
-
getInputHints
Gets the additional input hints ofself.- Returns:
- The input hints
- Since:
- 1.2
-
getInputPurpose
Gets the input purpose ofself.- Returns:
- the input purpose
- Since:
- 1.2
-
getMaxLength
public int getMaxLength()Retrieves the maximum length of the entry.- Returns:
- The maximum length of the entry.
- Since:
- 1.6
-
getShowApplyButton
public boolean getShowApplyButton()Gets whether this EntryRow can show the apply button.- Returns:
- whether to show the apply button
- Since:
- 1.2
-
getTextLength
public int getTextLength()Retrieves the current length of the text inself.- Returns:
- The current number of characters in
self,or 0 if there are none. - Since:
- 1.5
-
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
- Since:
- 1.3
-
remove
Removes a child fromself.- Parameters:
widget- the child to be removed- Since:
- 1.2
-
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- Since:
- 1.2
-
setAttributes
Sets Pango attributes to apply to the text of the embedded entry.The
Pango.Attribute'sstart_indexandend_indexmust refer to theEntryBuffertext, i.e. without the preedit string.- Parameters:
attributes- a list of attributes- Since:
- 1.2
-
setEnableEmojiCompletion
public void setEnableEmojiCompletion(boolean enableEmojiCompletion) Sets whether to suggest emoji replacements onself.Emoji replacement is done with :-delimited names, like
:heart:.- Parameters:
enableEmojiCompletion- Whether emoji completion should be enabled or not- Since:
- 1.2
-
setInputHints
Set additional input hints forself.Input hints allow input methods to fine-tune their behavior.
See also:
AdwEntryRow:input-purpose- Parameters:
hints- the hints- Since:
- 1.2
-
setInputHints
Set additional input hints forself.Input hints allow input methods to fine-tune their behavior.
See also:
AdwEntryRow:input-purpose- Parameters:
hints- the hints- Since:
- 1.2
-
setInputPurpose
Sets the input purpose ofself.The input purpose can be used by input methods to adjust their behavior.
- Parameters:
purpose- the purpose- Since:
- 1.2
-
setMaxLength
public void setMaxLength(int maxLength) Sets the maximum length of the entry.- Parameters:
maxLength- maximum length of the entry- Since:
- 1.6
-
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 theEnterkey will hide the button and emit theEntryRow::applysignal.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- Since:
- 1.2
-
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
- Since:
- 1.2
- 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
- Since:
- 1.2
- See Also:
-
emitEntryActivated
public void emitEntryActivated()Emits the "entry-activated" signal. SeeonEntryActivated(org.gnome.adw.EntryRow.EntryActivatedCallback). -
builder
AEntryRow.Builderobject constructs aEntryRowwith the specified properties. Use the variousset...()methods to set properties, and finish construction withEntryRow.Builder.build().- Returns:
- the builder object
-