Class EntryRow

All Implemented Interfaces:
Accessible, Actionable, Buildable, ConstraintTarget, Editable, Proxy
Direct Known Subclasses:
PasswordEntryRow

@Generated("org.javagi.JavaGI") public class EntryRow extends PreferencesRow implements Accessible, Actionable, Buildable, ConstraintTarget, Editable

A ListBoxRow with an embedded text entry.

entry-row

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 element.

It also supports adding a child as a prefix widget by specifying “prefix” as the “type” attribute of a element.

CSS nodes

AdwEntryRow has a single CSS node with name row and the .entry style class.

Since:
1.2
  • Constructor Details

    • EntryRow

      public EntryRow(MemorySegment address)
      Create a EntryRow instance for the provided memory address.
      Parameters:
      address - the memory address of the native object
    • EntryRow

      public EntryRow()
      Create a new EntryRow.
  • Method Details

    • getType

      public static @Nullable Type getType()
      Get the GType of the EntryRow class.
      Returns:
      the GType
    • getMemoryLayout

      public static MemoryLayout getMemoryLayout()
      The memory layout of the native struct.
      Returns:
      the memory layout
    • asParent

      protected EntryRow asParent()
      Return this instance as if it were its parent type. Comparable to the Java super keyword, but ensures the parent typeclass is also used in native code.
      Overrides:
      asParent in class PreferencesRow
      Returns:
      the instance as if it were its parent type
    • addPrefix

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

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

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

      public Set<InputHints> getInputHints()
      Gets the additional input hints of self.
      Returns:
      The input hints
      Since:
      1.2
    • getInputPurpose

      public InputPurpose getInputPurpose()
      Gets the input purpose of self.
      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 in self.
      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

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

      public void setAttributes(@Nullable AttrList attributes)

      Sets Pango attributes to apply to the text of the embedded entry.

      The Pango.Attribute's start_index and end_index must refer to the EntryBuffer text, 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 on self.

      Emoji replacement is done with :-delimited names, like :heart:.

      Parameters:
      enableEmojiCompletion - Whether emoji completion should be enabled or not
      Since:
      1.2
    • setInputHints

      public void setInputHints(Set<InputHints> hints)

      Set additional input hints for self.

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

      See also: AdwEntryRow:input-purpose

      Parameters:
      hints - the hints
      Since:
      1.2
    • setInputHints

      public void setInputHints(InputHints... hints)

      Set additional input hints for self.

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

      See also: AdwEntryRow:input-purpose

      Parameters:
      hints - the hints
      Since:
      1.2
    • setInputPurpose

      public void setInputPurpose(InputPurpose purpose)

      Sets the input purpose of self.

      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 the Enter key will hide the button and emit the 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:
      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. See onApply(EntryRow.ApplyCallback).
    • onEntryActivated

      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. See onEntryActivated(EntryRow.EntryActivatedCallback).
    • builder

      public static EntryRow.Builder<? extends EntryRow.Builder> builder()
      A EntryRow.Builder object constructs a EntryRow with the specified properties. Use the various set...() methods to set properties, and finish construction with EntryRow.Builder.build().
      Returns:
      the builder object