Package org.fife.rsta.ac
Class ShorthandCompletionCache
- java.lang.Object
-
- org.fife.rsta.ac.ShorthandCompletionCache
-
- Direct Known Subclasses:
JavaScriptShorthandCompletionCache,JavaShorthandCompletionCache
public class ShorthandCompletionCache extends java.lang.ObjectA cache to store completions for Template completions and Comment completions. Template completions should extendTemplateCompletionthat 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>commentCompletionprivate org.fife.ui.autocomplete.AbstractCompletionProvidercommentProviderprivate java.util.List<org.fife.ui.autocomplete.Completion>shorthandCompletionprivate org.fife.ui.autocomplete.AbstractCompletionProvidertemplateProvider
-
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 voidaddCommentCompletion(org.fife.ui.autocomplete.Completion completion)Adds a comment completion to this cache.voidaddShorthandCompletion(org.fife.ui.autocomplete.Completion completion)Adds a shorthand completion to this cache.private static voidaddSorted(java.util.List<org.fife.ui.autocomplete.Completion> list, org.fife.ui.autocomplete.Completion completion)voidclearCache()Removes all completions from this cache.java.util.List<org.fife.ui.autocomplete.Completion>getCommentCompletions()org.fife.ui.autocomplete.AbstractCompletionProvidergetCommentProvider()java.util.List<org.fife.ui.autocomplete.Completion>getShorthandCompletions()org.fife.ui.autocomplete.AbstractCompletionProvidergetTemplateProvider()voidremoveCommentCompletion(org.fife.ui.autocomplete.Completion completion)Removes a specific comment completion from this cache.voidremoveShorthandCompletion(org.fife.ui.autocomplete.Completion completion)Removes a shorthand completion from this cache.
-
-
-
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
-
-
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()
-
-