Class RoundRobinAutoCompletion

java.lang.Object
org.fife.ui.autocomplete.AutoCompletion
org.fife.ui.autocomplete.RoundRobinAutoCompletion

public class RoundRobinAutoCompletion extends AutoCompletion
An AutoCompletion that adds the ability to cycle through a set of CompletionProviders via the trigger key. This allows the application to logically "group together" completions of similar kinds; for example, Java code completions vs. template completions.

Usage:

 XPathDynamicCompletionProvider dynamicProvider = new XPathDynamicCompletionProvider();
 RoundRobinAutoCompletion ac = new RoundRobinAutoCompletion(dynamicProvider);
 XPathCompletionProvider staticProvider = new XPathCompletionProvider();
 ac.addCompletionProvider(staticProvider);
 ac.setXXX(..);
 ...
 ac.install(textArea);
 
  • Field Details

  • Constructor Details

  • Method Details

    • addCompletionProvider

      public void addCompletionProvider(CompletionProvider provider)
      Adds an additional CompletionProvider to the list to cycle through.
      Parameters:
      provider - The new completion provider.
    • advanceProvider

      public boolean advanceProvider()
      Moves to the next Provider internally. Needs refresh of the popup window to display the changes.
      Returns:
      true if the next provider was the default one (thus returned to the default view). May be used in case you like to hide the popup in this case.
    • createAutoCompleteAction

      protected Action createAutoCompleteAction()
      Overridden to provide our own implementation of the action.
      Overrides:
      createAutoCompleteAction in class AutoCompletion
      Returns:
      The action to use.
      See Also:
    • resetProvider

      public void resetProvider()
      Resets the cycle to use the default provider on next refresh.