Search in sources :

Example 76 with IRegion

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

the class ProjectionDocumentTest method test29_25.

@Test
public void test29_25() {
    // test computation of unprojected  master regions
    // spanning multiple fragments
    // starting inside fragment
    // ending touching right fragment border
    IRegion[] expected = { new Region(80, 20), new Region(120, 20) };
    assertUnprojectedMasterRegions(expected, 70, 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)

Example 77 with IRegion

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

the class ProjectionDocumentTest method test29_35.

@Test
public void test29_35() {
    // test computation of unprojected  master regions
    // spanning multiple fragments
    // starting right of fragment
    // ending touching right fragment border
    IRegion[] expected = { new Region(50, 10), new Region(80, 20), new Region(120, 20) };
    assertUnprojectedMasterRegions(expected, 50, 110);
}
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 78 with IRegion

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

the class ProjectionDocumentTest method test29_18.

@Test
public void test29_18() {
    // test computation of unprojected  master regions
    // spanning multiple fragments
    // starting touching left fragment border
    // ending touching left fragment border
    IRegion[] expected = { new Region(80, 20), new Region(120, 20) };
    assertUnprojectedMasterRegions(expected, 60, 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 79 with IRegion

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

the class ProjectionDocumentTest method test29_26.

@Test
public void test29_26() {
    // test computation of unprojected  master regions
    // spanning multiple fragments
    // starting inside fragment
    // ending right of fragment
    IRegion[] expected = { new Region(80, 20), new Region(120, 10) };
    assertUnprojectedMasterRegions(expected, 70, 60);
}
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 80 with IRegion

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

the class ProjectionDocumentTest method test29_37.

@Test
public void test29_37() {
    // test computation of unprojected  master regions
    createProjectionB();
    try {
        IRegion[] regions = fSlaveDocument.computeUnprojectedMasterRegions(0, 180);
        IRegion[] expected = { new Region(0, 20), new Region(40, 20), new Region(80, 20), new Region(120, 20), new Region(160, 20) };
        assertRegions(expected, regions);
    } catch (BadLocationException e) {
        assertTrue(false);
    }
}
Also used : Region(org.eclipse.jface.text.Region) IRegion(org.eclipse.jface.text.IRegion) IRegion(org.eclipse.jface.text.IRegion) BadLocationException(org.eclipse.jface.text.BadLocationException) 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