129
|
1 /*******************************************************************************
|
|
2 * Copyright (c) 2000, 2008 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 * Port to the D programming language:
|
|
11 * Frank Benoit <benoit@tionex.de>
|
|
12 *******************************************************************************/
|
|
13 module dwtx.jface.text.ITextViewer;
|
|
14
|
131
|
15 import dwtx.jface.text.ITextListener; // packageimport
|
|
16 import dwtx.jface.text.IUndoManager; // packageimport
|
|
17 import dwtx.jface.text.ITextHoverExtension2; // packageimport
|
|
18 import dwtx.jface.text.IViewportListener; // packageimport
|
|
19 import dwtx.jface.text.IRegion; // packageimport
|
|
20 import dwtx.jface.text.IFindReplaceTarget; // packageimport
|
|
21 import dwtx.jface.text.IAutoIndentStrategy; // packageimport
|
|
22 import dwtx.jface.text.ITextHover; // packageimport
|
|
23 import dwtx.jface.text.TextPresentation; // packageimport
|
|
24 import dwtx.jface.text.ITextDoubleClickStrategy; // packageimport
|
|
25 import dwtx.jface.text.ITextInputListener; // packageimport
|
|
26 import dwtx.jface.text.ITextOperationTarget; // packageimport
|
|
27 import dwtx.jface.text.IEventConsumer; // packageimport
|
|
28 import dwtx.jface.text.IDocument; // packageimport
|
|
29
|
129
|
30 import dwt.dwthelper.utils;
|
|
31
|
|
32 import dwt.custom.StyledText;
|
|
33 import dwt.graphics.Color;
|
|
34 import dwt.graphics.Point;
|
|
35 import dwtx.jface.viewers.ISelectionProvider;
|
|
36
|
|
37
|
|
38 /**
|
|
39 * A text viewer connects a text widget with an
|
|
40 * {@link dwtx.jface.text.IDocument}. The document is used as the
|
|
41 * widget's text model.
|
|
42 * <p>
|
|
43 * It supports the following kinds of listeners:
|
|
44 * <ul>
|
|
45 * <li>view port listeners to inform about changes of the viewer's view port</li>
|
|
46 * <li>text listeners to inform about changes of the document and the
|
|
47 * subsequent viewer change</li>
|
|
48 * <li>text input listeners to inform about changes of the viewer's input
|
|
49 * document.</li>
|
|
50 * </ul>
|
|
51 * A text viewer supports a set of configuration options and plug-ins defining
|
|
52 * its behavior:
|
|
53 * <ul>
|
|
54 * <li>undo manager</li>
|
|
55 * <li>double click behavior</li>
|
|
56 * <li>auto indentation</li>
|
|
57 * <li>text hover</li>
|
|
58 * </ul>
|
|
59 * Installed plug-ins are not automatically activated. Plug-ins must be
|
|
60 * activated with the <code>activatePlugins</code> call. Most plug-ins can be
|
|
61 * defined per content type. Content types are derived from a partitioning of
|
|
62 * the text viewer's input document. In case of documents that support multiple
|
|
63 * partitionings, the implementer is responsible for determining the
|
|
64 * partitioning to use.
|
|
65 * <p>
|
|
66 * A text viewer also provides the concept of event consumption. Events handled
|
|
67 * by the viewer can be filtered and processed by a dynamic event consumer. With
|
|
68 * {@link dwtx.jface.text.ITextViewerExtension}, this mechanism has been
|
|
69 * replaced with the support for
|
|
70 * {@link dwt.custom.VerifyKeyListener}.
|
|
71 * <p>
|
|
72 * A text viewer provides several text editing functions, some of them are
|
|
73 * configurable, through a text operation target interface. It also supports a
|
|
74 * presentation mode in which it only shows a specified section of its document.
|
|
75 * By calling <code>setVisibleRegion</code> clients define which section is
|
|
76 * visible. Clients can get access to this section by calling
|
|
77 * <code>getVisibleRegion</code>. The viewer's presentation mode does not
|
|
78 * affect any client of the viewer other than text listeners. With
|
|
79 * {@link dwtx.jface.text.ITextViewerExtension5} the visible region
|
|
80 * support has been reworked. With that extension interface, text viewers are
|
|
81 * allowed to show fractions of their input document. I.e. a widget selection of
|
|
82 * two visually neighboring characters is no longer guaranteed to be two
|
|
83 * neighboring characters in the viewer's input document. Thus, viewers
|
|
84 * implementing {@link dwtx.jface.text.ITextViewerExtension5} are
|
|
85 * potentially forced to change the fractions of the input document that are
|
|
86 * shown when clients ask for the visible region.
|
|
87 * <p>
|
|
88 *
|
|
89 * In order to provide backward compatibility for clients of
|
|
90 * <code>ITextViewer</code>, extension interfaces are used as a means of
|
|
91 * evolution. The following extension interfaces exist:
|
|
92 * <ul>
|
|
93 * <li>{@link dwtx.jface.text.ITextViewerExtension} since version 2.0
|
|
94 * replacing the event consumer mechanism and introducing the concept of rewrite
|
|
95 * targets and means to manage the viewer's redraw behavior</li>
|
|
96 * <li>{@link dwtx.jface.text.ITextViewerExtension2}since version 2.1
|
|
97 * adding a way to invalidate a viewer's presentation and setters for hovers.
|
|
98 * </li>
|
|
99 * <li>{@link dwtx.jface.text.ITextViewerExtension3} since version 2.1
|
|
100 * which itself was replaced by
|
|
101 * {@link dwtx.jface.text.ITextViewerExtension5} in version 3.0</li>
|
|
102 * <li>{@link dwtx.jface.text.ITextViewerExtension4} since version 3.0
|
|
103 * introducing focus handling for widget token keepers and the concept of text
|
|
104 * presentation listeners.</li>
|
|
105 * <li>{@link dwtx.jface.text.ITextViewerExtension5} since version 3.0
|
|
106 * extending the visible region concept with explicit handling and conversion
|
|
107 * of widget and model coordinates.</li>
|
|
108 * <li>{@link dwtx.jface.text.ITextViewerExtension6} since version 3.1
|
|
109 * extending the text viewer with the ability to detect hyperlinks and access the undo manager.</li>
|
|
110 * <li>{@link dwtx.jface.text.ITextViewerExtension7} since version 3.3
|
|
111 * extending the text viewer with the ability to install tabs to spaces conversion.</li>
|
|
112 * <li>{@link dwtx.jface.text.ITextViewerExtension8} since version 3.4
|
|
113 * extending the text viewer with the ability to print and rich hover support.</li>
|
|
114 * </ul></p>
|
|
115 * <p>
|
|
116 * Clients may implement this interface and its extension interfaces or use the
|
|
117 * standard implementation {@link dwtx.jface.text.TextViewer}.</p>
|
|
118 *
|
|
119 * @see dwtx.jface.text.ITextViewerExtension
|
|
120 * @see dwtx.jface.text.ITextViewerExtension2
|
|
121 * @see dwtx.jface.text.ITextViewerExtension3
|
|
122 * @see dwtx.jface.text.ITextViewerExtension4
|
|
123 * @see dwtx.jface.text.ITextViewerExtension5
|
|
124 * @see dwtx.jface.text.ITextViewerExtension6
|
|
125 * @see dwtx.jface.text.ITextViewerExtension7
|
|
126 * @see dwtx.jface.text.ITextViewerExtension8
|
|
127 * @see dwtx.jface.text.IDocument
|
|
128 * @see dwtx.jface.text.ITextInputListener
|
|
129 * @see dwtx.jface.text.IViewportListener
|
|
130 * @see dwtx.jface.text.ITextListener
|
|
131 * @see dwtx.jface.text.IEventConsumer
|
|
132 */
|
|
133 public interface ITextViewer {
|
|
134
|
|
135
|
|
136 /* ---------- widget --------- */
|
|
137
|
|
138 /**
|
|
139 * Returns this viewer's DWT control, <code>null</code> if the control is disposed.
|
|
140 * <p>
|
|
141 * <em>Calling API directly on the widget can interfere with features provided
|
|
142 * by a text viewer. Clients who call API directly on the widget are responsible
|
|
143 * to resolve such conflicts on their side.</em>
|
|
144 * </p>
|
|
145 *
|
|
146 * @return the DWT control or <code>null</code>
|
|
147 */
|
|
148 StyledText getTextWidget();
|
|
149
|
|
150
|
|
151 /* --------- plug-ins --------- */
|
|
152
|
|
153 /**
|
|
154 * Sets this viewer's undo manager.
|
|
155 *
|
|
156 * @param undoManager the new undo manager. <code>null</code> is a valid argument.
|
|
157 */
|
|
158 void setUndoManager(IUndoManager undoManager);
|
|
159
|
|
160 /**
|
|
161 * Sets this viewer's text double click strategy for the given content type.
|
|
162 *
|
|
163 * @param strategy the new double click strategy. <code>null</code> is a valid argument.
|
|
164 * @param contentType the type for which the strategy is registered
|
|
165 */
|
|
166 void setTextDoubleClickStrategy(ITextDoubleClickStrategy strategy, String contentType);
|
|
167
|
|
168 /**
|
|
169 * Sets this viewer's auto indent strategy for the given content type. If
|
|
170 * the given strategy is <code>null</code> any installed strategy for the
|
|
171 * content type is removed. This method has been replaced by
|
|
172 * {@link ITextViewerExtension2#prependAutoEditStrategy(IAutoEditStrategy, String)} and
|
|
173 * {@link ITextViewerExtension2#removeAutoEditStrategy(IAutoEditStrategy, String)}.
|
|
174 * It is now equivalent to
|
|
175 * <pre>
|
134
|
176 * ITextViewerExtension2 extension= cast(ITextViewerExtension2) viewer;
|
129
|
177 * extension.removeAutoEditStrategy(oldStrategy, contentType);
|
|
178 * extension.prependAutoEditStrategy(strategy, contentType);
|
|
179 * </pre>
|
|
180 *
|
|
181 * @param strategy the new auto indent strategy. <code>null</code> is a
|
|
182 * valid argument.
|
|
183 * @param contentType the type for which the strategy is registered
|
|
184 * @deprecated since 3.1, use
|
|
185 * {@link ITextViewerExtension2#prependAutoEditStrategy(IAutoEditStrategy, String)} and
|
|
186 * {@link ITextViewerExtension2#removeAutoEditStrategy(IAutoEditStrategy, String)} instead
|
|
187 */
|
|
188 void setAutoIndentStrategy(IAutoIndentStrategy strategy, String contentType);
|
|
189
|
|
190 /**
|
|
191 * Sets this viewer's text hover for the given content type.
|
|
192 * <p>
|
|
193 * This method has been replaced by {@link ITextViewerExtension2#setTextHover(ITextHover, String, int)}.
|
|
194 * It is now equivalent to
|
|
195 * <pre>
|
134
|
196 * ITextViewerExtension2 extension= cast(ITextViewerExtension2) document;
|
129
|
197 * extension.setTextHover(textViewerHover, contentType, ITextViewerExtension2#DEFAULT_HOVER_STATE_MASK);
|
|
198 * </pre>
|
|
199 *
|
|
200 *
|
|
201 * @param textViewerHover the new hover. <code>null</code> is a valid
|
|
202 * argument.
|
|
203 * @param contentType the type for which the hover is registered
|
|
204 */
|
|
205 void setTextHover(ITextHover textViewerHover, String contentType);
|
|
206
|
|
207 /**
|
|
208 * Activates the installed plug-ins. If the plug-ins are already activated
|
|
209 * this call has no effect.
|
|
210 */
|
|
211 void activatePlugins();
|
|
212
|
|
213 /**
|
|
214 * Resets the installed plug-ins. If plug-ins change their state or
|
|
215 * behavior over the course of time, this method causes them to be set
|
|
216 * back to their initial state and behavior. E.g., if an {@link IUndoManager}
|
|
217 * has been installed on this text viewer, the manager's list of remembered
|
|
218 * text editing operations is removed.
|
|
219 */
|
|
220 void resetPlugins();
|
|
221
|
|
222
|
|
223
|
|
224 /* ---------- listeners ------------- */
|
|
225
|
|
226 /**
|
|
227 * Adds the given view port listener to this viewer. The listener
|
|
228 * is informed about all changes to the visible area of this viewer.
|
|
229 * If the listener is already registered with this viewer, this call
|
|
230 * has no effect.
|
|
231 *
|
|
232 * @param listener the listener to be added
|
|
233 */
|
|
234 void addViewportListener(IViewportListener listener);
|
|
235
|
|
236 /**
|
|
237 * Removes the given listener from this viewer's set of view port listeners.
|
|
238 * If the listener is not registered with this viewer, this call has
|
|
239 * no effect.
|
|
240 *
|
|
241 * @param listener the listener to be removed
|
|
242 */
|
|
243 void removeViewportListener(IViewportListener listener);
|
|
244
|
|
245 /**
|
|
246 * Adds a text listener to this viewer. If the listener is already registered
|
|
247 * with this viewer, this call has no effect.
|
|
248 *
|
|
249 * @param listener the listener to be added
|
|
250 */
|
|
251 void addTextListener(ITextListener listener);
|
|
252
|
|
253 /**
|
|
254 * Removes the given listener from this viewer's set of text listeners.
|
|
255 * If the listener is not registered with this viewer, this call has
|
|
256 * no effect.
|
|
257 *
|
|
258 * @param listener the listener to be removed
|
|
259 */
|
|
260 void removeTextListener(ITextListener listener);
|
|
261
|
|
262 /**
|
|
263 * Adds a text input listener to this viewer. If the listener is already registered
|
|
264 * with this viewer, this call has no effect.
|
|
265 *
|
|
266 * @param listener the listener to be added
|
|
267 */
|
|
268 void addTextInputListener(ITextInputListener listener);
|
|
269
|
|
270 /**
|
|
271 * Removes the given listener from this viewer's set of text input listeners.
|
|
272 * If the listener is not registered with this viewer, this call has
|
|
273 * no effect.
|
|
274 *
|
|
275 * @param listener the listener to be removed
|
|
276 */
|
|
277 void removeTextInputListener(ITextInputListener listener);
|
|
278
|
|
279
|
|
280
|
|
281 /* -------------- model manipulation ------------- */
|
|
282
|
|
283 /**
|
|
284 * Sets the given document as the text viewer's model and updates the
|
|
285 * presentation accordingly. An appropriate <code>TextEvent</code> is
|
|
286 * issued. This text event does not carry a related document event.
|
|
287 *
|
|
288 * @param document the viewer's new input document <code>null</code> if none
|
|
289 */
|
|
290 void setDocument(IDocument document);
|
|
291
|
|
292 /**
|
|
293 * Returns the text viewer's input document.
|
|
294 *
|
|
295 * @return the viewer's input document or <code>null</code> if none
|
|
296 */
|
|
297 IDocument getDocument();
|
|
298
|
|
299
|
|
300 /* -------------- event handling ----------------- */
|
|
301
|
|
302 /**
|
|
303 * Registers an event consumer with this viewer. This method has been
|
|
304 * replaces with the {@link dwt.custom.VerifyKeyListener}
|
|
305 * management methods in {@link ITextViewerExtension}.
|
|
306 *
|
|
307 * @param consumer the viewer's event consumer. <code>null</code> is a
|
|
308 * valid argument.
|
|
309 */
|
|
310 void setEventConsumer(IEventConsumer consumer);
|
|
311
|
|
312 /**
|
|
313 * Sets the editable state.
|
|
314 *
|
|
315 * @param editable the editable state
|
|
316 */
|
|
317 void setEditable(bool editable);
|
|
318
|
|
319 /**
|
|
320 * Returns whether the shown text can be manipulated.
|
|
321 *
|
|
322 * @return the viewer's editable state
|
|
323 */
|
|
324 bool isEditable();
|
|
325
|
|
326
|
|
327 /* ----------- visible region support ------------- */
|
|
328
|
|
329 /**
|
|
330 * Sets the given document as this viewer's model and
|
|
331 * exposes the specified region. An appropriate
|
|
332 * <code>TextEvent</code> is issued. The text event does not carry a
|
|
333 * related document event. This method is a convenience method for
|
|
334 * <code>setDocument(document);setVisibleRegion(offset, length)</code>.
|
|
335 *
|
|
336 * @param document the new input document or <code>null</code> if none
|
|
337 * @param modelRangeOffset the offset of the model range
|
|
338 * @param modelRangeLength the length of the model range
|
|
339 */
|
|
340 void setDocument(IDocument document, int modelRangeOffset, int modelRangeLength);
|
|
341
|
|
342 /**
|
|
343 * Defines and sets the region of this viewer's document which will be
|
|
344 * visible in the presentation. Every character inside the specified region
|
|
345 * is supposed to be visible in the viewer's widget after that call.
|
|
346 *
|
|
347 * @param offset the offset of the visible region
|
|
348 * @param length the length of the visible region
|
|
349 */
|
|
350 void setVisibleRegion(int offset, int length);
|
|
351
|
|
352 /**
|
|
353 * Resets the region of this viewer's document which is visible in the presentation.
|
|
354 * Afterwards, the whole input document is visible.
|
|
355 */
|
|
356 void resetVisibleRegion();
|
|
357
|
|
358 /**
|
|
359 * Returns the current visible region of this viewer's document. The result
|
|
360 * may differ from the argument passed to <code>setVisibleRegion</code> if
|
|
361 * the document has been modified since then. The visible region is supposed
|
|
362 * to be a consecutive region in viewer's input document and every character
|
|
363 * inside that region is supposed to visible in the viewer's widget.
|
|
364 * <p>
|
|
365 * Viewers implementing {@link ITextViewerExtension5} may be forced to
|
|
366 * change the fractions of the input document that are shown, in order to
|
|
367 * fulfill this contract.
|
|
368 *
|
|
369 * @return this viewer's current visible region
|
|
370 */
|
|
371 IRegion getVisibleRegion();
|
|
372
|
|
373 /**
|
|
374 * Returns whether a given range overlaps with the visible region of this
|
|
375 * viewer's document.
|
|
376 * <p>
|
|
377 * Viewers implementing {@link ITextViewerExtension5}may be forced to
|
|
378 * change the fractions of the input document that are shown in order to
|
|
379 * fulfill this request. This is because the overlap is supposed to be
|
|
380 * without gaps.
|
|
381 *
|
|
382 * @param offset the offset
|
|
383 * @param length the length
|
|
384 * @return <code>true</code> if the specified range overlaps with the
|
|
385 * visible region
|
|
386 */
|
|
387 bool overlapsWithVisibleRegion(int offset, int length);
|
|
388
|
|
389
|
|
390
|
|
391 /* ------------- presentation manipulation ----------- */
|
|
392
|
|
393 /**
|
|
394 * Applies the color information encoded in the given text presentation.
|
|
395 * <code>controlRedraw</code> tells this viewer whether it should take care of
|
|
396 * redraw management or not. If, e.g., this call is one in a sequence of multiple
|
|
397 * presentation calls, it is more appropriate to explicitly control redrawing at the
|
|
398 * beginning and the end of the sequence.
|
|
399 *
|
|
400 * @param presentation the presentation to be applied to this viewer
|
|
401 * @param controlRedraw indicates whether this viewer should manage redraws
|
|
402 */
|
|
403 void changeTextPresentation(TextPresentation presentation, bool controlRedraw);
|
|
404
|
|
405 /**
|
|
406 * Marks the currently applied text presentation as invalid. It is the
|
|
407 * viewer's responsibility to take any action it can to repair the text
|
|
408 * presentation.
|
|
409 * <p>
|
|
410 * See {@link ITextViewerExtension2#invalidateTextPresentation(int, int)}
|
|
411 * for a way to invalidate specific regions rather than the presentation as
|
|
412 * a whole.
|
|
413 *
|
|
414 * @since 2.0
|
|
415 */
|
|
416 void invalidateTextPresentation();
|
|
417
|
|
418 /**
|
|
419 * Applies the given color as text foreground color to this viewer's
|
|
420 * selection.
|
|
421 *
|
|
422 * @param color the color to be applied
|
|
423 */
|
|
424 void setTextColor(Color color);
|
|
425
|
|
426 /**
|
|
427 * Applies the given color as text foreground color to the specified section
|
|
428 * of this viewer. <code>controlRedraw</code> tells this viewer whether it
|
|
429 * should take care of redraw management or not.
|
|
430 *
|
|
431 * @param color the color to be applied
|
|
432 * @param offset the offset of the range to be changed
|
|
433 * @param length the length of the range to be changed
|
|
434 * @param controlRedraw indicates whether this viewer should manage redraws
|
|
435 */
|
|
436 void setTextColor(Color color, int offset, int length, bool controlRedraw);
|
|
437
|
|
438
|
|
439 /* --------- target handling and configuration ------------ */
|
|
440
|
|
441 /**
|
|
442 * Returns the text operation target of this viewer.
|
|
443 *
|
|
444 * @return the text operation target of this viewer
|
|
445 */
|
|
446 ITextOperationTarget getTextOperationTarget();
|
|
447
|
|
448 /**
|
|
449 * Returns the find/replace operation target of this viewer.
|
|
450 *
|
|
451 * @return the find/replace operation target of this viewer
|
|
452 */
|
|
453 IFindReplaceTarget getFindReplaceTarget();
|
|
454
|
|
455 /**
|
|
456 * Sets the strings that are used as prefixes when lines of the given content type
|
|
457 * are prefixed using the prefix text operation. The prefixes are considered equivalent.
|
|
458 * Inserting a prefix always inserts the defaultPrefixes[0].
|
|
459 * Removing a prefix removes all of the specified prefixes.
|
|
460 *
|
|
461 * @param defaultPrefixes the prefixes to be used
|
|
462 * @param contentType the content type for which the prefixes are specified
|
|
463 * @since 2.0
|
|
464 */
|
|
465 void setDefaultPrefixes(String[] defaultPrefixes, String contentType);
|
|
466
|
|
467 /**
|
|
468 * Sets the strings that are used as prefixes when lines of the given content type
|
|
469 * are shifted using the shift text operation. The prefixes are considered equivalent.
|
|
470 * Thus "\t" and " " can both be used as prefix characters.
|
|
471 * Shift right always inserts the indentPrefixes[0].
|
|
472 * Shift left removes all of the specified prefixes.
|
|
473 *
|
|
474 * @param indentPrefixes the prefixes to be used
|
|
475 * @param contentType the content type for which the prefixes are specified
|
|
476 */
|
|
477 void setIndentPrefixes(String[] indentPrefixes, String contentType);
|
|
478
|
|
479
|
|
480
|
|
481 /* --------- selection handling -------------- */
|
|
482
|
|
483 /**
|
|
484 * Sets the selection to the specified range.
|
168
|
485 *
|
129
|
486 * @param offset the offset of the selection range
|
|
487 * @param length the length of the selection range. A negative length places
|
|
488 * the caret at the visual start of the selection.
|
|
489 */
|
|
490 void setSelectedRange(int offset, int length);
|
|
491
|
|
492 /**
|
|
493 * Returns the range of the current selection in coordinates of this viewer's document.
|
|
494 *
|
|
495 * @return a <code>Point</code> with x as the offset and y as the length of the current selection
|
|
496 */
|
|
497 Point getSelectedRange();
|
|
498
|
|
499 /**
|
|
500 * Returns a selection provider dedicated to this viewer. Subsequent
|
|
501 * calls to this method return always the same selection provider.
|
|
502 *
|
|
503 * @return this viewer's selection provider
|
|
504 */
|
|
505 ISelectionProvider getSelectionProvider();
|
|
506
|
|
507
|
|
508 /* ------------- appearance manipulation --------------- */
|
|
509
|
|
510 /**
|
|
511 * Ensures that the given range is visible.
|
|
512 *
|
|
513 * @param offset the offset of the range to be revealed
|
|
514 * @param length the length of the range to be revealed
|
|
515 */
|
|
516 void revealRange(int offset, int length);
|
|
517
|
|
518 /**
|
|
519 * Scrolls the widget so that the given index is the line
|
|
520 * with the smallest line number of all visible lines.
|
|
521 *
|
|
522 * @param index the line which should become the top most line
|
|
523 */
|
|
524 void setTopIndex(int index);
|
|
525
|
|
526 /**
|
|
527 * Returns the visible line with the smallest line number.
|
|
528 *
|
|
529 * @return the number of the top most visible line
|
|
530 */
|
|
531 int getTopIndex();
|
|
532
|
|
533 /**
|
|
534 * Returns the document offset of the upper left corner of this viewer's view port.
|
|
535 *
|
|
536 * @return the upper left corner offset
|
|
537 */
|
|
538 int getTopIndexStartOffset();
|
|
539
|
|
540 /**
|
|
541 * Returns the visible line with the highest line number.
|
|
542 *
|
|
543 * @return the number of the bottom most line
|
|
544 */
|
|
545 int getBottomIndex();
|
|
546
|
|
547 /**
|
|
548 * Returns the document offset of the lower right
|
|
549 * corner of this viewer's view port. This is the visible character
|
|
550 * with the highest character position. If the content of this viewer
|
|
551 * is shorter, the position of the last character of the content is returned.
|
|
552 *
|
|
553 * @return the lower right corner offset
|
|
554 */
|
|
555 int getBottomIndexEndOffset();
|
|
556
|
|
557 /**
|
|
558 * Returns the vertical offset of the first visible line.
|
|
559 *
|
|
560 * @return the vertical offset of the first visible line
|
|
561 */
|
|
562 int getTopInset();
|
|
563 }
|