|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ISQLSourceViewerService
This interface defines some help methods which are needed by SQLStatementArea
.
The consumer of SQLStatementArea
must create an instance implementing this interface
and pass it in when creating instance of SQLStatementArea
.
Method Summary | |
---|---|
void |
setUpDocument(org.eclipse.jface.text.IDocument doc,
java.lang.String dbType)
This method is used for user to customize the document setting. |
Method Detail |
---|
void setUpDocument(org.eclipse.jface.text.IDocument doc, java.lang.String dbType)
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); }
doc
- 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 |