Class QuickAssistAssistant
- All Implemented Interfaces:
IQuickAssistAssistant
,IQuickAssistAssistantExtension
IQuickAssistAssistant
.- Since:
- 3.2
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
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.void
enableColoredLabels
(boolean isEnabled) Enables the support for colored labels in the proposal popup.final IHandler
getHandler
(String commandId) Returns the handler for the given command identifier.Returns the quick assist processor to be used for the given content type.protected void
hide()
Hides any open pop-ups.void
install
(ISourceViewer sourceViewer) Installs quick assist support on the given source viewer.protected void
Callback to signal this quick assist assistant that the presentation of the possible completions has been stopped.void
removeCompletionListener
(ICompletionListener listener) Removes a completion listener.void
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
setRestoreCompletionProposalSize
(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.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.Shows all possible quick fixes and quick assists at the viewer's cursor position.void
Uninstalls 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:IQuickAssistAssistant
Shows all possible quick fixes and quick assists at the viewer's cursor position.- Specified by:
showPossibleQuickAssists
in interfaceIQuickAssistAssistant
- Returns:
- an optional error message if no proposals can be computed
-
getQuickAssistProcessor
Description copied from interface:IQuickAssistAssistant
Returns the quick assist processor to be used for the given content type.- Specified by:
getQuickAssistProcessor
in interfaceIQuickAssistAssistant
- Returns:
- the quick assist processor or
null
if none exists
-
setQuickAssistProcessor
Description copied from interface:IQuickAssistAssistant
Registers 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:
setQuickAssistProcessor
in interfaceIQuickAssistAssistant
- Parameters:
processor
- the quick assist processor to register, ornull
to remove an existing one
-
canFix
Description copied from interface:IQuickAssistAssistant
Tells 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
true
even though there might be no quick fix.- Specified by:
canFix
in interfaceIQuickAssistAssistant
- Parameters:
annotation
- the annotation- Returns:
true
if the assistant has a fix for the given annotation
-
canAssist
Description copied from interface:IQuickAssistAssistant
Tells whether this assistant has assists for the given invocation context.- Specified by:
canAssist
in interfaceIQuickAssistAssistant
- Parameters:
invocationContext
- the invocation context- Returns:
true
if the assistant has a fix for the given annotation
-
install
Description copied from interface:IQuickAssistAssistant
Installs quick assist support on the given source viewer.Note: This quick assist assistant will only be able to query the invocation context if
sourceViewer
also implementsISourceViewerExtension3
.- Specified by:
install
in interfaceIQuickAssistAssistant
- Parameters:
sourceViewer
- the source viewer on which quick assist will work
-
setInformationControlCreator
Description copied from interface:IQuickAssistAssistant
Sets the information control creator for the additional information control.- Specified by:
setInformationControlCreator
in interfaceIQuickAssistAssistant
- Parameters:
creator
- the information control creator for the additional information control
-
uninstall
public void uninstall()Description copied from interface:IQuickAssistAssistant
Uninstalls quick assist support from the source viewer it has previously be installed on.- Specified by:
uninstall
in interfaceIQuickAssistAssistant
-
setProposalSelectorBackground
Description copied from interface:IQuickAssistAssistant
Sets 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:
setProposalSelectorBackground
in interfaceIQuickAssistAssistant
- Parameters:
background
- the background color
-
setProposalSelectorForeground
Description copied from interface:IQuickAssistAssistant
Sets 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:
setProposalSelectorForeground
in 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:IQuickAssistAssistant
Adds a completion listener that will be informed before proposals are computed.- Specified by:
addCompletionListener
in interfaceIQuickAssistAssistant
- Parameters:
listener
- the listener
-
removeCompletionListener
Description copied from interface:IQuickAssistAssistant
Removes a completion listener.- Specified by:
removeCompletionListener
in interfaceIQuickAssistAssistant
- Parameters:
listener
- the listener to remove
-
setStatusLineVisible
public void setStatusLineVisible(boolean show) Description copied from interface:IQuickAssistAssistant
Enables 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:
setStatusLineVisible
in interfaceIQuickAssistAssistant
- Parameters:
show
-true
to show a message line,false
to not show one.
-
setStatusMessage
Description copied from interface:IQuickAssistAssistant
Sets the caption message displayed at the bottom of the completion proposal popup.- Specified by:
setStatusMessage
in 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:
getHandler
in 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
ICompletionProposalExtension6
to provide colored proposal labels.- Specified by:
enableColoredLabels
in interfaceIQuickAssistAssistantExtension
- Parameters:
isEnabled
- iftrue
the support for colored labels is enabled in the proposal popup- Since:
- 3.4
-