Package org.fife.ui.autocomplete
Class RoundRobinAutoCompletion
java.lang.Object
org.fife.ui.autocomplete.AutoCompletion
org.fife.ui.autocomplete.RoundRobinAutoCompletion
An
AutoCompletion
that adds the ability to cycle through a set
of CompletionProvider
s 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);
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate class
An implementation of the auto-complete action that ensures the properCompletionProvider
is displayed based on the context in which the user presses the trigger key.Nested classes/interfaces inherited from class org.fife.ui.autocomplete.AutoCompletion
AutoCompletion.AutoCompleteAction
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate List
<CompletionProvider> The List of CompletionProviders to use. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addCompletionProvider
(CompletionProvider provider) Adds an additionalCompletionProvider
to the list to cycle through.boolean
Moves to the next Provider internally.protected Action
Overridden to provide our own implementation of the action.void
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, getDebug, getDefaultTriggerKey, getDescWindowColor, getExternalURLHandler, getLineOfCaret, getLinkRedirector, getListCellRenderer, getParamChoicesRenderer, getParameterDescriptionTruncateThreshold, getReplacementText, getShowDescWindow, getStyleContext, getTextComponent, getTextComponentOrientation, getTriggerKey, hideChildWindows, hidePopupWindow, insertCompletion, insertCompletion, install, isAutoActivationEnabled, isAutoCompleteEnabled, isHideOnCompletionProviderChange, isHideOnNoText, isParameterAssistanceEnabled, isPopupVisible, refreshPopupWindow, removeAutoCompletionListener, setAutoActivationDelay, setAutoActivationEnabled, setAutoCompleteEnabled, setAutoCompleteSingleChoices, setChoicesWindowSize, setCompletionProvider, setDescriptionWindowColor, setDescriptionWindowSize, setExternalURLHandler, setHideOnCompletionProviderChange, setHideOnNoText, setLinkRedirector, setListCellRenderer, setParamChoicesRenderer, setParameterAssistanceEnabled, setParameterDescriptionTruncateThreshold, setPopupVisible, setShowDescWindow, setTriggerKey, uninstall
-
Field Details
-
cycle
The List of CompletionProviders to use.
-
-
Constructor Details
-
RoundRobinAutoCompletion
Constructor.- Parameters:
provider
- A single completion provider.- See Also:
-
-
Method Details
-
addCompletionProvider
Adds an additionalCompletionProvider
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.
-
createAutoCompleteAction
Overridden to provide our own implementation of the action.- Overrides:
createAutoCompleteAction
in classAutoCompletion
- Returns:
- The action to use.
- See Also:
-
resetProvider
public void resetProvider()Resets the cycle to use the default provider on next refresh.
-