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
|
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.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
|
|
81
|
|
82
|
|
83 import dwt.widgets.Composite;
|
|
84 import dwt.widgets.Control;
|
|
85 import dwtx.jface.text.ITextViewer;
|
|
86
|
|
87
|
|
88 /**
|
|
89 * This interface defines a visual component which may serve text viewers as an
|
|
90 * annotation presentation area. Implementers of this interface have to define
|
|
91 * the presentation modus. This can either depend on the connected viewer's view
|
|
92 * port or not. If the modus is view port dependent the ruler only shows those
|
|
93 * annotations that are attached to document regions that are visible in the
|
|
94 * view port. If independent, the presented annotations can also be attached to
|
|
95 * invisible document regions.
|
|
96 *
|
|
97 * This interfaces comprises three contracts:
|
|
98 * <ul>
|
|
99 * <li>The vertical ruler retrieves the annotations it presents from an
|
|
100 * annotation model.
|
|
101 * <li>The ruler is a visual component which must be integrated in a hierarchy
|
|
102 * of DWT controls.
|
|
103 * <li>The ruler provides interested clients with mapping and interaction
|
|
104 * information. This covers the mapping between coordinates of the ruler's
|
|
105 * control and line numbers based on the connected text viewer's document (see
|
|
106 * {@link dwtx.jface.text.source.IVerticalRulerInfo}).
|
|
107 * </ul>
|
|
108 * <p>
|
|
109 * In order to provide backward compatibility for clients of
|
|
110 * <code>IVerticalRuler</code>, extension interfaces are used as a means of
|
|
111 * evolution. The following extension interfaces exist:
|
|
112 * <ul>
|
|
113 * <li>{@link dwtx.jface.text.source.IVerticalRulerExtension} since
|
|
114 * version 2.0 introducing setters for font and mouse button activity location.</li>
|
|
115 * </ul></p>
|
|
116 * <p>
|
|
117 * Clients may implement this interface or use the default implementation
|
|
118 * provided by {@link dwtx.jface.text.source.CompositeRuler} and
|
|
119 * {@link dwtx.jface.text.source.VerticalRuler}.</p>
|
|
120 *
|
|
121 * @see dwtx.jface.text.source.IVerticalRulerExtension
|
|
122 * @see dwtx.jface.text.ITextViewer
|
|
123 */
|
|
124 public interface IVerticalRuler : IVerticalRulerInfo {
|
|
125
|
|
126 /**
|
|
127 * Associates an annotation model with this ruler.
|
|
128 * A value <code>null</code> is acceptable and clears the ruler.
|
|
129 *
|
|
130 * @param model the new annotation model, may be <code>null</code>
|
|
131 */
|
|
132 void setModel(IAnnotationModel model);
|
|
133
|
|
134 /**
|
|
135 * Returns the current annotation model of this ruler or <code>null</code>
|
|
136 * if the ruler has no model.
|
|
137 *
|
|
138 * @return this ruler's annotation model or <code>null</code> if there is no model
|
|
139 */
|
|
140 IAnnotationModel getModel();
|
|
141
|
|
142 /**
|
|
143 * Forces the vertical ruler to synchronize itself with its
|
|
144 * annotation model and its viewer's view port.
|
|
145 */
|
|
146 void update();
|
|
147
|
|
148 /**
|
|
149 * Creates the ruler's DWT control.
|
|
150 *
|
|
151 * @param parent the parent control of the ruler's control
|
|
152 * @param textViewer the text viewer to which this ruler belongs
|
|
153 * @return the ruler's DWT control
|
|
154 */
|
|
155 Control createControl(Composite parent, ITextViewer textViewer);
|
|
156 }
|