Class 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 Detail

      • cycle

        private java.util.List<CompletionProvider> cycle
        The List of CompletionProviders to use.
    • Method Detail

      • 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.
      • resetProvider

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