java.lang.Object
de.grogra.pf.ui.autocomplete.impl.AbstractAutoCompletor
de.grogra.autocompletors.RoundRobinAutoCompletion
An
AutoCompletion that adds the ability to cycle through a set
of CompletionProviders 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 de.grogra.pf.ui.autocomplete.impl.AbstractAutoCompletor
AbstractAutoCompletor.AutoCompleteAction -
Field Summary
Fields inherited from class de.grogra.pf.ui.autocomplete.impl.AbstractAutoCompletor
cc, ICON_CLASS, ICON_FIELD, ICON_INTERFACE, ICON_METHOD, ICON_PACKAGE, ICON_RGG_CLASS, ICON_RGG_FIELD, ICON_RGG_INTERFACE, ICON_RGG_METHOD, ICON_RGG_MODULE, ICON_RGG_STATIC_FIELD, ICON_RGG_STATIC_METHOD, ICON_STATIC_FIELD, ICON_STATIC_METHOD, name -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCompletionProvider(CompletionProvider provider) Adds an additionalCompletionProviderto the list to cycle through.booleanMoves to the next Provider internally.protected ActionOverridden to provide our own implementation of the action.protected CompletionContextprotected CompletionProviderprotected voidInstall or uninstall hooks to listen to the project compilation and loadvoidResets the cycle to use the default provider on next refresh.protected voidMethods inherited from class de.grogra.pf.ui.autocomplete.impl.AbstractAutoCompletor
addAutoCompletionListener, doCompletion, fireAutoCompletionEvent, getAutoActivationDelay, getAutoCompleteSingleChoices, getCompletionContext, getCompletionProvider, getDefaultTriggerKey, getDescWindowColor, getExternalURLHandler, getLinkRedirector, getListCellRenderer, getParamChoicesRenderer, getParameterDescriptionTruncateThreshold, getReplacementText, getShowDescWindow, getStyleContext, getTextComponent, getTriggerKey, getUniqueName, hideChildWindows, hidePopupWindow, initProvider, 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
-
Constructor Details
-
RoundRobinAutoCompletion
public RoundRobinAutoCompletion()Constructor.- Parameters:
provider- A single completion provider.- See Also:
-
-
Method Details
-
addCompletionProvider
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
Overridden to provide our own implementation of the action.- Overrides:
createAutoCompleteActionin classAbstractAutoCompletor- Returns:
- The action to use.
- See Also:
-
resetProvider
public void resetProvider()Resets the cycle to use the default provider on next refresh. -
createProvider
- Specified by:
createProviderin classAbstractAutoCompletor
-
createCompletionContext
protected CompletionContext createCompletionContext(AutoCompletableTextArea tc, RegistryContext reg) - Specified by:
createCompletionContextin classAbstractAutoCompletor
-
installHooks
protected void installHooks()Description copied from class:AbstractAutoCompletorInstall or uninstall hooks to listen to the project compilation and load- Specified by:
installHooksin classAbstractAutoCompletor
-
uninstallHooks
protected void uninstallHooks()- Specified by:
uninstallHooksin classAbstractAutoCompletor
-