Class ShorthandCompletionCache

java.lang.Object
org.fife.rsta.ac.ShorthandCompletionCache
Direct Known Subclasses:
JavaScriptShorthandCompletionCache, JavaShorthandCompletionCache

public class ShorthandCompletionCache extends Object
A cache to store completions for Template completions and Comment completions. Template completions should extend TemplateCompletion that uses parameterized variables/values.

While template completion example:

 while --> while(condition) {
              //cursor here
           }
 
Comment completion example:
 null --> <code>null</code>
 
This is really a convenient place to store these types of completions that are re-used.
  • Field Details

    • shorthandCompletion

      private List<org.fife.ui.autocomplete.Completion> shorthandCompletion
    • commentCompletion

      private List<org.fife.ui.autocomplete.Completion> commentCompletion
    • templateProvider

      private org.fife.ui.autocomplete.AbstractCompletionProvider templateProvider
    • commentProvider

      private org.fife.ui.autocomplete.AbstractCompletionProvider commentProvider
  • Constructor Details

    • ShorthandCompletionCache

      public ShorthandCompletionCache(org.fife.ui.autocomplete.AbstractCompletionProvider templateProvider, org.fife.ui.autocomplete.AbstractCompletionProvider commentProvider)
  • Method Details

    • addShorthandCompletion

      public void addShorthandCompletion(org.fife.ui.autocomplete.Completion completion)
      Adds a shorthand completion to this cache.
      Parameters:
      completion - The completion to add.
      See Also:
    • addSorted

      private static void addSorted(List<org.fife.ui.autocomplete.Completion> list, org.fife.ui.autocomplete.Completion completion)
    • getShorthandCompletions

      public List<org.fife.ui.autocomplete.Completion> getShorthandCompletions()
    • removeShorthandCompletion

      public void removeShorthandCompletion(org.fife.ui.autocomplete.Completion completion)
      Removes a shorthand completion from this cache.
      Parameters:
      completion - The completion to remove.
      See Also:
    • clearCache

      public void clearCache()
      Removes all completions from this cache.
    • addCommentCompletion

      public void addCommentCompletion(org.fife.ui.autocomplete.Completion completion)
      Adds a comment completion to this cache.
      Parameters:
      completion - The completion to add.
      See Also:
    • getCommentCompletions

      public List<org.fife.ui.autocomplete.Completion> getCommentCompletions()
    • removeCommentCompletion

      public void removeCommentCompletion(org.fife.ui.autocomplete.Completion completion)
      Removes a specific comment completion from this cache.
      Parameters:
      completion - The completion to remove.
      See Also:
    • getTemplateProvider

      public org.fife.ui.autocomplete.AbstractCompletionProvider getTemplateProvider()
    • getCommentProvider

      public org.fife.ui.autocomplete.AbstractCompletionProvider getCommentProvider()