public interface IQuickAssistAssistant
IQuickAssistAssistant
provides support for quick fixes and quick
assists.
The quick assist assistant is a ISourceViewer
add-on. Its
purpose is to propose, display, and insert quick assists and quick fixes
available at the current source viewer's quick assist invocation context.
The quick assist assistant can be configured with a IQuickAssistProcessor
which provides the possible quick assist and quick fix completions.
IQuickAssistAssistant
, extension interfaces are used to
provide a means of evolution. The following extension interfaces exist:
IQuickAssistAssistantExtension
since version 3.4 introducing the
following function:
The interface can be implemented by clients. By default, clients use
QuickAssistAssistant
as the standard
implementer of this interface.
ISourceViewer
,
IQuickAssistProcessor
,
IQuickAssistAssistantExtension
Modifier and Type | Method and Description |
---|---|
void |
addCompletionListener(ICompletionListener listener)
Adds a completion listener that will be informed before proposals are computed.
|
boolean |
canAssist(IQuickAssistInvocationContext invocationContext)
Tells whether this assistant has assists for the given invocation context.
|
boolean |
canFix(Annotation annotation)
Tells whether this assistant has a fix for the given annotation.
|
IQuickAssistProcessor |
getQuickAssistProcessor()
Returns the quick assist processor to be used for the given content type.
|
void |
install(ISourceViewer sourceViewer)
Installs quick assist support on the given source viewer.
|
void |
removeCompletionListener(ICompletionListener listener)
Removes a completion listener.
|
void |
setInformationControlCreator(IInformationControlCreator creator)
Sets the information control creator for the additional information control.
|
void |
setProposalSelectorBackground(Color background)
Sets the proposal selector's background color.
|
void |
setProposalSelectorForeground(Color foreground)
Sets the proposal's foreground color.
|
void |
setQuickAssistProcessor(IQuickAssistProcessor processor)
Registers a given quick assist processor for a particular content type.
|
void |
setStatusLineVisible(boolean show)
Enables displaying a status line below the proposal popup.
|
void |
setStatusMessage(String message)
Sets the caption message displayed at the bottom of the completion proposal popup.
|
String |
showPossibleQuickAssists()
Shows all possible quick fixes and quick assists at the viewer's cursor position.
|
void |
uninstall()
Uninstalls quick assist support from the source viewer it has
previously be installed on.
|
void install(ISourceViewer sourceViewer)
Note: This quick assist assistant will only be able to query the invocation context
if sourceViewer
also implements ISourceViewerExtension3
.
sourceViewer
- the source viewer on which quick assist will workvoid setInformationControlCreator(IInformationControlCreator creator)
creator
- the information control creator for the additional information controlvoid uninstall()
String showPossibleQuickAssists()
void setQuickAssistProcessor(IQuickAssistProcessor processor)
processor
- the quick assist processor to register, or null
to remove
an existing oneIQuickAssistProcessor getQuickAssistProcessor()
null
if none existsboolean canFix(Annotation annotation)
Note: This test must be fast and optimistic i.e. it is OK to return
true
even though there might be no quick fix.
annotation
- the annotationtrue
if the assistant has a fix for the given annotationboolean canAssist(IQuickAssistInvocationContext invocationContext)
invocationContext
- the invocation contexttrue
if the assistant has a fix for the given annotationvoid setProposalSelectorBackground(Color background)
Note: As of 3.4, you should only call this
method if you want to override the JFacePreferences.CONTENT_ASSIST_BACKGROUND_COLOR
.
background
- the background colorvoid setProposalSelectorForeground(Color foreground)
Note: As of 3.4, you should only call this
method if you want to override the JFacePreferences.CONTENT_ASSIST_FOREGROUND_COLOR
.
foreground
- the foreground colorvoid addCompletionListener(ICompletionListener listener)
listener
- the listenervoid removeCompletionListener(ICompletionListener listener)
listener
- the listener to removevoid setStatusLineVisible(boolean show)
setStatusMessage(String)
.show
- true
to show a message line, false
to not show one.void setStatusMessage(String message)
message
- the message
Copyright (c) 2000, 2018 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.