Mercurial > projects > dwt2
comparison org.eclipse.jface.text/src/org/eclipse/jface/text/source/IAnnotationAccessExtension.d @ 12:bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sat, 14 Mar 2009 18:23:29 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
11:43904fec5dca | 12:bc29606a740c |
---|---|
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 org.eclipse.jface.text.source.IAnnotationAccessExtension; | |
14 | |
15 import org.eclipse.jface.text.source.ISharedTextColors; // packageimport | |
16 import org.eclipse.jface.text.source.ILineRange; // packageimport | |
17 import org.eclipse.jface.text.source.IAnnotationPresentation; // packageimport | |
18 import org.eclipse.jface.text.source.IVerticalRulerInfoExtension; // packageimport | |
19 import org.eclipse.jface.text.source.ICharacterPairMatcher; // packageimport | |
20 import org.eclipse.jface.text.source.TextInvocationContext; // packageimport | |
21 import org.eclipse.jface.text.source.LineChangeHover; // packageimport | |
22 import org.eclipse.jface.text.source.IChangeRulerColumn; // packageimport | |
23 import org.eclipse.jface.text.source.IAnnotationMap; // packageimport | |
24 import org.eclipse.jface.text.source.IAnnotationModelListenerExtension; // packageimport | |
25 import org.eclipse.jface.text.source.ISourceViewerExtension2; // packageimport | |
26 import org.eclipse.jface.text.source.IAnnotationHover; // packageimport | |
27 import org.eclipse.jface.text.source.ContentAssistantFacade; // packageimport | |
28 import org.eclipse.jface.text.source.IAnnotationAccess; // packageimport | |
29 import org.eclipse.jface.text.source.IVerticalRulerExtension; // packageimport | |
30 import org.eclipse.jface.text.source.IVerticalRulerColumn; // packageimport | |
31 import org.eclipse.jface.text.source.LineNumberRulerColumn; // packageimport | |
32 import org.eclipse.jface.text.source.MatchingCharacterPainter; // packageimport | |
33 import org.eclipse.jface.text.source.IAnnotationModelExtension; // packageimport | |
34 import org.eclipse.jface.text.source.ILineDifferExtension; // packageimport | |
35 import org.eclipse.jface.text.source.DefaultCharacterPairMatcher; // packageimport | |
36 import org.eclipse.jface.text.source.LineNumberChangeRulerColumn; // packageimport | |
37 import org.eclipse.jface.text.source.ISourceViewer; // packageimport | |
38 import org.eclipse.jface.text.source.AnnotationModel; // packageimport | |
39 import org.eclipse.jface.text.source.ILineDifferExtension2; // packageimport | |
40 import org.eclipse.jface.text.source.IAnnotationModelListener; // packageimport | |
41 import org.eclipse.jface.text.source.IVerticalRuler; // packageimport | |
42 import org.eclipse.jface.text.source.DefaultAnnotationHover; // packageimport | |
43 import org.eclipse.jface.text.source.SourceViewer; // packageimport | |
44 import org.eclipse.jface.text.source.SourceViewerConfiguration; // packageimport | |
45 import org.eclipse.jface.text.source.AnnotationBarHoverManager; // packageimport | |
46 import org.eclipse.jface.text.source.CompositeRuler; // packageimport | |
47 import org.eclipse.jface.text.source.ImageUtilities; // packageimport | |
48 import org.eclipse.jface.text.source.VisualAnnotationModel; // packageimport | |
49 import org.eclipse.jface.text.source.IAnnotationModel; // packageimport | |
50 import org.eclipse.jface.text.source.ISourceViewerExtension3; // packageimport | |
51 import org.eclipse.jface.text.source.ILineDiffInfo; // packageimport | |
52 import org.eclipse.jface.text.source.VerticalRulerEvent; // packageimport | |
53 import org.eclipse.jface.text.source.ChangeRulerColumn; // packageimport | |
54 import org.eclipse.jface.text.source.ILineDiffer; // packageimport | |
55 import org.eclipse.jface.text.source.AnnotationModelEvent; // packageimport | |
56 import org.eclipse.jface.text.source.AnnotationColumn; // packageimport | |
57 import org.eclipse.jface.text.source.AnnotationRulerColumn; // packageimport | |
58 import org.eclipse.jface.text.source.IAnnotationHoverExtension; // packageimport | |
59 import org.eclipse.jface.text.source.AbstractRulerColumn; // packageimport | |
60 import org.eclipse.jface.text.source.ISourceViewerExtension; // packageimport | |
61 import org.eclipse.jface.text.source.AnnotationMap; // packageimport | |
62 import org.eclipse.jface.text.source.IVerticalRulerInfo; // packageimport | |
63 import org.eclipse.jface.text.source.IAnnotationModelExtension2; // packageimport | |
64 import org.eclipse.jface.text.source.LineRange; // packageimport | |
65 import org.eclipse.jface.text.source.IAnnotationAccessExtension2; // packageimport | |
66 import org.eclipse.jface.text.source.VerticalRuler; // packageimport | |
67 import org.eclipse.jface.text.source.JFaceTextMessages; // packageimport | |
68 import org.eclipse.jface.text.source.IOverviewRuler; // packageimport | |
69 import org.eclipse.jface.text.source.Annotation; // packageimport | |
70 import org.eclipse.jface.text.source.IVerticalRulerListener; // packageimport | |
71 import org.eclipse.jface.text.source.ISourceViewerExtension4; // packageimport | |
72 import org.eclipse.jface.text.source.AnnotationPainter; // packageimport | |
73 import org.eclipse.jface.text.source.IAnnotationHoverExtension2; // packageimport | |
74 import org.eclipse.jface.text.source.OverviewRuler; // packageimport | |
75 import org.eclipse.jface.text.source.OverviewRulerHoverManager; // packageimport | |
76 | |
77 | |
78 import java.lang.all; | |
79 | |
80 import org.eclipse.swt.graphics.GC; | |
81 import org.eclipse.swt.graphics.Rectangle; | |
82 import org.eclipse.swt.widgets.Canvas; | |
83 | |
84 /** | |
85 * Extension interface for {@link org.eclipse.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 org.eclipse.jface.text.source.IAnnotationAccess | |
96 * @since 3.0 | |
97 */ | |
98 public interface IAnnotationAccessExtension { | |
99 | |
100 /** | |
101 * The default annotation layer. | |
102 */ | |
103 static const 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 org.eclipse.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 org.eclipse.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 } |