|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.datatools.sqltools.sqlbuilder.views.source.SQLCompletionEngine
public class SQLCompletionEngine
Constructor Summary | |
---|---|
SQLCompletionEngine()
Constructs an instance of this class. |
Method Summary | |
---|---|
org.eclipse.jface.text.contentassist.ICompletionProposal[] |
computeDBProposals(org.eclipse.jface.text.IDocument doc,
org.eclipse.jface.text.ITypedRegion partition,
int docOffset,
IDBContext dbcontext)
Computes and returns a list of database (catalog) objects (that is, schema, table, and column names) as an array of CompletionProposal objects, based on the current location in the given document. |
org.eclipse.jface.text.contentassist.ICompletionProposal[] |
computeSyntaxProposals(org.eclipse.jface.text.IDocument doc,
org.eclipse.jface.text.ITypedRegion partition,
int docOffset)
Computes and returns a list of syntax elements (keywords and operators) as an array of CompletionProposal objects, based on the current location in the given document. |
java.util.Vector |
filterProposals(java.util.List proposalList,
java.lang.String prefixString,
boolean showAll)
Filters the given list of proposals based on the given prefix string. |
java.util.List |
getAvailableColumns()
Gets a list of DBProposal objects from the available columns of the tables in the query statement. |
java.util.List |
getAvailableColumnsForTable(java.lang.String schemaName,
java.lang.String tableName)
Gets a list of available column objects for the given schema and table name. |
java.util.List |
getAvailableTables()
Gets a list of SQLDBProposal objects representing the tables in the current schema. |
IDBContext |
getDBContext()
Gets the current DB context object. |
java.util.List |
getDBObjectProposals(java.util.List dbContextList)
Gets a list of SQLDBProposal objects. |
int |
getPartitionOffset(org.eclipse.jface.text.IDocument doc,
int docOffset,
int offset)
Returns document offset to the start of the "word" where content assist is requested. |
int |
getPartitionOffset(org.eclipse.jface.text.IDocument doc,
org.eclipse.jface.text.ITypedRegion partition,
int docOffset,
int offset)
Returns the document offset to the start of the "word" where content assist is requested. |
int |
getPartitionOffset(org.eclipse.jface.text.IDocument doc,
org.eclipse.jface.text.ITypedRegion partition,
int docOffset,
java.lang.String leadingString,
int position)
|
SQLBuilderDBProposalsService |
getSQLDBProposalsService()
Gets the current SQLDBProposalsService object. |
void |
setDBContext(IDBContext dbContext)
Sets the current DB context to the given object. |
void |
setSQLDBProposalsService(SQLBuilderDBProposalsService sqlDBProposalsService)
Sets the current SQLDBProposalsService to the given object. |
static boolean |
showContextInformation(org.eclipse.jface.text.IDocument doc,
org.eclipse.jface.text.ITypedRegion partition,
int docOffset,
java.lang.String leadingString)
|
java.util.Vector |
sortProposals(java.lang.String[] proposals,
java.lang.String sortingString,
boolean showAll)
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SQLCompletionEngine()
Method Detail |
---|
public org.eclipse.jface.text.contentassist.ICompletionProposal[] computeDBProposals(org.eclipse.jface.text.IDocument doc, org.eclipse.jface.text.ITypedRegion partition, int docOffset, IDBContext dbcontext)
doc
- the current documentpartition
- the current partition in the documentdocOffset
- the location (offset) in the document where content assist
is wanteddbContext
- the database context (that is, the current database connection)
public org.eclipse.jface.text.contentassist.ICompletionProposal[] computeSyntaxProposals(org.eclipse.jface.text.IDocument doc, org.eclipse.jface.text.ITypedRegion partition, int docOffset)
doc
- the current documentpartition
- the current partition in the documentdocOffset
- the location (offset) in the document where content assist
is wanted
public java.util.Vector filterProposals(java.util.List proposalList, java.lang.String prefixString, boolean showAll)
proposalList
- a list of proposals to be filteredprefixString
- the string to be used to filtershowAll
- when true, include all proposals when the filter
appears to filter out all proposals
public int getPartitionOffset(org.eclipse.jface.text.IDocument doc, int docOffset, int offset)
doc
- IDocumentpartition
- ITypedRegiondocOffset
- intoffset
- intpublic int getPartitionOffset(org.eclipse.jface.text.IDocument doc, org.eclipse.jface.text.ITypedRegion partition, int docOffset, int offset)
doc
- the current documentpartition
- document partition region. A region consists of offset,
length, and type.docOffset
- offset into the documentoffset
- offset in the document to start of the name preceeding the
activation characterpublic int getPartitionOffset(org.eclipse.jface.text.IDocument doc, org.eclipse.jface.text.ITypedRegion partition, int docOffset, java.lang.String leadingString, int position)
doc
- IDocumentpartition
- ITypedRegiondocOffset
- intleadingString
- Stringposition
- 1: from current position 0: after leadingStringpublic static boolean showContextInformation(org.eclipse.jface.text.IDocument doc, org.eclipse.jface.text.ITypedRegion partition, int docOffset, java.lang.String leadingString)
public java.util.Vector sortProposals(java.lang.String[] proposals, java.lang.String sortingString, boolean showAll)
proposals
- String []sortingString
- Stringpublic java.util.List getAvailableColumns()
public java.util.List getAvailableTables()
public java.util.List getAvailableColumnsForTable(java.lang.String schemaName, java.lang.String tableName)
schemaName
- the schema name of the table for which columns are wantedtableName
- the table name for which columns are wanted
public java.util.List getDBObjectProposals(java.util.List dbContextList)
dbContextList
- a list of identifiers that give a context for the content
assist. For example if user entered schema1.table1 then typed ".", then the list
consists of two tokens, schema1 and table1.
public IDBContext getDBContext()
public void setDBContext(IDBContext dbContext)
dbContext
- the DB context to setpublic SQLBuilderDBProposalsService getSQLDBProposalsService()
public void setSQLDBProposalsService(SQLBuilderDBProposalsService sqlDBProposalsService)
sqlDBProposalsService
- the SQLDBProposalsService object to set
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |