org.eclipse.xtext.ui.junit.editor
Class AbstractDamagerRepairerTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.eclipse.xtext.ui.junit.editor.AbstractDamagerRepairerTest
All Implemented Interfaces:
junit.framework.Test, org.eclipse.jface.text.IDocumentListener, org.eclipse.jface.text.rules.ITokenScanner

public abstract class AbstractDamagerRepairerTest
extends junit.framework.TestCase
implements org.eclipse.jface.text.IDocumentListener, org.eclipse.jface.text.rules.ITokenScanner

Author:
Sven Efftinge - Initial contribution and API, Sebastian Zarnekow

Field Summary
protected  org.eclipse.jface.text.IRegion lastRegion
           
 
Constructor Summary
AbstractDamagerRepairerTest()
           
 
Method Summary
protected  void assertEquals(int expStart, int expLength, org.eclipse.jface.text.IRegion actual)
           
protected  org.eclipse.jface.text.IRegion check(java.lang.String before, int start, int replaceLength, java.lang.String text)
           
protected  org.eclipse.jface.text.Document createDocument(java.lang.String before)
           
protected abstract  Lexer createLexer()
           
protected  org.eclipse.jface.text.presentation.IPresentationDamager createRegionDamager()
           
 void documentAboutToBeChanged(org.eclipse.jface.text.DocumentEvent event)
          The manipulation described by the document event will be performed.
 void documentChanged(org.eclipse.jface.text.DocumentEvent event)
          The manipulation described by the document event has been performed.
 int getTokenLength()
          Returns the length of the last token read by this scanner.
 int getTokenOffset()
          Returns the offset of the last token read by this scanner.
 org.eclipse.jface.text.rules.IToken nextToken()
          Returns the next token in the document.
 void setRange(org.eclipse.jface.text.IDocument document, int offset, int length)
          Configures the scanner by providing access to the document range that should be scanned.
protected  void setUp()
           
protected  void tearDown()
           
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

lastRegion

protected org.eclipse.jface.text.IRegion lastRegion
Constructor Detail

AbstractDamagerRepairerTest

public AbstractDamagerRepairerTest()
Method Detail

setUp

protected void setUp()
              throws java.lang.Exception
Overrides:
setUp in class junit.framework.TestCase
Throws:
java.lang.Exception

tearDown

protected void tearDown()
                 throws java.lang.Exception
Overrides:
tearDown in class junit.framework.TestCase
Throws:
java.lang.Exception

check

protected org.eclipse.jface.text.IRegion check(java.lang.String before,
                                               int start,
                                               int replaceLength,
                                               java.lang.String text)
                                        throws java.lang.Exception
Throws:
java.lang.Exception

createRegionDamager

protected org.eclipse.jface.text.presentation.IPresentationDamager createRegionDamager()

createLexer

protected abstract Lexer createLexer()

createDocument

protected org.eclipse.jface.text.Document createDocument(java.lang.String before)
                                                  throws java.lang.Exception
Throws:
java.lang.Exception

assertEquals

protected void assertEquals(int expStart,
                            int expLength,
                            org.eclipse.jface.text.IRegion actual)

documentChanged

public void documentChanged(org.eclipse.jface.text.DocumentEvent event)
Description copied from interface: org.eclipse.jface.text.IDocumentListener
The manipulation described by the document event has been performed.

Specified by:
documentChanged in interface org.eclipse.jface.text.IDocumentListener
Parameters:
event - the document event describing the document change

documentAboutToBeChanged

public void documentAboutToBeChanged(org.eclipse.jface.text.DocumentEvent event)
Description copied from interface: org.eclipse.jface.text.IDocumentListener
The manipulation described by the document event will be performed.

Specified by:
documentAboutToBeChanged in interface org.eclipse.jface.text.IDocumentListener
Parameters:
event - the document event describing the document change

setRange

public void setRange(org.eclipse.jface.text.IDocument document,
                     int offset,
                     int length)
Description copied from interface: org.eclipse.jface.text.rules.ITokenScanner
Configures the scanner by providing access to the document range that should be scanned.

Specified by:
setRange in interface org.eclipse.jface.text.rules.ITokenScanner
Parameters:
document - the document to scan
offset - the offset of the document range to scan
length - the length of the document range to scan

nextToken

public org.eclipse.jface.text.rules.IToken nextToken()
Description copied from interface: org.eclipse.jface.text.rules.ITokenScanner
Returns the next token in the document.

Specified by:
nextToken in interface org.eclipse.jface.text.rules.ITokenScanner
Returns:
the next token in the document

getTokenOffset

public int getTokenOffset()
Description copied from interface: org.eclipse.jface.text.rules.ITokenScanner
Returns the offset of the last token read by this scanner.

Specified by:
getTokenOffset in interface org.eclipse.jface.text.rules.ITokenScanner
Returns:
the offset of the last token read by this scanner

getTokenLength

public int getTokenLength()
Description copied from interface: org.eclipse.jface.text.rules.ITokenScanner
Returns the length of the last token read by this scanner.

Specified by:
getTokenLength in interface org.eclipse.jface.text.rules.ITokenScanner
Returns:
the length of the last token read by this scanner