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 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);
- 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 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.protected CompletionContext
protected CompletionProvider
protected void
Install or uninstall hooks to listen to the project compilation and loadvoid
Resets the cycle to use the default provider on next refresh.protected void
Methods 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 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 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:
createProvider
in classAbstractAutoCompletor
-
createCompletionContext
protected CompletionContext createCompletionContext(AutoCompletableTextArea tc, RegistryContext reg) - Specified by:
createCompletionContext
in classAbstractAutoCompletor
-
installHooks
protected void installHooks()Description copied from class:AbstractAutoCompletor
Install or uninstall hooks to listen to the project compilation and load- Specified by:
installHooks
in classAbstractAutoCompletor
-
uninstallHooks
protected void uninstallHooks()- Specified by:
uninstallHooks
in classAbstractAutoCompletor
-