X-Git-Url: http://secure.phpeclipse.com diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/PHPDocumentProvider.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/PHPDocumentProvider.java index 198ad1f..4db485f 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/PHPDocumentProvider.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/PHPDocumentProvider.java @@ -16,8 +16,10 @@ import net.sourceforge.phpeclipse.phpeditor.php.IPHPPartitionScannerConstants; import net.sourceforge.phpeclipse.phpeditor.php.PHPPartitionScanner; import org.eclipse.core.runtime.CoreException; +import org.eclipse.jface.text.DefaultLineTracker; import org.eclipse.jface.text.IDocument; import org.eclipse.jface.text.IDocumentPartitioner; +import org.eclipse.jface.text.ILineTracker; import org.eclipse.jface.text.rules.DefaultPartitioner; import org.eclipse.ui.editors.text.FileDocumentProvider; @@ -70,4 +72,15 @@ public class PHPDocumentProvider extends FileDocumentProvider { fgScanner = new PHPPartitionScanner(); return fgScanner; } + + /** + * Creates a line tracker working with the same line delimiters as the document + * of the given element. Assumes the element to be managed by this document provider. + * + * @param element the element serving as blue print + * @return a line tracker based on the same line delimiters as the element's document + */ + public ILineTracker createLineTracker(Object element) { + return new DefaultLineTracker(); + } }