Package org.fife.ui.autocomplete
Class RoundRobinAutoCompletion
- java.lang.Object
-
- org.fife.ui.autocomplete.AutoCompletion
-
- org.fife.ui.autocomplete.RoundRobinAutoCompletion
-
public class RoundRobinAutoCompletion extends AutoCompletion
AnAutoCompletionthat adds the ability to cycle through a set ofCompletionProviders 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);
- Author:
- mschlegel
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.fife.ui.autocomplete.AutoCompletion
AutoCompletion.AutoCompleteAction
-
-
Constructor Summary
Constructors Constructor Description RoundRobinAutoCompletion(CompletionProvider provider)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddCompletionProvider(CompletionProvider provider)Adds an additionalCompletionProviderto the list to cycle through.booleanadvanceProvider()Moves to the next Provider internally.protected ActioncreateAutoCompleteAction()Overridden to provide our own implementation of the action.voidresetProvider()Resets the cycle to use the default provider on next refresh.-
Methods inherited from class org.fife.ui.autocomplete.AutoCompletion
addAutoCompletionListener, doCompletion, fireAutoCompletionEvent, getAutoActivationDelay, getAutoCompleteSingleChoices, getCompletionProvider, getDefaultTriggerKey, getExternalURLHandler, getLinkRedirector, getListCellRenderer, getParamChoicesRenderer, getReplacementText, getShowDescWindow, getStyleContext, getTextComponent, getTriggerKey, hideChildWindows, hidePopupWindow, insertCompletion, insertCompletion, install, isAutoActivationEnabled, isAutoCompleteEnabled, isHideOnCompletionProviderChange, isHideOnNoText, isParameterAssistanceEnabled, isPopupVisible, refreshPopupWindow, removeAutoCompletionListener, setAutoActivationDelay, setAutoActivationEnabled, setAutoCompleteEnabled, setAutoCompleteSingleChoices, setChoicesWindowSize, setCompletionProvider, setDescriptionWindowSize, setExternalURLHandler, setHideOnCompletionProviderChange, setHideOnNoText, setLinkRedirector, setListCellRenderer, setParamChoicesRenderer, setParameterAssistanceEnabled, setPopupVisible, setShowDescWindow, setTriggerKey, uninstall
-
-
-
-
Constructor Detail
-
RoundRobinAutoCompletion
public RoundRobinAutoCompletion(CompletionProvider provider)
Constructor.- Parameters:
provider- A single completion provider.- See Also:
addCompletionProvider(CompletionProvider)
-
-
Method Detail
-
addCompletionProvider
public void addCompletionProvider(CompletionProvider provider)
Adds an additionalCompletionProviderto 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:
createAutoCompleteActionin classAutoCompletion- Returns:
- The action to use.
- See Also:
AutoCompletion.AutoCompleteAction
-
resetProvider
public void resetProvider()
Resets the cycle to use the default provider on next refresh.
-
-