Class ShorthandCompletionCache

  • Direct Known Subclasses:
    JavaScriptShorthandCompletionCache, JavaShorthandCompletionCache

    public class ShorthandCompletionCache
    extends java.lang.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 Summary

      Fields 
      Modifier and Type Field Description
      private java.util.List<org.fife.ui.autocomplete.Completion> commentCompletion  
      private org.fife.ui.autocomplete.AbstractCompletionProvider commentProvider  
      private java.util.List<org.fife.ui.autocomplete.Completion> shorthandCompletion  
      private org.fife.ui.autocomplete.AbstractCompletionProvider templateProvider  
    • Constructor Summary

      Constructors 
      Constructor Description
      ShorthandCompletionCache​(org.fife.ui.autocomplete.AbstractCompletionProvider templateProvider, org.fife.ui.autocomplete.AbstractCompletionProvider commentProvider)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addCommentCompletion​(org.fife.ui.autocomplete.Completion completion)
      Adds a comment completion to this cache.
      void addShorthandCompletion​(org.fife.ui.autocomplete.Completion completion)
      Adds a shorthand completion to this cache.
      private static void addSorted​(java.util.List<org.fife.ui.autocomplete.Completion> list, org.fife.ui.autocomplete.Completion completion)  
      void clearCache()
      Removes all completions from this cache.
      java.util.List<org.fife.ui.autocomplete.Completion> getCommentCompletions()  
      org.fife.ui.autocomplete.AbstractCompletionProvider getCommentProvider()  
      java.util.List<org.fife.ui.autocomplete.Completion> getShorthandCompletions()  
      org.fife.ui.autocomplete.AbstractCompletionProvider getTemplateProvider()  
      void removeCommentCompletion​(org.fife.ui.autocomplete.Completion completion)
      Removes a specific comment completion from this cache.
      void removeShorthandCompletion​(org.fife.ui.autocomplete.Completion completion)
      Removes a shorthand completion from this cache.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • shorthandCompletion

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

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

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

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

      • ShorthandCompletionCache

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

      • 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:
        removeShorthandCompletion(Completion)
      • addSorted

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

        public java.util.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:
        addShorthandCompletion(Completion)
      • 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:
        removeCommentCompletion(Completion)
      • getCommentCompletions

        public java.util.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:
        addCommentCompletion(Completion)
      • getTemplateProvider

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

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