org.eclipse.cdt.internal.ui.text.contentassist
Class ParsingBasedProposalComputer

java.lang.Object
  extended by org.eclipse.cdt.internal.ui.text.contentassist.ParsingBasedProposalComputer
All Implemented Interfaces:
ICompletionProposalComputer
Direct Known Subclasses:
DOMCompletionProposalComputer, HelpCompletionProposalComputer, KeywordCompletionProposalComputer, LegacyCompletionProposalComputer

public abstract class ParsingBasedProposalComputer
extends java.lang.Object
implements ICompletionProposalComputer

The base class for any proposal computers that require a completion node in order to determine its completion proposals.

Author:
Bryan Wilkinson

Constructor Summary
ParsingBasedProposalComputer()
           
 
Method Summary
 java.util.List computeCompletionProposals(ContentAssistInvocationContext context, org.eclipse.core.runtime.IProgressMonitor monitor)
          Returns a list of completion proposals valid at the given invocation context.
 java.util.List computeContextInformation(ContentAssistInvocationContext context, org.eclipse.core.runtime.IProgressMonitor monitor)
          Returns context information objects valid at the given invocation context.
 java.lang.String getErrorMessage()
          Returns the reason why this computer was unable to produce any completion proposals or context information.
 void sessionEnded()
          Informs the computer that a content assist session has ended.
 void sessionStarted()
          Informs the computer that a content assist session has started.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ParsingBasedProposalComputer

public ParsingBasedProposalComputer()
Method Detail

computeCompletionProposals

public java.util.List computeCompletionProposals(ContentAssistInvocationContext context,
                                                 org.eclipse.core.runtime.IProgressMonitor monitor)
Description copied from interface: ICompletionProposalComputer
Returns a list of completion proposals valid at the given invocation context.

Specified by:
computeCompletionProposals in interface ICompletionProposalComputer
Parameters:
context - the context of the content assist invocation
monitor - a progress monitor to report progress. The monitor is private to this invocation, i.e. there is no need for the receiver to spawn a sub monitor.
Returns:
a list of completion proposals (element type: ICompletionProposal)

computeContextInformation

public java.util.List computeContextInformation(ContentAssistInvocationContext context,
                                                org.eclipse.core.runtime.IProgressMonitor monitor)
Description copied from interface: ICompletionProposalComputer
Returns context information objects valid at the given invocation context.

Specified by:
computeContextInformation in interface ICompletionProposalComputer
Parameters:
context - the context of the content assist invocation
monitor - a progress monitor to report progress. The monitor is private to this invocation, i.e. there is no need for the receiver to spawn a sub monitor.
Returns:
a list of context information objects (element type: IContextInformation)

getErrorMessage

public java.lang.String getErrorMessage()
Description copied from interface: ICompletionProposalComputer
Returns the reason why this computer was unable to produce any completion proposals or context information.

Specified by:
getErrorMessage in interface ICompletionProposalComputer
Returns:
an error message or null if no error occurred

sessionEnded

public void sessionEnded()
Description copied from interface: ICompletionProposalComputer
Informs the computer that a content assist session has ended. This call will always be after any calls to computeCompletionProposals and computeContextInformation.

Specified by:
sessionEnded in interface ICompletionProposalComputer

sessionStarted

public void sessionStarted()
Description copied from interface: ICompletionProposalComputer
Informs the computer that a content assist session has started. This call will always be followed by a ICompletionProposalComputer.sessionEnded() call, but not necessarily by calls to computeCompletionProposals or computeContextInformation.

Specified by:
sessionStarted in interface ICompletionProposalComputer