129
|
1 /*******************************************************************************
|
|
2 * Copyright (c) 2000, 2005 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.source.IVerticalRuler;
|
|
14
|
|
15 import dwt.dwthelper.utils;
|
|
16
|
|
17
|
|
18
|
|
19
|
|
20 import dwt.widgets.Composite;
|
|
21 import dwt.widgets.Control;
|
|
22 import dwtx.jface.text.ITextViewer;
|
|
23
|
|
24
|
|
25 /**
|
|
26 * This interface defines a visual component which may serve text viewers as an
|
|
27 * annotation presentation area. Implementers of this interface have to define
|
|
28 * the presentation modus. This can either depend on the connected viewer's view
|
|
29 * port or not. If the modus is view port dependent the ruler only shows those
|
|
30 * annotations that are attached to document regions that are visible in the
|
|
31 * view port. If independent, the presented annotations can also be attached to
|
|
32 * invisible document regions.
|
|
33 *
|
|
34 * This interfaces comprises three contracts:
|
|
35 * <ul>
|
|
36 * <li>The vertical ruler retrieves the annotations it presents from an
|
|
37 * annotation model.
|
|
38 * <li>The ruler is a visual component which must be integrated in a hierarchy
|
|
39 * of DWT controls.
|
|
40 * <li>The ruler provides interested clients with mapping and interaction
|
|
41 * information. This covers the mapping between coordinates of the ruler's
|
|
42 * control and line numbers based on the connected text viewer's document (see
|
|
43 * {@link dwtx.jface.text.source.IVerticalRulerInfo}).
|
|
44 * </ul>
|
|
45 * <p>
|
|
46 * In order to provide backward compatibility for clients of
|
|
47 * <code>IVerticalRuler</code>, extension interfaces are used as a means of
|
|
48 * evolution. The following extension interfaces exist:
|
|
49 * <ul>
|
|
50 * <li>{@link dwtx.jface.text.source.IVerticalRulerExtension} since
|
|
51 * version 2.0 introducing setters for font and mouse button activity location.</li>
|
|
52 * </ul></p>
|
|
53 * <p>
|
|
54 * Clients may implement this interface or use the default implementation
|
|
55 * provided by {@link dwtx.jface.text.source.CompositeRuler} and
|
|
56 * {@link dwtx.jface.text.source.VerticalRuler}.</p>
|
|
57 *
|
|
58 * @see dwtx.jface.text.source.IVerticalRulerExtension
|
|
59 * @see dwtx.jface.text.ITextViewer
|
|
60 */
|
|
61 public interface IVerticalRuler : IVerticalRulerInfo {
|
|
62
|
|
63 /**
|
|
64 * Associates an annotation model with this ruler.
|
|
65 * A value <code>null</code> is acceptable and clears the ruler.
|
|
66 *
|
|
67 * @param model the new annotation model, may be <code>null</code>
|
|
68 */
|
|
69 void setModel(IAnnotationModel model);
|
|
70
|
|
71 /**
|
|
72 * Returns the current annotation model of this ruler or <code>null</code>
|
|
73 * if the ruler has no model.
|
|
74 *
|
|
75 * @return this ruler's annotation model or <code>null</code> if there is no model
|
|
76 */
|
|
77 IAnnotationModel getModel();
|
|
78
|
|
79 /**
|
|
80 * Forces the vertical ruler to synchronize itself with its
|
|
81 * annotation model and its viewer's view port.
|
|
82 */
|
|
83 void update();
|
|
84
|
|
85 /**
|
|
86 * Creates the ruler's DWT control.
|
|
87 *
|
|
88 * @param parent the parent control of the ruler's control
|
|
89 * @param textViewer the text viewer to which this ruler belongs
|
|
90 * @return the ruler's DWT control
|
|
91 */
|
|
92 Control createControl(Composite parent, ITextViewer textViewer);
|
|
93 }
|