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.IOverviewRuler;
|
|
14
|
131
|
15 import dwtx.jface.text.source.ISharedTextColors; // packageimport
|
|
16 import dwtx.jface.text.source.ILineRange; // packageimport
|
|
17 import dwtx.jface.text.source.IAnnotationPresentation; // packageimport
|
|
18 import dwtx.jface.text.source.IVerticalRulerInfoExtension; // packageimport
|
|
19 import dwtx.jface.text.source.ICharacterPairMatcher; // packageimport
|
|
20 import dwtx.jface.text.source.TextInvocationContext; // packageimport
|
|
21 import dwtx.jface.text.source.LineChangeHover; // packageimport
|
|
22 import dwtx.jface.text.source.IChangeRulerColumn; // packageimport
|
|
23 import dwtx.jface.text.source.IAnnotationMap; // packageimport
|
|
24 import dwtx.jface.text.source.IAnnotationModelListenerExtension; // packageimport
|
|
25 import dwtx.jface.text.source.ISourceViewerExtension2; // packageimport
|
|
26 import dwtx.jface.text.source.IAnnotationHover; // packageimport
|
|
27 import dwtx.jface.text.source.ContentAssistantFacade; // packageimport
|
|
28 import dwtx.jface.text.source.IAnnotationAccess; // packageimport
|
|
29 import dwtx.jface.text.source.IVerticalRulerExtension; // packageimport
|
|
30 import dwtx.jface.text.source.IVerticalRulerColumn; // packageimport
|
|
31 import dwtx.jface.text.source.LineNumberRulerColumn; // packageimport
|
|
32 import dwtx.jface.text.source.MatchingCharacterPainter; // packageimport
|
|
33 import dwtx.jface.text.source.IAnnotationModelExtension; // packageimport
|
|
34 import dwtx.jface.text.source.ILineDifferExtension; // packageimport
|
|
35 import dwtx.jface.text.source.DefaultCharacterPairMatcher; // packageimport
|
|
36 import dwtx.jface.text.source.LineNumberChangeRulerColumn; // packageimport
|
|
37 import dwtx.jface.text.source.IAnnotationAccessExtension; // packageimport
|
|
38 import dwtx.jface.text.source.ISourceViewer; // packageimport
|
|
39 import dwtx.jface.text.source.AnnotationModel; // packageimport
|
|
40 import dwtx.jface.text.source.ILineDifferExtension2; // packageimport
|
|
41 import dwtx.jface.text.source.IAnnotationModelListener; // packageimport
|
|
42 import dwtx.jface.text.source.IVerticalRuler; // packageimport
|
|
43 import dwtx.jface.text.source.DefaultAnnotationHover; // packageimport
|
|
44 import dwtx.jface.text.source.SourceViewer; // packageimport
|
|
45 import dwtx.jface.text.source.SourceViewerConfiguration; // packageimport
|
|
46 import dwtx.jface.text.source.AnnotationBarHoverManager; // packageimport
|
|
47 import dwtx.jface.text.source.CompositeRuler; // packageimport
|
|
48 import dwtx.jface.text.source.ImageUtilities; // packageimport
|
|
49 import dwtx.jface.text.source.VisualAnnotationModel; // packageimport
|
|
50 import dwtx.jface.text.source.IAnnotationModel; // packageimport
|
|
51 import dwtx.jface.text.source.ISourceViewerExtension3; // packageimport
|
|
52 import dwtx.jface.text.source.ILineDiffInfo; // packageimport
|
|
53 import dwtx.jface.text.source.VerticalRulerEvent; // packageimport
|
|
54 import dwtx.jface.text.source.ChangeRulerColumn; // packageimport
|
|
55 import dwtx.jface.text.source.ILineDiffer; // packageimport
|
|
56 import dwtx.jface.text.source.AnnotationModelEvent; // packageimport
|
|
57 import dwtx.jface.text.source.AnnotationColumn; // packageimport
|
|
58 import dwtx.jface.text.source.AnnotationRulerColumn; // packageimport
|
|
59 import dwtx.jface.text.source.IAnnotationHoverExtension; // packageimport
|
|
60 import dwtx.jface.text.source.AbstractRulerColumn; // packageimport
|
|
61 import dwtx.jface.text.source.ISourceViewerExtension; // packageimport
|
|
62 import dwtx.jface.text.source.AnnotationMap; // packageimport
|
|
63 import dwtx.jface.text.source.IVerticalRulerInfo; // packageimport
|
|
64 import dwtx.jface.text.source.IAnnotationModelExtension2; // packageimport
|
|
65 import dwtx.jface.text.source.LineRange; // packageimport
|
|
66 import dwtx.jface.text.source.IAnnotationAccessExtension2; // packageimport
|
|
67 import dwtx.jface.text.source.VerticalRuler; // packageimport
|
|
68 import dwtx.jface.text.source.JFaceTextMessages; // packageimport
|
|
69 import dwtx.jface.text.source.Annotation; // packageimport
|
|
70 import dwtx.jface.text.source.IVerticalRulerListener; // packageimport
|
|
71 import dwtx.jface.text.source.ISourceViewerExtension4; // packageimport
|
|
72 import dwtx.jface.text.source.AnnotationPainter; // packageimport
|
|
73 import dwtx.jface.text.source.IAnnotationHoverExtension2; // packageimport
|
|
74 import dwtx.jface.text.source.OverviewRuler; // packageimport
|
|
75 import dwtx.jface.text.source.OverviewRulerHoverManager; // packageimport
|
|
76
|
|
77
|
129
|
78 import dwt.dwthelper.utils;
|
|
79
|
|
80 import dwt.graphics.Color;
|
|
81 import dwt.widgets.Control;
|
|
82
|
|
83 /**
|
|
84 * This interface defines a visual component which may serve
|
|
85 * text viewers as an overview annotation presentation area. This means,
|
|
86 * presentation of annotations is independent from the actual view port of
|
|
87 * the text viewer. The annotations of the viewer's whole document are
|
|
88 * visible in the overview ruler.
|
|
89 * <p>
|
|
90 * This interfaces embodies three contracts:
|
|
91 * <ul>
|
|
92 * <li> The overview ruler retrieves the annotations it presents from an annotation model.
|
|
93 * <li> The ruler is a visual component which must be integrated in a hierarchy of DWT controls.
|
|
94 * <li> The ruler provides interested clients with mapping and
|
|
95 * interaction information. This covers the mapping between
|
|
96 * coordinates of the ruler's control and line numbers based
|
|
97 * on the connected text viewer's document (<code>IVerticalRulerInfo</code>).
|
|
98 * </ul></p>
|
|
99 * <p>
|
|
100 * Clients may implement this interface or use the default implementation provided
|
|
101 * by <code>OverviewlRuler</code>.</p>
|
|
102 *
|
|
103 * @see dwtx.jface.text.ITextViewer
|
|
104 * @since 2.1
|
|
105 */
|
|
106 public interface IOverviewRuler : IVerticalRuler {
|
|
107
|
|
108 /**
|
|
109 * Returns whether there is an annotation an the given vertical coordinate. This
|
|
110 * method takes the compression factor of the overview ruler into account.
|
|
111 *
|
|
112 * @param y the y-coordinate
|
|
113 * @return <code>true</code> if there is an annotation, <code>false</code> otherwise
|
|
114 */
|
|
115 bool hasAnnotation(int y);
|
|
116
|
|
117 /**
|
|
118 * Returns the height of the visual presentation of an annotation in this
|
|
119 * overview ruler. Assumes that all annotations are represented using the
|
|
120 * same height.
|
|
121 *
|
|
122 * @return int the visual height of an annotation
|
|
123 */
|
|
124 int getAnnotationHeight();
|
|
125
|
|
126 /**
|
|
127 * Sets the color for the given annotation type in this overview ruler.
|
|
128 *
|
|
129 * @param annotationType the annotation type
|
|
130 * @param color the color
|
|
131 */
|
|
132 void setAnnotationTypeColor(Object annotationType, Color color);
|
|
133
|
|
134 /**
|
|
135 * Sets the drawing layer for the given annotation type in this overview ruler.
|
|
136 *
|
|
137 * @param annotationType the annotation type
|
|
138 * @param layer the drawing layer
|
|
139 */
|
|
140 void setAnnotationTypeLayer(Object annotationType, int layer);
|
|
141
|
|
142 /**
|
|
143 * Adds the given annotation type to this overview ruler. Starting with this
|
|
144 * call, annotations of the given type are shown in the overview ruler.
|
|
145 *
|
|
146 * @param annotationType the annotation type
|
|
147 */
|
|
148 void addAnnotationType(Object annotationType);
|
|
149
|
|
150 /**
|
|
151 * Removes the given annotation type from this overview ruler. Annotations
|
|
152 * of the given type are no longer shown in the overview ruler.
|
|
153 *
|
|
154 * @param annotationType the annotation type
|
|
155 */
|
|
156 void removeAnnotationType(Object annotationType);
|
|
157
|
|
158 /**
|
|
159 * Adds the given annotation type to the header of this ruler. Starting with
|
|
160 * this call, the presence of annotations is tracked and the header is drawn
|
|
161 * in the configured color.
|
|
162 *
|
|
163 * @param annotationType the annotation type to be tracked
|
|
164 */
|
|
165 void addHeaderAnnotationType(Object annotationType);
|
|
166
|
|
167 /**
|
|
168 * Removes the given annotation type from the header of this ruler. The
|
|
169 * presence of annotations of the given type is no longer tracked and the
|
|
170 * header is drawn in the default color, depending on the other configured
|
|
171 * configured annotation types.
|
|
172 *
|
|
173 * @param annotationType the annotation type to be removed
|
|
174 */
|
|
175 void removeHeaderAnnotationType(Object annotationType);
|
|
176
|
|
177 /**
|
|
178 * Returns this rulers header control. This is the little area between the
|
|
179 * top of the text widget and the top of this overview ruler.
|
|
180 *
|
|
181 * @return the header control of this overview ruler.
|
|
182 */
|
|
183 Control getHeaderControl();
|
|
184 }
|