Class QuickAssistAssistant
- All Implemented Interfaces:
IQuickAssistAssistant,IQuickAssistAssistantExtension
IQuickAssistAssistant.- Since:
- 3.2
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCompletionListener(ICompletionListener listener) Adds a completion listener that will be informed before proposals are computed.booleancanAssist(IQuickAssistInvocationContext invocationContext) Tells whether this assistant has assists for the given invocation context.booleancanFix(Annotation annotation) Tells whether this assistant has a fix for the given annotation.voidenableColoredLabels(boolean isEnabled) Enables the support for colored labels in the proposal popup.final IHandlergetHandler(String commandId) Returns the handler for the given command identifier.Returns the quick assist processor to be used for the given content type.protected voidhide()Hides any open pop-ups.voidinstall(ISourceViewer sourceViewer) Installs quick assist support on the given source viewer.protected voidCallback to signal this quick assist assistant that the presentation of the possible completions has been stopped.voidremoveCompletionListener(ICompletionListener listener) Removes a completion listener.voidSets the information control creator for the additional information control.voidsetProposalSelectorBackground(Color background) Sets the proposal selector's background color.voidsetProposalSelectorForeground(Color foreground) Sets the proposal's foreground color.voidsetQuickAssistProcessor(IQuickAssistProcessor processor) Registers a given quick assist processor for a particular content type.voidsetRestoreCompletionProposalSize(IDialogSettings dialogSettings) Tells this assistant to open the proposal popup with the size contained in the given dialog settings and to store the control's last valid size in the given dialog settings.voidsetStatusLineVisible(boolean show) Enables displaying a status line below the proposal popup.voidsetStatusMessage(String message) Sets the caption message displayed at the bottom of the completion proposal popup.Shows all possible quick fixes and quick assists at the viewer's cursor position.voidUninstalls quick assist support from the source viewer it has previously be installed on.
-
Constructor Details
-
QuickAssistAssistant
public QuickAssistAssistant()
-
-
Method Details
-
showPossibleQuickAssists
Description copied from interface:IQuickAssistAssistantShows all possible quick fixes and quick assists at the viewer's cursor position.- Specified by:
showPossibleQuickAssistsin interfaceIQuickAssistAssistant- Returns:
- an optional error message if no proposals can be computed
-
getQuickAssistProcessor
Description copied from interface:IQuickAssistAssistantReturns the quick assist processor to be used for the given content type.- Specified by:
getQuickAssistProcessorin interfaceIQuickAssistAssistant- Returns:
- the quick assist processor or
nullif none exists
-
setQuickAssistProcessor
Description copied from interface:IQuickAssistAssistantRegisters a given quick assist processor for a particular content type. If there is already a processor registered, the new processor is registered instead of the old one.- Specified by:
setQuickAssistProcessorin interfaceIQuickAssistAssistant- Parameters:
processor- the quick assist processor to register, ornullto remove an existing one
-
canFix
Description copied from interface:IQuickAssistAssistantTells whether this assistant has a fix for the given annotation.Note: This test must be fast and optimistic i.e. it is OK to return
trueeven though there might be no quick fix.- Specified by:
canFixin interfaceIQuickAssistAssistant- Parameters:
annotation- the annotation- Returns:
trueif the assistant has a fix for the given annotation
-
canAssist
Description copied from interface:IQuickAssistAssistantTells whether this assistant has assists for the given invocation context.- Specified by:
canAssistin interfaceIQuickAssistAssistant- Parameters:
invocationContext- the invocation context- Returns:
trueif the assistant has a fix for the given annotation
-
install
Description copied from interface:IQuickAssistAssistantInstalls quick assist support on the given source viewer.Note: This quick assist assistant will only be able to query the invocation context if
sourceVieweralso implementsISourceViewerExtension3.- Specified by:
installin interfaceIQuickAssistAssistant- Parameters:
sourceViewer- the source viewer on which quick assist will work
-
setInformationControlCreator
Description copied from interface:IQuickAssistAssistantSets the information control creator for the additional information control.- Specified by:
setInformationControlCreatorin interfaceIQuickAssistAssistant- Parameters:
creator- the information control creator for the additional information control
-
uninstall
public void uninstall()Description copied from interface:IQuickAssistAssistantUninstalls quick assist support from the source viewer it has previously be installed on.- Specified by:
uninstallin interfaceIQuickAssistAssistant
-
setProposalSelectorBackground
Description copied from interface:IQuickAssistAssistantSets the proposal selector's background color.Note: As of 3.4, you should only call this method if you want to override the
JFacePreferences.CONTENT_ASSIST_BACKGROUND_COLOR.- Specified by:
setProposalSelectorBackgroundin interfaceIQuickAssistAssistant- Parameters:
background- the background color
-
setProposalSelectorForeground
Description copied from interface:IQuickAssistAssistantSets the proposal's foreground color.Note: As of 3.4, you should only call this method if you want to override the
JFacePreferences.CONTENT_ASSIST_FOREGROUND_COLOR.- Specified by:
setProposalSelectorForegroundin interfaceIQuickAssistAssistant- Parameters:
foreground- the foreground color
-
setRestoreCompletionProposalSize
Tells this assistant to open the proposal popup with the size contained in the given dialog settings and to store the control's last valid size in the given dialog settings.Note: This API is only valid if the information control implements
IInformationControlExtension3. Not following this restriction will later result in anUnsupportedOperationException.The constants used to store the values are:
- Parameters:
dialogSettings- the dialog settings- Since:
- 3.7
-
possibleCompletionsClosed
protected void possibleCompletionsClosed()Callback to signal this quick assist assistant that the presentation of the possible completions has been stopped. -
addCompletionListener
Description copied from interface:IQuickAssistAssistantAdds a completion listener that will be informed before proposals are computed.- Specified by:
addCompletionListenerin interfaceIQuickAssistAssistant- Parameters:
listener- the listener
-
removeCompletionListener
Description copied from interface:IQuickAssistAssistantRemoves a completion listener.- Specified by:
removeCompletionListenerin interfaceIQuickAssistAssistant- Parameters:
listener- the listener to remove
-
setStatusLineVisible
public void setStatusLineVisible(boolean show) Description copied from interface:IQuickAssistAssistantEnables displaying a status line below the proposal popup. The default is not to show the status line. The contents of the status line may be set viaIQuickAssistAssistant.setStatusMessage(String).- Specified by:
setStatusLineVisiblein interfaceIQuickAssistAssistant- Parameters:
show-trueto show a message line,falseto not show one.
-
setStatusMessage
Description copied from interface:IQuickAssistAssistantSets the caption message displayed at the bottom of the completion proposal popup.- Specified by:
setStatusMessagein interfaceIQuickAssistAssistant- Parameters:
message- the message
-
getHandler
Returns the handler for the given command identifier.The same handler instance will be returned when called a more than once with the same command identifier.
- Specified by:
getHandlerin interfaceIQuickAssistAssistantExtension- Parameters:
commandId- the command identifier- Returns:
- the handler for the given command identifier
- Since:
- 3.4
-
hide
protected void hide()Hides any open pop-ups.- Since:
- 3.4
-
enableColoredLabels
public void enableColoredLabels(boolean isEnabled) Enables the support for colored labels in the proposal popup.Completion proposals can implement
ICompletionProposalExtension6to provide colored proposal labels.- Specified by:
enableColoredLabelsin interfaceIQuickAssistAssistantExtension- Parameters:
isEnabled- iftruethe support for colored labels is enabled in the proposal popup- Since:
- 3.4
-