Class FilenameCompleter

All Implemented Interfaces:
Proxy

@Generated("org.javagi.JavaGI") public class FilenameCompleter extends GObject
Completes partial file and directory names given a partial string by looking in the file system for clues. Can return a list of possible completion strings for widget implementations.
  • Constructor Details

    • FilenameCompleter

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

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

    • getType

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

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

      protected FilenameCompleter 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 GObject
      Returns:
      the instance as if it were its parent type
    • getCompletionSuffix

      public @Nullable String getCompletionSuffix(String initialText)

      Obtains a suffix completion for initialText from completer.

      Suffix will be an empty string if there's no shared suffix among matching completions. If there's no matching completions anyway, NULL is returned.

      Parameters:
      initialText - text to be completed.
      Returns:
      a suffix completion string, or NULL if no completion exists.
    • getCompletions

      public String[] getCompletions(String initialText)
      Gets an array of completion strings for a given initial text.
      Parameters:
      initialText - text to be completed.
      Returns:
      array of strings with possible completions for initialText. This array must be freed by g_strfreev() when finished.
    • setDirsOnly

      public void setDirsOnly(boolean dirsOnly)

      If dirsOnly is true, this FilenameCompleter will only complete directory names, and not file names.

      This function needs to be called before waiting for results from the completer to be populated.

      Parameters:
      dirsOnly - a gboolean.
    • gotCompletionData

      protected void gotCompletionData()
    • onGotCompletionData

      Emitted when the file name completion information comes available.
      Parameters:
      handler - the signal handler
      Returns:
      a signal handler ID to keep track of the signal connection
      See Also:
    • emitGotCompletionData

      public void emitGotCompletionData()
      Emits the "got-completion-data" signal. See onGotCompletionData(FilenameCompleter.GotCompletionDataCallback).
    • builder

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