|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.datatools.sqltools.schemaobjecteditor.ui.internal.ui.SQLSourceViewerService
public class SQLSourceViewerService
This is a common implementation of ISQLSourceViewerService . In this implementation, the document is
divided into following partitions:
If user wants to support other partitions, user needs to subclass ISQLSourceViewerService directly and
implement the method: setUpDocument().
| Constructor Summary | |
|---|---|
SQLSourceViewerService()
|
|
| Method Summary | |
|---|---|
void |
setUpDocument(org.eclipse.jface.text.IDocument document,
java.lang.String dbType)
This method is used for user to customize the document setting. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SQLSourceViewerService()
| Method Detail |
|---|
public void setUpDocument(org.eclipse.jface.text.IDocument document,
java.lang.String dbType)
ISQLSourceViewerService
The document used by SQLStatementArea needs a PartitionSanner and Partitioner to
compute the partitions. Through this method, user can set up customized PartitionSanner with
customized rules.
Sample code for setting up a document
XXXPartitionScanner _xxxPartitionSanner = new XXXPartitionScanner();
_xxxPartitionSanner.setCommentsScanner(SQLToolsFacade.getSQLSyntax(dbType));
if (document instanceof IDocumentExtension3)
{
IDocumentExtension3 extension3 = (IDocumentExtension3) document;
FastPartitioner _partitioner = new FastPartitioner(_sqlPartitionSanner, new String[]
{
XXXPartitionScanner.SQL_CODE, XXXPartitionScanner.SQL_COMMENT,
XXXPartitionScanner.SQL_MULTILINE_COMMENT, XXXPartitionScanner.SQL_STRING,
XXXPartitionScanner.SQL_DOUBLE_QUOTES_IDENTIFIER
});
_partitioner.connect(document);
extension3.setDocumentPartitioner(ISQLPartitions.SQL_PARTITIONING, _partitioner);
}
setUpDocument in interface ISQLSourceViewerServicedocument - the Document to be set updbType - the Database type of the SQL Statement which is contained in the Document.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||