Class EntryRow

All Implemented Interfaces:
PointerInterface
Direct Known Subclasses:
PasswordEntryRow

public class EntryRow extends PreferencesRow
A [class@Gtk.ListBoxRow] with an embedded text entry.

<picture>
<source srcset="entry-row-dark.png" media="(prefers-color-scheme: dark)">
<img src="entry-row.png" alt="entry-row">
</picture>

`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 [property@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
[iface@Gtk.Editable] API.

See also [class@PasswordEntryRow].

## AdwEntryRow as GtkBuildable

The `AdwEntryRow` implementation of the [iface@Gtk.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.

https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.EntryRow.html

  • Field Details

  • Constructor Details

    • EntryRow

      public EntryRow(PointerContainer pointer)
    • EntryRow

      public EntryRow()
      Creates a new `AdwEntryRow`.
  • Method Details

    • getClassHandler

      public static ClassHandler getClassHandler()
    • addPrefix

      public void addPrefix(@Nonnull Widget widget)
      Adds a prefix widget to @self.
      Parameters:
      widget - a widget
    • addSuffix

      public void addSuffix(@Nonnull Widget widget)
      Adds a suffix widget to @self.
      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

      public AttrList 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 @self.
      Returns:
      whether or not emoji completion is enabled
    • getInputHints

      public int getInputHints()
      Gets the additional input hints of @self.
      Returns:
      The input hints
    • getInputPurpose

      public int getInputPurpose()
      Gets the input purpose of @self.
      Returns:
      the input purpose
    • getShowApplyButton

      public boolean getShowApplyButton()
      Gets whether @self can show the apply button.
      Returns:
      whether to show the apply button
    • remove

      public void remove(@Nonnull Widget widget)
      Removes a child from @self.
      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

      public void setAttributes(@Nullable AttrList attributes)
      Sets Pango attributes to apply to the text of the embedded entry.

      The [struct@Pango.Attribute]'s `start_index` and `end_index` must refer to
      the [class@Gtk.EntryBuffer] text, i.e. without the preedit string.
      Parameters:
      attributes - a list of attributes
    • setEnableEmojiCompletion

      public void setEnableEmojiCompletion(boolean enable_emoji_completion)
      Sets whether to suggest emoji replacements on @self.

      Emoji replacement is done with :-delimited names, like `:heart:`.
      Parameters:
      enable_emoji_completion - Whether emoji completion should be enabled or not
    • setInputHints

      public void setInputHints(int hints)
      Set additional input hints for @self.

      Input hints allow input methods to fine-tune their behavior.

      See also: [property@AdwEntryRow:input-purpose]
      Parameters:
      hints - the hints
    • setInputPurpose

      public void setInputPurpose(int purpose)
      Sets the input purpose of @self.

      The input purpose can be used by input methods to adjust their behavior.
      Parameters:
      purpose - the purpose
    • setShowApplyButton

      public void setShowApplyButton(boolean show_apply_button)
      Sets whether @self can show the apply button.

      When set to `TRUE`, typing text in the entry will reveal an apply button.
      Clicking it or pressing the <kbd>Enter</kbd> key will hide the button and
      emit the [signal@EntryRow::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:
      show_apply_button - whether to show the apply button
    • onApply

      public SignalHandler onApply(EntryRow.OnApply signal)
      Connect to signal "apply".
      See EntryRow.OnApply.onApply() for signal description.
      Field SIGNAL_ON_APPLY contains original signal name and can be used as resource reference.
      Parameters:
      signal - callback function (lambda).
      Returns:
      SignalHandler. Can be used to disconnect signal and to release callback function.
    • onEntryActivated

      public SignalHandler onEntryActivated(EntryRow.OnEntryActivated signal)
      Connect to signal "entry-activated".
      See EntryRow.OnEntryActivated.onEntryActivated() for signal description.
      Field SIGNAL_ON_ENTRY_ACTIVATED contains original signal name and can be used as resource reference.
      Parameters:
      signal - callback function (lambda).
      Returns:
      SignalHandler. Can be used to disconnect signal and to release callback function.
    • asAccessible

      public Accessible asAccessible()
      Implements interface Accessible. Call this to get access to interface functions.
      Overrides:
      asAccessible in class PreferencesRow
      Returns:
      Accessible
    • asActionable

      public Actionable asActionable()
      Implements interface Actionable. Call this to get access to interface functions.
      Overrides:
      asActionable in class PreferencesRow
      Returns:
      Actionable
    • asBuildable

      public Buildable asBuildable()
      Implements interface Buildable. Call this to get access to interface functions.
      Overrides:
      asBuildable in class PreferencesRow
      Returns:
      Buildable
    • asConstraintTarget

      public ConstraintTarget asConstraintTarget()
      Implements interface ConstraintTarget. Call this to get access to interface functions.
      Overrides:
      asConstraintTarget in class PreferencesRow
      Returns:
      ConstraintTarget
    • asEditable

      public Editable asEditable()
      Implements interface Editable. Call this to get access to interface functions.
      Returns:
      Editable
    • getTypeID

      public static long getTypeID()
    • getParentTypeID

      public static long getParentTypeID()
    • getTypeSize

      public static TypeSystem.TypeSize getTypeSize()
    • getParentTypeSize

      public static TypeSystem.TypeSize getParentTypeSize()
    • getInstanceSize

      public static int getInstanceSize()