| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.datatools.sqltools.sqleditor.internal.indent.SQLIndenter
public class SQLIndenter
Uses the com.sybase.stf.dmp.ui.text.SQLHeuristicScannerto get the indentation level for a certain position
 in a document.
 
 
An instance holds some internal position in the document and is therefore not threadsafe.
| Constructor Summary | |
|---|---|
| SQLIndenter(org.eclipse.jface.text.IDocument document,
            SQLHeuristicScanner scanner)Creates a new instance. | |
| Method Summary | |
|---|---|
|  java.lang.StringBuffer | computeIndentation(int offset)Computes the indentation at offset. | 
|  java.lang.StringBuffer | computeIndentation(int offset,
                   boolean assumeOpening)Computes the indentation at offset. | 
|  int | findReferencePosition(int offset)Returns the reference position regarding to indentation for offset, orNOT_FOUND. | 
|  java.lang.StringBuffer | getReferenceIndentation(int offset)Computes the indentation at the reference point of position. | 
|  void | nextToken(int start)Reads the next token in backward direction of startfrom the heuristic scanner and sets the fieldsfToken, fPreviousPositionandfPositionaccordingly. | 
| Methods inherited from class java.lang.Object | 
|---|
| equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Constructor Detail | 
|---|
public SQLIndenter(org.eclipse.jface.text.IDocument document,
                   SQLHeuristicScanner scanner)
document - the document to scanscanner - the SQLHeuristicScannerto be used for scanning the document. It must be installed on the
            same IDocument.| Method Detail | 
|---|
public java.lang.StringBuffer getReferenceIndentation(int offset)
position.
offset - the offset in the document
offset resides, or null if it cannot be determinedpublic java.lang.StringBuffer computeIndentation(int offset)
offset.
offset - the offset in the document
null if it cannot be determined
public java.lang.StringBuffer computeIndentation(int offset,
                                                 boolean assumeOpening)
offset.
offset - the offset in the documentassumeOpening - true if an opening statement should be assumed
null if it cannot be determinedpublic int findReferencePosition(int offset)
offset, or NOT_FOUND.
 This method calls findReferencePosition(offset, nextChar)where
 nextChar is the next character after offset.
offset - the offset for which the reference is computed
offset should be indented, or
         SQLHeuristicScanner.NOT_FOUNDpublic void nextToken(int start)
start from the heuristic scanner and sets the fields
 fToken, fPreviousPosition and fPosition accordingly.
| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||