129
|
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 * Port to the D programming language:
|
|
11 * Frank Benoit <benoit@tionex.de>
|
|
12 *******************************************************************************/
|
|
13 module dwtx.jface.text.source.IAnnotationAccessExtension;
|
|
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.ISourceViewer; // packageimport
|
|
38 import dwtx.jface.text.source.AnnotationModel; // packageimport
|
|
39 import dwtx.jface.text.source.ILineDifferExtension2; // packageimport
|
|
40 import dwtx.jface.text.source.IAnnotationModelListener; // packageimport
|
|
41 import dwtx.jface.text.source.IVerticalRuler; // packageimport
|
|
42 import dwtx.jface.text.source.DefaultAnnotationHover; // packageimport
|
|
43 import dwtx.jface.text.source.SourceViewer; // packageimport
|
|
44 import dwtx.jface.text.source.SourceViewerConfiguration; // packageimport
|
|
45 import dwtx.jface.text.source.AnnotationBarHoverManager; // packageimport
|
|
46 import dwtx.jface.text.source.CompositeRuler; // packageimport
|
|
47 import dwtx.jface.text.source.ImageUtilities; // packageimport
|
|
48 import dwtx.jface.text.source.VisualAnnotationModel; // packageimport
|
|
49 import dwtx.jface.text.source.IAnnotationModel; // packageimport
|
|
50 import dwtx.jface.text.source.ISourceViewerExtension3; // packageimport
|
|
51 import dwtx.jface.text.source.ILineDiffInfo; // packageimport
|
|
52 import dwtx.jface.text.source.VerticalRulerEvent; // packageimport
|
|
53 import dwtx.jface.text.source.ChangeRulerColumn; // packageimport
|
|
54 import dwtx.jface.text.source.ILineDiffer; // packageimport
|
|
55 import dwtx.jface.text.source.AnnotationModelEvent; // packageimport
|
|
56 import dwtx.jface.text.source.AnnotationColumn; // packageimport
|
|
57 import dwtx.jface.text.source.AnnotationRulerColumn; // packageimport
|
|
58 import dwtx.jface.text.source.IAnnotationHoverExtension; // packageimport
|
|
59 import dwtx.jface.text.source.AbstractRulerColumn; // packageimport
|
|
60 import dwtx.jface.text.source.ISourceViewerExtension; // packageimport
|
|
61 import dwtx.jface.text.source.AnnotationMap; // packageimport
|
|
62 import dwtx.jface.text.source.IVerticalRulerInfo; // packageimport
|
|
63 import dwtx.jface.text.source.IAnnotationModelExtension2; // packageimport
|
|
64 import dwtx.jface.text.source.LineRange; // packageimport
|
|
65 import dwtx.jface.text.source.IAnnotationAccessExtension2; // packageimport
|
|
66 import dwtx.jface.text.source.VerticalRuler; // packageimport
|
|
67 import dwtx.jface.text.source.JFaceTextMessages; // packageimport
|
|
68 import dwtx.jface.text.source.IOverviewRuler; // 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.GC;
|
|
81 import dwt.graphics.Rectangle;
|
|
82 import dwt.widgets.Canvas;
|
|
83
|
|
84 /**
|
|
85 * Extension interface for {@link dwtx.jface.text.source.IAnnotationAccess}.<p>
|
|
86 * This interface replaces the methods of <code>IAnnotationAccess</code>.<p>
|
|
87 * This interface provides
|
|
88 * <ul>
|
|
89 * <li> a label for the annotation type of a given annotation</li>
|
|
90 * <li> the paint layer of a given annotation</li>
|
|
91 * <li> means to paint a given annotation</li>
|
|
92 * <li> information about the type hierarchy of the annotation type of a given annotation</li>
|
|
93 * <ul>.
|
|
94 *
|
|
95 * @see dwtx.jface.text.source.IAnnotationAccess
|
|
96 * @since 3.0
|
|
97 */
|
|
98 public interface IAnnotationAccessExtension {
|
|
99
|
|
100 /**
|
|
101 * The default annotation layer.
|
|
102 */
|
|
103 static final int DEFAULT_LAYER= IAnnotationPresentation.DEFAULT_LAYER;
|
|
104
|
|
105 /**
|
|
106 * Returns the label for the given annotation's type.
|
|
107 *
|
|
108 * @param annotation the annotation
|
|
109 * @return the label the given annotation's type or <code>null</code> if no such label exists
|
|
110 */
|
|
111 String getTypeLabel(Annotation annotation);
|
|
112
|
|
113 /**
|
|
114 * Returns the layer for given annotation. Annotations are considered
|
|
115 * being located at layers and are considered being painted starting with
|
|
116 * layer 0 upwards. Thus an annotation at layer 5 will be drawn on top of
|
|
117 * all co-located annotations at the layers 4 - 0.
|
|
118 *
|
|
119 * @param annotation the annotation
|
|
120 * @return the layer of the given annotation
|
|
121 */
|
|
122 int getLayer(Annotation annotation);
|
|
123
|
|
124 /**
|
|
125 * Draws a graphical representation of the given annotation within the given bounds.
|
|
126 * <p>
|
|
127 * <em>Note that this method is not used when drawing annotations on the editor's
|
|
128 * text widget. This is handled trough a {@link dwtx.jface.text.source.AnnotationPainter.IDrawingStrategy}.</em>
|
|
129 * </p>
|
|
130 * @param annotation the given annotation
|
|
131 * @param gc the drawing GC
|
|
132 * @param canvas the canvas to draw on
|
|
133 * @param bounds the bounds inside the canvas to draw on
|
|
134 */
|
|
135 void paint(Annotation annotation, GC gc, Canvas canvas, Rectangle bounds);
|
|
136
|
|
137 /**
|
|
138 * Returns <code>true</code> if painting <code>annotation</code> will produce something
|
|
139 * meaningful, <code>false</code> if not. E.g. if no image is available.
|
|
140 * <p>
|
|
141 * <em>Note that this method is not used when drawing annotations on the editor's
|
|
142 * text widget. This is handled trough a {@link dwtx.jface.text.source.AnnotationPainter.IDrawingStrategy}.</em>
|
|
143 * </p>
|
|
144 * @param annotation the annotation to check whether it can be painted
|
|
145 * @return <code>true</code> if painting <code>annotation</code> will succeed
|
|
146 */
|
|
147 bool isPaintable(Annotation annotation);
|
|
148
|
|
149 /**
|
|
150 * Returns <code>true</code> if the given annotation is of the given type
|
|
151 * or <code>false</code> otherwise.
|
|
152 *
|
|
153 * @param annotationType the annotation type
|
|
154 * @param potentialSupertype the potential super annotation type
|
|
155 * @return <code>true</code> if annotation type is a sub-type of the potential annotation super type
|
|
156 */
|
|
157 bool isSubtype(Object annotationType, Object potentialSupertype);
|
|
158
|
|
159 /**
|
|
160 * Returns the list of super types for the given annotation type. This does not include the type
|
|
161 * itself. The index in the array of super types indicates the length of the path in the hierarchy
|
|
162 * graph to the given annotation type.
|
|
163 *
|
|
164 * @param annotationType the annotation type to check
|
|
165 * @return the super types for the given annotation type
|
|
166 */
|
|
167 Object[] getSupertypes(Object annotationType);
|
|
168 }
|