Eclipse Platform
Release 3.2

org.eclipse.jface.text.quickassist
Class QuickAssistAssistant

java.lang.Object
  extended byorg.eclipse.jface.text.quickassist.QuickAssistAssistant
All Implemented Interfaces:
IQuickAssistAssistant

public class QuickAssistAssistant
extends Object
implements IQuickAssistAssistant

Default implementation of IQuickAssistAssistant.

Since:
3.2

Constructor Summary
QuickAssistAssistant()
           
 
Method Summary
 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.
protected  void possibleCompletionsClosed()
          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 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QuickAssistAssistant

public QuickAssistAssistant()
Method Detail

showPossibleQuickAssists

public String showPossibleQuickAssists()
Description copied from interface: IQuickAssistAssistant
Shows all possible quick fixes and quick assists at the viewer's cursor position.

Specified by:
showPossibleQuickAssists in interface IQuickAssistAssistant
Returns:
an optional error message if no proposals can be computed

getQuickAssistProcessor

public IQuickAssistProcessor getQuickAssistProcessor()
Description copied from interface: IQuickAssistAssistant
Returns the quick assist processor to be used for the given content type.

Specified by:
getQuickAssistProcessor in interface IQuickAssistAssistant
Returns:
the quick assist processor or null if none exists

setQuickAssistProcessor

public void setQuickAssistProcessor(IQuickAssistProcessor processor)
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 interface IQuickAssistAssistant
Parameters:
processor - the quick assist processor to register, or null to remove an existing one

canFix

public boolean canFix(Annotation annotation)
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 interface IQuickAssistAssistant
Parameters:
annotation - the annotation
Returns:
true if the assistant has a fix for the given annotation

canAssist

public boolean canAssist(IQuickAssistInvocationContext invocationContext)
Description copied from interface: IQuickAssistAssistant
Tells whether this assistant has assists for the given invocation context.

Specified by:
canAssist in interface IQuickAssistAssistant
Parameters:
invocationContext - the invocation context
Returns:
true if the assistant has a fix for the given annotation

install

public void install(ISourceViewer sourceViewer)
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 implements ISourceViewerExtension3.

Specified by:
install in interface IQuickAssistAssistant
Parameters:
sourceViewer - the source viewer on which quick assist will work

setInformationControlCreator

public void setInformationControlCreator(IInformationControlCreator creator)
Description copied from interface: IQuickAssistAssistant
Sets the information control creator for the additional information control.

Specified by:
setInformationControlCreator in interface IQuickAssistAssistant
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 interface IQuickAssistAssistant

setProposalSelectorBackground

public void setProposalSelectorBackground(Color background)
Sets the proposal selector's background color.

Specified by:
setProposalSelectorBackground in interface IQuickAssistAssistant
Parameters:
background - the background color

setProposalSelectorForeground

public void setProposalSelectorForeground(Color foreground)
Description copied from interface: IQuickAssistAssistant
Sets the proposal's foreground color.

Specified by:
setProposalSelectorForeground in interface IQuickAssistAssistant
Parameters:
foreground - the foreground color

possibleCompletionsClosed

protected void possibleCompletionsClosed()
Callback to signal this quick assist assistant that the presentation of the possible completions has been stopped.


addCompletionListener

public void addCompletionListener(ICompletionListener listener)
Description copied from interface: IQuickAssistAssistant
Adds a completion listener that will be informed before proposals are computed.

Specified by:
addCompletionListener in interface IQuickAssistAssistant
Parameters:
listener - the listener

removeCompletionListener

public void removeCompletionListener(ICompletionListener listener)
Description copied from interface: IQuickAssistAssistant
Removes a completion listener.

Specified by:
removeCompletionListener in interface IQuickAssistAssistant
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 via IQuickAssistAssistant.setStatusMessage(String).

Specified by:
setStatusLineVisible in interface IQuickAssistAssistant
Parameters:
show - true to show a message line, false to not show one.

setStatusMessage

public void setStatusMessage(String message)
Description copied from interface: IQuickAssistAssistant
Sets the caption message displayed at the bottom of the completion proposal popup.

Specified by:
setStatusMessage in interface IQuickAssistAssistant
Parameters:
message - the message

Eclipse Platform
Release 3.2

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp. and others 2000, 2006. All rights reserved.