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

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

public class SQLDBProposalsService
extends java.lang.Object
implements ISQLDBProposalsService

Provides database identifier proposal services for the editor, to support code completion. These are services to construct and return a list of proposals of database objects (tables, columns) based on a given database connection. This class implements the ISQLDBProposalsService interface.

Author:
Hetty Dougherty, bgp

Constructor Summary
SQLDBProposalsService(ISQLEditorConnectionInfo connInfo)
          Constructs an instance of this class with the given ISQLEditorConnectionInfo object.
 
Method Summary
 ISQLEditorConnectionInfo getConnectionInfo()
          Gets the ISQLEditorConnectionInfo used to provide content assist.
 java.util.List getDBProposals()
          Gets the list of SQLDBProposal objects for the content assist proposals.
 SQLDBProposalsRequest getSQLDBProposalRequest()
          Gets the content assist request for database meta objects.
 ISQLEditorConnectionInfo getSQLEditorConnectionInfo()
          Gets the ISQLEditorConnectionInfo used to provide content assist.
 boolean populate(SQLDBProposalsRequest request)
          Populates the list database of database object proposals (schemas, tables, columns) using given list of tokens (DB identifiers) indicating the start of the expression for which the user wants DB proposals.
 void setSQLEditorConnectionInfo(ISQLEditorConnectionInfo connectionInfo)
          Sets the ISQLEditorConnectionInfo used to provide content assist.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SQLDBProposalsService

public SQLDBProposalsService(ISQLEditorConnectionInfo connInfo)
Constructs an instance of this class with the given ISQLEditorConnectionInfo object.

Parameters:
connInfo - the ISQLEditorConnectionInfo object to use
Method Detail

getConnectionInfo

public ISQLEditorConnectionInfo getConnectionInfo()
Gets the ISQLEditorConnectionInfo used to provide content assist. Implements ISQLDBProposalsService interface.

Returns:
the current ISQLEditorConnectionInfo object
See Also:
ISQLDBProposalsService#getConnectionInfo()

getDBProposals

public java.util.List getDBProposals()
Gets the list of SQLDBProposal objects for the content assist proposals. Implements ISQLDBProposalsService interface.

Specified by:
getDBProposals in interface ISQLDBProposalsService
Returns:
the list of proposals
See Also:
ISQLDBProposalsService.getDBProposals()

getSQLDBProposalRequest

public SQLDBProposalsRequest getSQLDBProposalRequest()
Gets the content assist request for database meta objects.

Returns:
the request

populate

public boolean populate(SQLDBProposalsRequest request)
Populates the list database of database object proposals (schemas, tables, columns) using given list of tokens (DB identifiers) indicating the start of the expression for which the user wants DB proposals. For example, if the user provides the list (MYSCHEMA, TABLE1), the list of proposals will be the columns of table MYSCHEMA.TABLE1. Retrieve the list using getDBProposals(). Implements ISQLDBProposalsService interface.

Specified by:
populate in interface ISQLDBProposalsService
Parameters:
tokenList - list of strings indicating the start of the expression for which the user wants DB proposals
Returns:
true if database objects were loaded, for example as a result of reestablishing a connection
See Also:
ISQLDBProposalsService#populate()

getSQLEditorConnectionInfo

public ISQLEditorConnectionInfo getSQLEditorConnectionInfo()
Description copied from interface: ISQLDBProposalsService
Gets the ISQLEditorConnectionInfo used to provide content assist.

Specified by:
getSQLEditorConnectionInfo in interface ISQLDBProposalsService
Returns:
the current ISQLEditorConnectionInfo object

setSQLEditorConnectionInfo

public void setSQLEditorConnectionInfo(ISQLEditorConnectionInfo connectionInfo)
Description copied from interface: ISQLDBProposalsService
Sets the ISQLEditorConnectionInfo used to provide content assist.

Specified by:
setSQLEditorConnectionInfo in interface ISQLDBProposalsService