org.gnome.gtk

## Class EntryCompletion

- Object
- - org.freedesktop.bindings.Pointer
  - - org.freedesktop.bindings.Proxy
    - - org.gnome.glib.Object
      - - org.gnome.gtk.EntryCompletion

- All Implemented Interfaces:
    CellLayout

      public class EntryCompletion
      extends Object
      implements CellLayout

  An object to use in conjunction with `Entry` to provide completion functionality.

  To add completion functionality to an Entry, use its `setCompletion()` method.

  Since:
    4.0.12
  Author:
    Guillaume Mazoyer

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static interface` | `EntryCompletion.ActionActivated` Emitted when an action item is selected from the popup action list.
    `static interface` | `EntryCompletion.CursorOnMatch` Emitted when the cursor is on a completion string without select it.
    `static interface` | `EntryCompletion.InsertPrefix` Emitted when the inline auto-completion is triggered.
    `static interface` | `EntryCompletion.Match` The callback invoked when a EntryCompletion wants to ask if a given row in the TreeModel should be in the completion list.
    `static interface` | `EntryCompletion.MatchSelected` Emitted when a completion string was selected from the completion list.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `EntryCompletion()` Create a new EntryCompletion.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `complete()` Refilter the current list of completions based on the current key.
    `void` | `connect(EntryCompletion.ActionActivated handler)` Hook up the `EntryCompletion.ActionActivated` handler.
    `void` | `connect(EntryCompletion.CursorOnMatch handler)` Hook up the `EntryCompletion.CursorOnMatch` handler.
    `void` | `connect(EntryCompletion.InsertPrefix handler)` Hook up the `EntryCompletion.InsertPrefix` handler.
    `void` | `connect(EntryCompletion.MatchSelected handler)` Hook up the `EntryCompletion.MatchSelected` handler.
    `void` | `deleteAction(int index)` Delete the item at the position in the action item list specified by `index`.
    `boolean` | `emitMatchSelected(TreeIter row)` Force the `EntryCompletion.MatchSelected` signal to be emitted.
    `String` | `getCompletionPrefix()` Get the original text entered that triggered the completion or `null` if there is no completion.
    `Entry` | `getEntry()` Retrieve the Entry that this EntryCompletion is attached to.
    `boolean` | `getInlineCompletion()` Has automatic inline completion been enabled?
    `boolean` | `getInlineSelection()` Return `true` if inline-selection mode is turned on.
    `int` | `getMinimumKeyLength()` Return the minimum key length set for the entry completion.
    `TreeModel` | `getModel()` Get the TreeModel currently providing the data powering this EntryCompletion, or `null` if not yet set.
    `boolean` | `getPopupCompletion()` Return `true` if automatic completion popup is enabled.
    `boolean` | `getPopupSetWidth()` Return `true` if completion popup resize is enabled.
    `boolean` | `getPopupSingleMatch()` Return `true` if completion popup appears when there is a single match.
    `void` | `insertActionMarkup(int index, String markup)` Insert an action item in the action item list of the EntryCompletion at the position specified by `index` with the markup specified by `markup`.
    `void` | `insertActionText(int index, String text)` Insert an action in the action item list of the EntryCompletion at the position specified by `index` with the text specified by `text`.
    `void` | `insertPrefix()` Request a prefix insertion.
    `void` | `setInlineCompletion(boolean setting)` Enable or disable the automatic inline completion.
    `void` | `setInlineSelection(boolean setting)` Enable or disable the possibility of cycle through the possible completions inside the entry.
    `void` | `setMatchCallback(EntryCompletion.Match callback)` Hookup the `EntryCompletion.Match` callback that will be used to determine if a row of the associated TreeModel should be in the completion list.
    `void` | `setMinimumKeyLength(int length)` Set the minimum length of the search key to the value specified by `length`.
    `void` | `setModel(TreeModel store)` Set the TreeModel being used to source data for this EntryCompletion.
    `void` | `setPopupCompletion(boolean setting)` Enable or disable completion popup.
    `void` | `setPopupSetWidth(boolean setting)` Enable or disable the completion popup resize.
    `void` | `setPopupSingleMatch(boolean setting)` Enable or disable the popup when there is only a single match.
    `void` | `setTextColumn(DataColumn column)` Create and adds a `CellRendererText` using the specified DataColumn in your TreeModel as the source for completion strings

    - ### Methods inherited from class org.freedesktop.bindings.Pointer

      `toString`

    - ### Methods inherited from class Object

      `equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### EntryCompletion

          public EntryCompletion()

      Create a new EntryCompletion.
      Since:
        4.0.12

  - ### Method Detail

    - #### complete

          public void complete()

      Refilter the current list of completions based on the current key. Be aware that this method will not put the completion in the Entry; this is just a command to update completion popup.

      If you are looking to duplicate the effect of a line in the completion list being selected by the user see `emitMatchSelected()` instead.

      Since:
        4.0.12

    - #### connect

          public void connect(EntryCompletion.ActionActivated handler)

      Hook up the `EntryCompletion.ActionActivated` handler.
      Since:
        4.0.12

    - #### connect

          public void connect(EntryCompletion.CursorOnMatch handler)

      Hook up the `EntryCompletion.CursorOnMatch` handler.
      Since:
        4.0.12

    - #### connect

          public void connect(EntryCompletion.InsertPrefix handler)

      Hook up the `EntryCompletion.InsertPrefix` handler.
      Since:
        4.0.12

    - #### connect

          public void connect(EntryCompletion.MatchSelected handler)

      Hook up the `EntryCompletion.MatchSelected` handler.
      Since:
        4.0.12

    - #### deleteAction

          public void deleteAction(int index)

      Delete the item at the position in the action item list specified by `index`.
      Since:
        4.0.12

    - #### emitMatchSelected

          public boolean emitMatchSelected(TreeIter row)

      Force the `EntryCompletion.MatchSelected` signal to be emitted. This action will result in the completion of the associated Entry using the completion string pointed at by the given TreeIter.
      Since:
        4.0.12

    - #### getCompletionPrefix

          public String getCompletionPrefix()

      Get the original text entered that triggered the completion or `null` if there is no completion.
      Since:
        4.0.12

    - #### getEntry

          public Entry getEntry()

      Retrieve the Entry that this EntryCompletion is attached to.
      Since:
        4.0.12

    - #### getInlineCompletion

          public boolean getInlineCompletion()

      Has automatic inline completion been enabled?
      Since:
        4.0.12

    - #### getInlineSelection

          public boolean getInlineSelection()

      Return `true` if inline-selection mode is turned on.
      Since:
        4.0.12

    - #### getMinimumKeyLength

          public int getMinimumKeyLength()

      Return the minimum key length set for the entry completion. See `setMinimumKeyLength()` for more information.
      Since:
        4.0.12

    - #### getModel

          public TreeModel getModel()

      Get the TreeModel currently providing the data powering this EntryCompletion, or `null` if not yet set.
      Since:
        4.0.12

    - #### getPopupCompletion

          public boolean getPopupCompletion()

      Return `true` if automatic completion popup is enabled.
      Since:
        4.0.12

    - #### getPopupSetWidth

          public boolean getPopupSetWidth()

      Return `true` if completion popup resize is enabled.
      Since:
        4.0.12

    - #### getPopupSingleMatch

          public boolean getPopupSingleMatch()

      Return `true` if completion popup appears when there is a single match.
      Since:
        4.0.12

    - #### insertActionMarkup

          public void insertActionMarkup(int index,
                                String markup)

      Insert an action item in the action item list of the EntryCompletion at the position specified by `index` with the markup specified by `markup`.
      Since:
        4.0.12

    - #### insertActionText

          public void insertActionText(int index,
                              String text)

      Insert an action in the action item list of the EntryCompletion at the position specified by `index` with the text specified by `text`.

      If you want the action item to have markup, use `insertActionMarkup()` instead.

      Since:
        4.0.12

    - #### insertPrefix

          public void insertPrefix()

      Request a prefix insertion. The prefix is the string that will trigger the completion. For example, the prefix for "Alice" and "Albert" is "Al".
      Since:
        4.0.12

    - #### setInlineCompletion

          public void setInlineCompletion(boolean setting)

      Enable or disable the automatic inline completion.

      If `setting` is `true`, the common prefix of the possible completions will be automatically inserted in the Entry.

      The default is `false`.

      Since:
        4.0.12

    - #### setInlineSelection

          public void setInlineSelection(boolean setting)

      Enable or disable the possibility of cycle through the possible completions inside the entry.

      This is ordinarily unset.

      Since:
        4.0.12

    - #### setMatchCallback

          public void setMatchCallback(EntryCompletion.Match callback)

      Hookup the `EntryCompletion.Match` callback that will be used to determine if a row of the associated TreeModel should be in the completion list.
      Since:
        4.0.12

    - #### setMinimumKeyLength

          public void setMinimumKeyLength(int length)

      Set the minimum length of the search key to the value specified by `length`. This means that the key string (which is in the Entry) must be at least length characters before a completion list will be displayed.

      This is useful for long lists, where completing using a small key will take too much time and will return a too large dataset.

      Since:
        4.0.12

    - #### setModel

          public void setModel(TreeModel store)

      Set the TreeModel being used to source data for this EntryCompletion. If a model has already been set, calling this will replace it.
      Parameters:
        `store` - a value of `null` will remove the data model underlying this EntryCompletion, leaving it unset for the present.
      Since:
        4.0.12

    - #### setPopupCompletion

          public void setPopupCompletion(boolean setting)

      Enable or disable completion popup.

      The default is `true`, which is that completions will be presented in a popup window.

      Since:
        4.0.12

    - #### setPopupSetWidth

          public void setPopupSetWidth(boolean setting)

      Enable or disable the completion popup resize.

      If `setting` is `true` the popup window will be resized according to the completion width.

      Since:
        4.0.12

    - #### setPopupSingleMatch

          public void setPopupSingleMatch(boolean setting)

      Enable or disable the popup when there is only a single match.

      If `setting` is `true` the popup will appear even if there is a single match. The default is that this is the case.

      Since:
        4.0.12

    - #### setTextColumn

          public void setTextColumn(DataColumn column)

      Create and adds a `CellRendererText` using the specified DataColumn in your TreeModel as the source for completion strings
      Since:
        4.0.12