org.eclipse.datatools.sqltools.sqleditor.internal.sql
Class SQLParserCompletionEngine

java.lang.Object
  extended by org.eclipse.datatools.sqltools.sqleditor.internal.sql.SQLParserCompletionEngine
All Implemented Interfaces:
ISQLCompletionEngine

public class SQLParserCompletionEngine
extends java.lang.Object
implements ISQLCompletionEngine

Computes proposals by SQLParser

Author:
Hui Cao

Constructor Summary
SQLParserCompletionEngine()
           
 
Method Summary
 org.eclipse.jface.text.contentassist.IContextInformation[] computeContextInformation(org.eclipse.jface.text.IDocument doc, org.eclipse.jface.text.ITypedRegion partition, int documentOffset, org.eclipse.swt.graphics.Point selection)
          Compute ContextInformation
 org.eclipse.jface.text.contentassist.ICompletionProposal[] computeProposals(org.eclipse.jface.text.IDocument doc, org.eclipse.jface.text.ITypedRegion partition, int documentOffset, org.eclipse.swt.graphics.Point selection)
          Compute proposals
static int findStatementStart(java.lang.String text, int offset, java.lang.String[] startTokens, java.lang.String[] terminators)
          Finds the start offset of the current statement.
 ISQLDBProposalsService getDBProposalsService()
          Gets the current DBProposalsService.
 boolean needsDisplayOwner(SQLDBProposal proposal, int length)
           
 void setDBProposalsService(ISQLDBProposalsService dbProposalsService)
          Sets the DBProposalsService to use.
static boolean startsWithIgnoreCase(java.lang.String string, java.lang.String prefix)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SQLParserCompletionEngine

public SQLParserCompletionEngine()
Method Detail

computeProposals

public org.eclipse.jface.text.contentassist.ICompletionProposal[] computeProposals(org.eclipse.jface.text.IDocument doc,
                                                                                   org.eclipse.jface.text.ITypedRegion partition,
                                                                                   int documentOffset,
                                                                                   org.eclipse.swt.graphics.Point selection)
Description copied from interface: ISQLCompletionEngine
Compute proposals

Specified by:
computeProposals in interface ISQLCompletionEngine
Parameters:
doc - The document
partition - document partition
documentOffset - current offset in the document
selection - the range of the current selection in coordinates of this viewer's document

findStatementStart

public static int findStatementStart(java.lang.String text,
                                     int offset,
                                     java.lang.String[] startTokens,
                                     java.lang.String[] terminators)
Finds the start offset of the current statement.

Parameters:
text -
offset -
startTokens -
terminators -
Returns:

startsWithIgnoreCase

public static boolean startsWithIgnoreCase(java.lang.String string,
                                           java.lang.String prefix)

setDBProposalsService

public void setDBProposalsService(ISQLDBProposalsService dbProposalsService)
Sets the DBProposalsService to use.

Parameters:
dbProposalsService - the DBProposalsService to use

getDBProposalsService

public ISQLDBProposalsService getDBProposalsService()
Gets the current DBProposalsService.

Parameters:
dbProposalsService - the current DBProposalsService.

needsDisplayOwner

public boolean needsDisplayOwner(SQLDBProposal proposal,
                                 int length)

computeContextInformation

public org.eclipse.jface.text.contentassist.IContextInformation[] computeContextInformation(org.eclipse.jface.text.IDocument doc,
                                                                                            org.eclipse.jface.text.ITypedRegion partition,
                                                                                            int documentOffset,
                                                                                            org.eclipse.swt.graphics.Point selection)
Description copied from interface: ISQLCompletionEngine
Compute ContextInformation

Specified by:
computeContextInformation in interface ISQLCompletionEngine
Parameters:
doc - The document
partition - document partition
documentOffset - current offset in the document
selection - the range of the current selection in coordinates of this viewer's document