Search in sources :

Example 71 with IRegion

use of org.eclipse.jface.text.IRegion in project eclipse.platform.text by eclipse.

the class ProjectionDocumentTest method test29_32.

@Test
public void test29_32() {
    // test computation of unprojected  master regions
    // spanning multiple fragments
    // starting right of fragment
    // ending left of fragment
    IRegion[] expected = { new Region(50, 10), new Region(80, 20), new Region(120, 10) };
    assertUnprojectedMasterRegions(expected, 50, 80);
}
Also used : Region(org.eclipse.jface.text.Region) IRegion(org.eclipse.jface.text.IRegion) IRegion(org.eclipse.jface.text.IRegion) Test(org.junit.Test)

Example 72 with IRegion

use of org.eclipse.jface.text.IRegion in project eclipse.platform.text by eclipse.

the class ProjectionDocumentTest method test29_24.

@Test
public void test29_24() {
    // test computation of unprojected  master regions
    // spanning multiple fragments
    // starting inside fragment
    // ending inside fragment
    IRegion[] expected = { new Region(80, 20) };
    assertUnprojectedMasterRegions(expected, 70, 40);
}
Also used : Region(org.eclipse.jface.text.Region) IRegion(org.eclipse.jface.text.IRegion) IRegion(org.eclipse.jface.text.IRegion) Test(org.junit.Test)

Example 73 with IRegion

use of org.eclipse.jface.text.IRegion in project eclipse.platform.text by eclipse.

the class ProjectionDocumentTest method test29_4.

@Test
public void test29_4() {
    // test computation of unprojected  master regions
    // spanning no fragment
    // right of fragment
    IRegion[] expected = { new Region(85, 10) };
    assertUnprojectedMasterRegions(expected, 85, 10);
}
Also used : Region(org.eclipse.jface.text.Region) IRegion(org.eclipse.jface.text.IRegion) IRegion(org.eclipse.jface.text.IRegion) Test(org.junit.Test)

Example 74 with IRegion

use of org.eclipse.jface.text.IRegion in project eclipse.platform.text by eclipse.

the class ProjectionDocumentTest method test29_16.

@Test
public void test29_16() {
    // test computation of unprojected  master regions
    // spanning multiple fragments
    // starting left of fragment
    // ending right of fragment
    IRegion[] expected = { new Region(50, 10), new Region(80, 20), new Region(120, 10) };
    assertUnprojectedMasterRegions(expected, 50, 80);
}
Also used : Region(org.eclipse.jface.text.Region) IRegion(org.eclipse.jface.text.IRegion) IRegion(org.eclipse.jface.text.IRegion) Test(org.junit.Test)

Example 75 with IRegion

use of org.eclipse.jface.text.IRegion in project eclipse.platform.text by eclipse.

the class ProjectionDocumentTest method test29_31.

@Test
public void test29_31() {
    // test computation of unprojected  master regions
    // spanning multiple fragments
    // starting touching right fragment border
    // ending right of fragment
    IRegion[] expected = { new Region(40, 20), new Region(80, 20), new Region(120, 10) };
    assertUnprojectedMasterRegions(expected, 40, 90);
}
Also used : Region(org.eclipse.jface.text.Region) IRegion(org.eclipse.jface.text.IRegion) IRegion(org.eclipse.jface.text.IRegion) Test(org.junit.Test)

Aggregations

IRegion (org.eclipse.jface.text.IRegion)341 BadLocationException (org.eclipse.jface.text.BadLocationException)158 Region (org.eclipse.jface.text.Region)151 Test (org.junit.Test)94 IDocument (org.eclipse.jface.text.IDocument)68 Point (org.eclipse.swt.graphics.Point)49 Position (org.eclipse.jface.text.Position)38 ITextViewerExtension5 (org.eclipse.jface.text.ITextViewerExtension5)20 ITypedRegion (org.eclipse.jface.text.ITypedRegion)20 FindReplaceDocumentAdapter (org.eclipse.jface.text.FindReplaceDocumentAdapter)18 IHyperlink (org.eclipse.jface.text.hyperlink.IHyperlink)17 IEditorPart (org.eclipse.ui.IEditorPart)13 ArrayList (java.util.ArrayList)11 Document (org.eclipse.jface.text.Document)11 StyledText (org.eclipse.swt.custom.StyledText)10 ITextSelection (org.eclipse.jface.text.ITextSelection)9 IFile (org.eclipse.core.resources.IFile)8 Annotation (org.eclipse.jface.text.source.Annotation)7 HashMap (java.util.HashMap)6 CoreException (org.eclipse.core.runtime.CoreException)6