Interface ITabProvider

All Known Implementing Classes:
AbstractTabProvider, BifTabProvider, ComponentTabProvider

public interface ITabProvider
Interface for providing tab completion suggestions. Tab providers analyze the current input context and return completion suggestions when appropriate. Multiple providers can be registered with a console to provide completions for different contexts (e.g., components, functions, variables, etc.).

Usage Example:

 TabProvider componentProvider = new ComponentTabProvider();
 console.registerTabProvider( componentProvider );
 
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    canProvideCompletions(String input, int cursorPosition)
    Determines if this provider should handle tab completion for the given input context.
    getCompletions(String input, int cursorPosition)
    Provides completion suggestions for the given input context.
    default int
    Returns the priority of this provider (higher numbers = higher priority).
    default String
    Returns a descriptive name for this tab provider (for debugging/logging).
  • Method Details

    • canProvideCompletions

      boolean canProvideCompletions(String input, int cursorPosition)
      Determines if this provider should handle tab completion for the given input context.
      Parameters:
      input - The current input line
      cursorPosition - The position of the cursor in the input (0-based)
      Returns:
      true if this provider can provide completions for this context
    • getCompletions

      List<TabCompletion> getCompletions(String input, int cursorPosition)
      Provides completion suggestions for the given input context.
      Parameters:
      input - The current input line
      cursorPosition - The position of the cursor in the input (0-based)
      Returns:
      A list of completion suggestions, or empty list if none available
    • getProviderName

      default String getProviderName()
      Returns a descriptive name for this tab provider (for debugging/logging).
      Returns:
      The provider name
    • getPriority

      default int getPriority()
      Returns the priority of this provider (higher numbers = higher priority). When multiple providers can handle the same input, the one with highest priority is used.
      Returns:
      Priority value (default: 100)