KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jface > text > ITextViewerExtension3


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.jface.text;
12
13
14 /**
15  * Extension interface for {@link org.eclipse.jface.text.ITextViewer}. <p>
16  * This interface has been replaced by {@link org.eclipse.jface.text.ITextViewerExtension5}.
17  * Clients are not supposed to use this interface any longer.
18  *
19  * @since 2.1
20  * @deprecated replaced by {@link org.eclipse.jface.text.ITextViewerExtension5}
21  */

22 public interface ITextViewerExtension3 {
23
24
25     /**
26      * Returns the minimal region of the viewer's document that completely comprises everything that is
27      * visible in the viewer's widget or <code>null</code> if there is no such region.
28      *
29      * @return the minimal region of the viewer's document comprising the contents of the viewer's widget or <code>null</code>
30      */

31     IRegion getModelCoverage();
32
33
34     /**
35      * Returns the widget line that corresponds to the given line of the viewer's document or <code>-1</code> if there is no such line.
36      *
37      * @param modelLine the line of the viewer's document
38      * @return the corresponding widget line or <code>-1</code>
39      */

40     int modelLine2WidgetLine(int modelLine);
41
42     /**
43      * Returns the widget offset that corresponds to the given offset in the viewer's document
44      * or <code>-1</code> if there is no such offset
45      *
46      * @param modelOffset the offset in the viewer's document
47      * @return the corresponding widget offset or <code>-1</code>
48      */

49     int modelOffset2WidgetOffset(int modelOffset);
50
51     /**
52      * Returns the minimal region of the viewer's widget that completely comprises the given region of the
53      * viewer's document or <code>null</code> if there is no such region.
54      *
55      * @param modelRange the region of the viewer's document
56      * @return the minimal region of the widget comprising <code>modelRange</code> or <code>null</code>
57      */

58     IRegion modelRange2WidgetRange(IRegion modelRange);
59
60
61     /**
62      * Returns the offset of the viewer's document that corresponds to the given widget offset
63      * or <code>-1</code> if there is no such offset
64      *
65      * @param widgetOffset the widget offset
66      * @return the corresponding offset in the viewer's document or <code>-1</code>
67      */

68     int widgetOffset2ModelOffset(int widgetOffset);
69
70     /**
71      * Returns the minimal region of the viewer's document that completely comprises the given widget region
72      * or <code>null</code> if there is no such region.
73      *
74      * @param widgetRange the widget region
75      * @return the minimal region of the viewer's document comprising <code>widgetRange</code> or <code>null</code>
76      */

77     IRegion widgetRange2ModelRange(IRegion widgetRange);
78
79     /**
80      * Returns the line of the viewer's document that corresponds to the given widget line or <code>-1</code> if there is no such line.
81      *
82      * @param widgetLine the widget line
83      * @return the corresponding line of the viewer's document or <code>-1</code>
84      */

85     int widgetlLine2ModelLine(int widgetLine);
86
87     /**
88      * Returns the widget line of the given widget offset.
89      *
90      * @param widgetOffset the widget offset
91      * @return the widget line of the widget offset
92      */

93     int widgetLineOfWidgetOffset(int widgetOffset);
94 }
95
Popular Tags