org.eclipse.datatools.sqltools.sqlbuilder.views.source
Class SQLCompletionProcessor

java.lang.Object
  extended by org.eclipse.datatools.sqltools.sqlbuilder.views.source.SQLCompletionProcessor
All Implemented Interfaces:
org.eclipse.jface.text.contentassist.IContentAssistProcessor

public class SQLCompletionProcessor
extends java.lang.Object
implements org.eclipse.jface.text.contentassist.IContentAssistProcessor


Constructor Summary
SQLCompletionProcessor()
          Constructs an instance of this class.
 
Method Summary
 org.eclipse.jface.text.contentassist.ICompletionProposal[] computeCompletionProposals(org.eclipse.jface.text.IDocument doc, int docOffset)
          Returns a list of proposed content completions based on the specified offset within the given document.
 org.eclipse.jface.text.contentassist.ICompletionProposal[] computeCompletionProposals(org.eclipse.jface.text.ITextViewer viewer, int docOffset)
          Returns a list of proposed content completions based on the specified offset within the document associated with the given text viewer.
 org.eclipse.jface.text.contentassist.ICompletionProposal[] computeCompletionProposals(java.lang.String stmt, int stmtOffset)
          Returns a list of proposed content completions based on the specified offset given SQL statement.
 org.eclipse.jface.text.contentassist.IContextInformation[] computeContextInformation(org.eclipse.jface.text.IDocument doc, int docOffset)
          Returns a list of content assist tips based on the specified location within the given document.
 org.eclipse.jface.text.contentassist.IContextInformation[] computeContextInformation(org.eclipse.jface.text.ITextViewer viewer, int docOffset)
          Returns a list of content assist tips based on the specified location within the document associated with the given text viewer.
 org.eclipse.jface.text.contentassist.IContextInformation[] computeContextInformation(java.lang.String stmt, int stmtOffset)
          Returns a list of content assist tips based on the specified location within the given statement string.
 SQLCompletionEngine getCompletionEngine()
          Gets the SQLCompletionEngine associated with this completion processor.
 char[] getCompletionProposalAutoActivationCharacters()
          Returns a string of characters which when pressed should automatically display content-assist proposals.
 char[] getContextInformationAutoActivationCharacters()
          Returns a string of characters which when pressed should automatically display a content-assist tip.
 org.eclipse.jface.text.contentassist.IContextInformationValidator getContextInformationValidator()
          Returns a delegate used to determine when a displayed tip should be dismissed.
 IDBContext getDBContext()
          Gets the current DB context object.
 java.lang.String getErrorMessage()
          Returns the reason why the content assist processor was unable to produce any proposals or tips.
 void setCompletionEngine(SQLCompletionEngine completionEngine)
          Sets the SQLCompletionEngine object for this processor to the given object.
 void setCompletionProposalAutoActivationCharacters(char[] activationSet)
          Sets this processor's set of characters triggering the activation of the completion proposal computation.
 void setDBContext(IDBContext newDBContext)
          Sets the DB context object to the given object.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SQLCompletionProcessor

public SQLCompletionProcessor()
Constructs an instance of this class. This is the default constructor.

Method Detail

computeCompletionProposals

public org.eclipse.jface.text.contentassist.ICompletionProposal[] computeCompletionProposals(java.lang.String stmt,
                                                                                             int stmtOffset)
Returns a list of proposed content completions based on the specified offset given SQL statement.

Parameters:
stmt - the statement for which proposals are needed
stmtOffset - offset within the statement where proposals are needed
Returns:
an array of content assist proposals

computeCompletionProposals

public org.eclipse.jface.text.contentassist.ICompletionProposal[] computeCompletionProposals(org.eclipse.jface.text.ITextViewer viewer,
                                                                                             int docOffset)
Returns a list of proposed content completions based on the specified offset within the document associated with the given text viewer.

Specified by:
computeCompletionProposals in interface org.eclipse.jface.text.contentassist.IContentAssistProcessor
Parameters:
viewer - the viewer whose document is used to compute the proposals
docOffset - the offset within the document where content assist is needed
Returns:
an array of content assist proposals

computeCompletionProposals

public org.eclipse.jface.text.contentassist.ICompletionProposal[] computeCompletionProposals(org.eclipse.jface.text.IDocument doc,
                                                                                             int docOffset)
Returns a list of proposed content completions based on the specified offset within the given document.

Parameters:
doc - the current document containing the SQL statement
docOffset - the offset within the document where content assist is needed
Returns:
an array of content assist proposals

computeContextInformation

public org.eclipse.jface.text.contentassist.IContextInformation[] computeContextInformation(org.eclipse.jface.text.ITextViewer viewer,
                                                                                            int docOffset)
Returns a list of content assist tips based on the specified location within the document associated with the given text viewer.

Specified by:
computeContextInformation in interface org.eclipse.jface.text.contentassist.IContentAssistProcessor
Parameters:
viewer - the text viewer for which tips are needed
docOffset - the offset in the document where tips are needed
Returns:
an array of content assist tips

computeContextInformation

public org.eclipse.jface.text.contentassist.IContextInformation[] computeContextInformation(java.lang.String stmt,
                                                                                            int stmtOffset)
Returns a list of content assist tips based on the specified location within the given statement string.

Parameters:
stmt - the SQL statement for which tips are needed
stmtOffset - the offset in the statement where tips are needed
Returns:
an array of content assist tips

computeContextInformation

public org.eclipse.jface.text.contentassist.IContextInformation[] computeContextInformation(org.eclipse.jface.text.IDocument doc,
                                                                                            int docOffset)
Returns a list of content assist tips based on the specified location within the given document.

Parameters:
doc - the document containing the SQL statement for which tips are needed
docOffset - the offset within the document where tips are needed
Returns:
an array of content assist tips

getCompletionEngine

public SQLCompletionEngine getCompletionEngine()
Gets the SQLCompletionEngine associated with this completion processor.

Returns:
the current completion engine

getCompletionProposalAutoActivationCharacters

public char[] getCompletionProposalAutoActivationCharacters()
Returns a string of characters which when pressed should automatically display content-assist proposals.

Specified by:
getCompletionProposalAutoActivationCharacters in interface org.eclipse.jface.text.contentassist.IContentAssistProcessor
Returns:
string of characters
See Also:
IContentAssistProcessor.getCompletionProposalAutoActivationCharacters()

getContextInformationAutoActivationCharacters

public char[] getContextInformationAutoActivationCharacters()
Returns a string of characters which when pressed should automatically display a content-assist tip.

Specified by:
getContextInformationAutoActivationCharacters in interface org.eclipse.jface.text.contentassist.IContentAssistProcessor
Returns:
string of characters

getContextInformationValidator

public org.eclipse.jface.text.contentassist.IContextInformationValidator getContextInformationValidator()
Returns a delegate used to determine when a displayed tip should be dismissed.

Specified by:
getContextInformationValidator in interface org.eclipse.jface.text.contentassist.IContentAssistProcessor
Returns:
a tip closer

getDBContext

public IDBContext getDBContext()
Gets the current DB context object.

Returns:
the current DB context object

getErrorMessage

public java.lang.String getErrorMessage()
Returns the reason why the content assist processor was unable to produce any proposals or tips.

Specified by:
getErrorMessage in interface org.eclipse.jface.text.contentassist.IContentAssistProcessor
Returns:
an error message or null if no error occurred

setCompletionEngine

public void setCompletionEngine(SQLCompletionEngine completionEngine)
Sets the SQLCompletionEngine object for this processor to the given object.

Parameters:
completionEngine - the completion engine to use

setCompletionProposalAutoActivationCharacters

public void setCompletionProposalAutoActivationCharacters(char[] activationSet)
Sets this processor's set of characters triggering the activation of the completion proposal computation.

Parameters:
activationSet - the activation set to use

setDBContext

public void setDBContext(IDBContext newDBContext)
Sets the DB context object to the given object.

Parameters:
newDBContext - the DB context object to set