author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Wed, 12 Jun 2013 16:47:06 +0100 | |
branch | jv |
changeset 13170 | c9b815af5777 |
parent 12431 | 9f0c59c742d5 |
parent 12861 | 3106975dc3e1 |
child 13173 | e9da2324940d |
permissions | -rw-r--r-- |
9983 | 1 |
" |
10070 | 2 |
COPYRIGHT (c) 2010 by Jan Vrany, SWING Research Group. CTU in Prague |
3 |
All Rights Reserved |
|
9983 | 4 |
|
10070 | 5 |
Permission is hereby granted, free of charge, to any person |
6 |
obtaining a copy of this software and associated documentation |
|
7 |
files (the 'Software'), to deal in the Software without |
|
8 |
restriction, including without limitation the rights to use, |
|
9 |
copy, modify, merge, publish, distribute, sublicense, and/or sell |
|
10 |
copies of the Software, and to permit persons to whom the |
|
11 |
Software is furnished to do so, subject to the following |
|
12 |
conditions: |
|
13 |
||
14 |
The above copyright notice and this permission notice shall be |
|
15 |
included in all copies or substantial portions of the Software. |
|
16 |
||
17 |
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, |
|
18 |
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES |
|
19 |
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
|
20 |
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT |
|
21 |
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, |
|
22 |
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
|
23 |
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
|
24 |
OTHER DEALINGS IN THE SOFTWARE. |
|
9983 | 25 |
" |
26 |
"{ Package: 'stx:libtool' }" |
|
27 |
||
28 |
"{ NameSpace: Tools }" |
|
29 |
||
30 |
Object subclass:#CodeViewService |
|
31 |
instanceVariableNames:'enabled codeView textView gutterView' |
|
32 |
classVariableNames:'' |
|
33 |
poolDictionaries:'' |
|
34 |
category:'Interface-CodeView' |
|
35 |
! |
|
36 |
||
37 |
!CodeViewService class methodsFor:'documentation'! |
|
38 |
||
39 |
copyright |
|
40 |
" |
|
10070 | 41 |
COPYRIGHT (c) 2010 by Jan Vrany, SWING Research Group. CTU in Prague |
42 |
All Rights Reserved |
|
43 |
||
44 |
Permission is hereby granted, free of charge, to any person |
|
45 |
obtaining a copy of this software and associated documentation |
|
46 |
files (the 'Software'), to deal in the Software without |
|
47 |
restriction, including without limitation the rights to use, |
|
48 |
copy, modify, merge, publish, distribute, sublicense, and/or sell |
|
49 |
copies of the Software, and to permit persons to whom the |
|
50 |
Software is furnished to do so, subject to the following |
|
51 |
conditions: |
|
9983 | 52 |
|
10070 | 53 |
The above copyright notice and this permission notice shall be |
54 |
included in all copies or substantial portions of the Software. |
|
55 |
||
56 |
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, |
|
57 |
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES |
|
58 |
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
|
59 |
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT |
|
60 |
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, |
|
61 |
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
|
62 |
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
|
63 |
OTHER DEALINGS IN THE SOFTWARE. |
|
9983 | 64 |
" |
11182
90f2879a3926
CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents:
11172
diff
changeset
|
65 |
! |
90f2879a3926
CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents:
11172
diff
changeset
|
66 |
|
90f2879a3926
CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents:
11172
diff
changeset
|
67 |
documentation |
90f2879a3926
CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents:
11172
diff
changeset
|
68 |
" |
90f2879a3926
CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents:
11172
diff
changeset
|
69 |
A base class for CodeView2 services. A 'service' is an extension |
90f2879a3926
CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents:
11172
diff
changeset
|
70 |
mechanism for CodeView2. Once plugged in, service gets informed |
90f2879a3926
CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents:
11172
diff
changeset
|
71 |
about changes in the text and it also may intercept events. |
90f2879a3926
CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents:
11172
diff
changeset
|
72 |
|
90f2879a3926
CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents:
11172
diff
changeset
|
73 |
See concrete subclasses how to use and implement code services. |
90f2879a3926
CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents:
11172
diff
changeset
|
74 |
|
90f2879a3926
CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents:
11172
diff
changeset
|
75 |
[author:] |
90f2879a3926
CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents:
11172
diff
changeset
|
76 |
Jan Vrany <jan.vrany@fit.cvut.cz> |
90f2879a3926
CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents:
11172
diff
changeset
|
77 |
|
90f2879a3926
CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents:
11172
diff
changeset
|
78 |
[instance variables:] |
90f2879a3926
CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents:
11172
diff
changeset
|
79 |
|
90f2879a3926
CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents:
11172
diff
changeset
|
80 |
[class variables:] |
90f2879a3926
CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents:
11172
diff
changeset
|
81 |
|
90f2879a3926
CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents:
11172
diff
changeset
|
82 |
[see also:] |
90f2879a3926
CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents:
11172
diff
changeset
|
83 |
|
90f2879a3926
CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents:
11172
diff
changeset
|
84 |
" |
9983 | 85 |
! ! |
86 |
||
87 |
!CodeViewService class methodsFor:'instance creation'! |
|
88 |
||
89 |
new |
|
90 |
"return an initialized instance" |
|
91 |
||
92 |
^ self basicNew initialize. |
|
93 |
! ! |
|
94 |
||
95 |
!CodeViewService class methodsFor:'accessing'! |
|
96 |
||
97 |
availableServices |
|
98 |
||
99 |
^self allSubclasses select: |
|
10414 | 100 |
[:cls|cls isAbstract not and:[cls allRequiredServicesAvailable and:[cls isAvailable]]]. |
9983 | 101 |
|
102 |
" |
|
103 |
Tools::CodeViewService availableServices |
|
104 |
" |
|
105 |
||
106 |
"Created: / 07-03-2010 / 13:42:40 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
10414 | 107 |
"Modified: / 27-07-2011 / 11:49:50 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
9983 | 108 |
! |
109 |
||
110 |
label |
|
111 |
"Answers short label - for UI" |
|
112 |
||
113 |
^self class name |
|
114 |
||
115 |
"Created: / 07-03-2010 / 13:58:58 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
10414 | 116 |
! |
117 |
||
12134
a2f71b97f850
Services are not installed according their priority - its a hack, but...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12128
diff
changeset
|
118 |
priority |
a2f71b97f850
Services are not installed according their priority - its a hack, but...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12128
diff
changeset
|
119 |
"Answers a priority of the service. Services with higher priority |
a2f71b97f850
Services are not installed according their priority - its a hack, but...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12128
diff
changeset
|
120 |
will get the event notification before ones with lower priority. |
a2f71b97f850
Services are not installed according their priority - its a hack, but...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12128
diff
changeset
|
121 |
Therefore, a lower-priority service might not get the event if high |
a2f71b97f850
Services are not installed according their priority - its a hack, but...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12128
diff
changeset
|
122 |
priority service processes it" |
a2f71b97f850
Services are not installed according their priority - its a hack, but...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12128
diff
changeset
|
123 |
|
a2f71b97f850
Services are not installed according their priority - its a hack, but...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12128
diff
changeset
|
124 |
^ 5 |
a2f71b97f850
Services are not installed according their priority - its a hack, but...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12128
diff
changeset
|
125 |
|
a2f71b97f850
Services are not installed according their priority - its a hack, but...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12128
diff
changeset
|
126 |
"Created: / 01-02-2012 / 10:28:47 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
a2f71b97f850
Services are not installed according their priority - its a hack, but...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12128
diff
changeset
|
127 |
! |
a2f71b97f850
Services are not installed according their priority - its a hack, but...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12128
diff
changeset
|
128 |
|
10414 | 129 |
requiredServices |
130 |
||
131 |
"Returns a list of services required for myself to work |
|
132 |
correctly. A list should contain class names of the services |
|
133 |
(as not all services may be loaded in)" |
|
134 |
||
135 |
^#() |
|
136 |
||
137 |
"Created: / 27-07-2011 / 11:39:41 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
138 |
! ! |
|
139 |
||
140 |
!CodeViewService class methodsFor:'queries'! |
|
141 |
||
142 |
allRequiredServicesAvailable |
|
143 |
||
144 |
| cls | |
|
145 |
||
146 |
^self requiredServices allSatisfy:[:clsName| |
|
147 |
cls := Smalltalk at: clsName. |
|
148 |
cls notNil and:[cls allRequiredServicesAvailable and:[cls isAvailable]] |
|
149 |
]. |
|
150 |
||
151 |
"Created: / 27-07-2011 / 11:49:26 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
9983 | 152 |
! ! |
153 |
||
154 |
!CodeViewService class methodsFor:'registering'! |
|
155 |
||
156 |
registerIn: aCodeView |
|
157 |
||
158 |
^self new |
|
159 |
registerIn: aCodeView; |
|
160 |
yourself. |
|
161 |
||
162 |
"Created: / 07-03-2010 / 13:50:16 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
163 |
! ! |
|
164 |
||
165 |
!CodeViewService class methodsFor:'testing'! |
|
166 |
||
167 |
isAbstract |
|
168 |
||
169 |
^self == Tools::CodeViewService |
|
170 |
||
171 |
"Created: / 07-03-2010 / 13:41:43 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
172 |
! |
|
173 |
||
174 |
isAvailable |
|
175 |
||
176 |
^true |
|
177 |
||
178 |
"Created: / 03-04-2011 / 23:07:02 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
10414 | 179 |
! |
180 |
||
181 |
isAvailableFor: applicationClass |
|
182 |
||
183 |
"Returns true if given service may be used in |
|
184 |
given application class." |
|
185 |
||
186 |
^true |
|
187 |
||
188 |
"Created: / 27-07-2011 / 11:45:39 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
9983 | 189 |
! ! |
190 |
||
191 |
!CodeViewService methodsFor:'accessing'! |
|
192 |
||
10414 | 193 |
application |
194 |
||
195 |
^codeView application |
|
196 |
||
197 |
"Created: / 27-07-2011 / 12:11:19 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
198 |
! |
|
199 |
||
9983 | 200 |
enabled |
201 |
^ enabled |
|
202 |
! |
|
203 |
||
204 |
enabled:aBoolean |
|
205 |
enabled := aBoolean. |
|
206 |
! |
|
207 |
||
208 |
label |
|
209 |
||
210 |
^self class label |
|
211 |
||
212 |
"Created: / 07-03-2010 / 14:03:31 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
10498 | 213 |
! |
214 |
||
215 |
service: serviceClassName |
|
216 |
||
217 |
^codeView services detect:[:service|service class name == serviceClassName] ifNone:[nil] |
|
218 |
||
219 |
"Created: / 05-08-2011 / 11:48:13 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
220 |
! |
|
221 |
||
222 |
syntaxHighlighter |
|
223 |
||
224 |
"Returns a syntax highligter class or nil. The highlighting |
|
225 |
process gather all syntaxHighlighterClasses from all services |
|
226 |
and then use them one by one to highlight the text. Individual |
|
227 |
services may override this method to provide additional |
|
228 |
highliging of the source code" |
|
229 |
||
230 |
^nil |
|
231 |
||
232 |
"Created: / 05-08-2011 / 10:49:05 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
9983 | 233 |
! ! |
234 |
||
235 |
!CodeViewService methodsFor:'change & update'! |
|
236 |
||
237 |
update: aspect with: param from: sender |
|
238 |
||
239 |
"Get updated whenever something changes in the code view. |
|
240 |
Subclasses may override this" |
|
241 |
||
242 |
"Intentionally left blank here" |
|
243 |
||
244 |
"Created: / 06-03-2010 / 19:23:05 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
245 |
! ! |
|
246 |
||
247 |
!CodeViewService methodsFor:'event handling'! |
|
248 |
||
249 |
buttonMotion: button x:x y:y in: view |
|
250 |
"Handles an event in given view (a subview of codeView). |
|
10589 | 251 |
If the method returns true, it has eaten the event and it will not be processed |
9983 | 252 |
by the view." |
253 |
||
254 |
^false |
|
255 |
||
256 |
"Created: / 06-03-2010 / 20:17:18 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
257 |
"Modified: / 17-06-2011 / 13:05:58 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
10589 | 258 |
"Modified (comment): / 18-08-2011 / 15:57:40 / cg" |
9983 | 259 |
! |
260 |
||
261 |
buttonPress: button x:x y:y in: view |
|
262 |
"Handles an event in given view (a subview of codeView). |
|
10589 | 263 |
If the method returns true, it has eaten the event and it will not be processed |
9983 | 264 |
by the view." |
265 |
||
266 |
^false |
|
267 |
||
268 |
"Created: / 06-03-2010 / 20:36:54 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
269 |
"Modified: / 17-06-2011 / 13:06:09 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
10589 | 270 |
"Modified (comment): / 18-08-2011 / 15:57:36 / cg" |
9983 | 271 |
! |
272 |
||
12861
3106975dc3e1
class: Tools::CodeViewService
Claus Gittinger <cg@exept.de>
parents:
11182
diff
changeset
|
273 |
buttonRelease: button x:x y:y in: view |
3106975dc3e1
class: Tools::CodeViewService
Claus Gittinger <cg@exept.de>
parents:
11182
diff
changeset
|
274 |
"Handles an event in given view (a subview of codeView). |
3106975dc3e1
class: Tools::CodeViewService
Claus Gittinger <cg@exept.de>
parents:
11182
diff
changeset
|
275 |
If the method returns true, it has eaten the event and it will not be processed |
3106975dc3e1
class: Tools::CodeViewService
Claus Gittinger <cg@exept.de>
parents:
11182
diff
changeset
|
276 |
by the view." |
3106975dc3e1
class: Tools::CodeViewService
Claus Gittinger <cg@exept.de>
parents:
11182
diff
changeset
|
277 |
|
3106975dc3e1
class: Tools::CodeViewService
Claus Gittinger <cg@exept.de>
parents:
11182
diff
changeset
|
278 |
^false |
3106975dc3e1
class: Tools::CodeViewService
Claus Gittinger <cg@exept.de>
parents:
11182
diff
changeset
|
279 |
! |
3106975dc3e1
class: Tools::CodeViewService
Claus Gittinger <cg@exept.de>
parents:
11182
diff
changeset
|
280 |
|
9983 | 281 |
keyPress:key x:x y:y in: view |
282 |
"Handles an event in given view (a subview of codeView). |
|
10589 | 283 |
If the method returns true, it has eaten the event and it will not be processed |
9983 | 284 |
by the view." |
285 |
||
286 |
^false |
|
287 |
||
288 |
"Created: / 06-03-2010 / 20:34:44 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
289 |
"Modified: / 17-06-2011 / 13:06:24 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
10589 | 290 |
"Modified (comment): / 18-08-2011 / 15:57:28 / cg" |
9983 | 291 |
! |
292 |
||
293 |
keyRelease: key x: x y: y in: view |
|
294 |
"Handles an event in given view (a subview of codeView). |
|
10589 | 295 |
If the method returns true, it has eaten the event and it will not be processed |
9983 | 296 |
by the view." |
297 |
||
298 |
^false |
|
299 |
||
300 |
"Created: / 06-03-2010 / 20:35:09 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
301 |
"Modified: / 17-06-2011 / 13:06:29 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
10589 | 302 |
"Modified (comment): / 18-08-2011 / 15:57:33 / cg" |
10227 | 303 |
! |
304 |
||
305 |
linesDeletedFrom: start to: end |
|
306 |
||
307 |
"Created: / 06-07-2011 / 17:14:23 / jv" |
|
308 |
! |
|
309 |
||
310 |
linesInsertedFrom: start to: end |
|
311 |
||
312 |
"Created: / 06-07-2011 / 17:14:31 / jv" |
|
313 |
! |
|
314 |
||
315 |
linesModifiedFrom: start to: end |
|
316 |
||
317 |
"Created: / 06-07-2011 / 17:14:36 / jv" |
|
11182
90f2879a3926
CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents:
11172
diff
changeset
|
318 |
! |
90f2879a3926
CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents:
11172
diff
changeset
|
319 |
|
90f2879a3926
CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents:
11172
diff
changeset
|
320 |
viewRealized |
90f2879a3926
CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents:
11172
diff
changeset
|
321 |
"Sent when a code view has been realized. May be overriden |
90f2879a3926
CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents:
11172
diff
changeset
|
322 |
by subclasses" |
90f2879a3926
CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents:
11172
diff
changeset
|
323 |
|
90f2879a3926
CodeView2 service refactoring: CodeHighlightingService's background
vrany
parents:
11172
diff
changeset
|
324 |
"Created: / 23-01-2012 / 10:38:20 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
9983 | 325 |
! ! |
326 |
||
327 |
!CodeViewService methodsFor:'initialization'! |
|
328 |
||
329 |
initialize |
|
330 |
"Invoked when a new instance is created." |
|
331 |
||
332 |
||
333 |
"/ please change as required (and remove this comment) |
|
334 |
"/ enabled := nil. |
|
335 |
"/ codeView := nil. |
|
336 |
"/ textView := nil. |
|
337 |
||
338 |
super initialize. |
|
339 |
||
340 |
"Modified: / 03-09-2010 / 22:29:22 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
341 |
! ! |
|
342 |
||
11172 | 343 |
!CodeViewService methodsFor:'misc'! |
344 |
||
345 |
showInfo: aString |
|
346 |
||
347 |
codeView showInfo: aString |
|
348 |
||
349 |
"Created: / 06-03-2010 / 19:34:51 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
350 |
"Created: / 21-01-2012 / 12:44:22 / cg" |
|
351 |
! ! |
|
352 |
||
9983 | 353 |
!CodeViewService methodsFor:'redrawing'! |
354 |
||
12128
a7ff7d66ee85
Improvements in LintHighlighter, few fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12125
diff
changeset
|
355 |
drawAnnotationIcon:icon atX:x y:y width:w height:h |
a7ff7d66ee85
Improvements in LintHighlighter, few fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12125
diff
changeset
|
356 |
|dy dx| |
a7ff7d66ee85
Improvements in LintHighlighter, few fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12125
diff
changeset
|
357 |
|
a7ff7d66ee85
Improvements in LintHighlighter, few fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12125
diff
changeset
|
358 |
dx := ((w - icon width) / 2) rounded. |
a7ff7d66ee85
Improvements in LintHighlighter, few fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12125
diff
changeset
|
359 |
dy := ((h - icon height) / 2) rounded. |
a7ff7d66ee85
Improvements in LintHighlighter, few fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12125
diff
changeset
|
360 |
icon |
a7ff7d66ee85
Improvements in LintHighlighter, few fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12125
diff
changeset
|
361 |
displayOn:gutterView |
a7ff7d66ee85
Improvements in LintHighlighter, few fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12125
diff
changeset
|
362 |
x:x + dx |
a7ff7d66ee85
Improvements in LintHighlighter, few fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12125
diff
changeset
|
363 |
y:y - h + dy + 4. |
a7ff7d66ee85
Improvements in LintHighlighter, few fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12125
diff
changeset
|
364 |
|
a7ff7d66ee85
Improvements in LintHighlighter, few fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12125
diff
changeset
|
365 |
"Modified: / 30-01-2012 / 16:01:20 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
a7ff7d66ee85
Improvements in LintHighlighter, few fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12125
diff
changeset
|
366 |
! |
a7ff7d66ee85
Improvements in LintHighlighter, few fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12125
diff
changeset
|
367 |
|
9983 | 368 |
drawLine:lineNo in: view atX:x y:y width: w height:h from:startCol to:endColOrNil with:fg and:bg |
369 |
||
370 |
"Called by both gutterView and textView (well, not yet) to |
|
371 |
allow services to draw custom things on text view. |
|
372 |
Ask JV what the args means if unsure (I'm lazy to document |
|
373 |
them, now it is just an experiment...)" |
|
374 |
||
375 |
"Intentionally left blank, to be overriden by subclasses" |
|
376 |
||
377 |
"Created: / 17-06-2011 / 13:49:44 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
378 |
! ! |
|
379 |
||
380 |
!CodeViewService methodsFor:'registering'! |
|
381 |
||
382 |
registerIn: aCodeView |
|
383 |
||
384 |
"Installs myself in aCodeView" |
|
385 |
||
386 |
codeView := aCodeView. |
|
387 |
codeView addDependent: self. |
|
388 |
textView := aCodeView textView. |
|
389 |
gutterView := aCodeView gutterView. |
|
390 |
enabled := true. |
|
391 |
||
392 |
"Created: / 06-03-2010 / 19:21:18 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
393 |
"Modified: / 17-06-2011 / 13:07:03 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
394 |
! |
|
395 |
||
396 |
unregister |
|
397 |
||
398 |
"Uninstall myself from my codeView" |
|
399 |
||
400 |
codeView removeDependent: self. |
|
401 |
codeView := nil. |
|
402 |
textView := nil. |
|
403 |
||
404 |
"Created: / 06-03-2010 / 19:21:23 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
405 |
"Modified: / 17-06-2011 / 12:57:40 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
406 |
! ! |
|
407 |
||
408 |
!CodeViewService methodsFor:'testing'! |
|
409 |
||
410 |
isEnabled |
|
411 |
||
412 |
^enabled == true |
|
413 |
||
414 |
"Created: / 07-03-2010 / 13:47:41 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
415 |
! ! |
|
416 |
||
417 |
!CodeViewService class methodsFor:'documentation'! |
|
418 |
||
12128
a7ff7d66ee85
Improvements in LintHighlighter, few fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12125
diff
changeset
|
419 |
version |
12134
a2f71b97f850
Services are not installed according their priority - its a hack, but...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12128
diff
changeset
|
420 |
^ '$Id: Tools__CodeViewService.st 7860 2012-02-01 10:42:29Z vranyj1 $' |
12128
a7ff7d66ee85
Improvements in LintHighlighter, few fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12125
diff
changeset
|
421 |
! |
a7ff7d66ee85
Improvements in LintHighlighter, few fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12125
diff
changeset
|
422 |
|
9983 | 423 |
version_CVS |
12861
3106975dc3e1
class: Tools::CodeViewService
Claus Gittinger <cg@exept.de>
parents:
11182
diff
changeset
|
424 |
^ '$Header: /cvs/stx/stx/libtool/Tools__CodeViewService.st,v 1.9 2013-06-06 12:03:57 cg Exp $' |
9983 | 425 |
! |
426 |
||
12431
9f0c59c742d5
Added LintRuleSettingsApplication and LintRuleEditDialog to define user-defined rule sets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12134
diff
changeset
|
427 |
version_HG |
9f0c59c742d5
Added LintRuleSettingsApplication and LintRuleEditDialog to define user-defined rule sets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12134
diff
changeset
|
428 |
|
9f0c59c742d5
Added LintRuleSettingsApplication and LintRuleEditDialog to define user-defined rule sets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12134
diff
changeset
|
429 |
^ '$Changeset: <not expanded> $' |
9f0c59c742d5
Added LintRuleSettingsApplication and LintRuleEditDialog to define user-defined rule sets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12134
diff
changeset
|
430 |
! |
9f0c59c742d5
Added LintRuleSettingsApplication and LintRuleEditDialog to define user-defined rule sets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12134
diff
changeset
|
431 |
|
9983 | 432 |
version_SVN |
12861
3106975dc3e1
class: Tools::CodeViewService
Claus Gittinger <cg@exept.de>
parents:
11182
diff
changeset
|
433 |
^ '$Id: Tools__CodeViewService.st,v 1.9 2013-06-06 12:03:57 cg Exp $' |
9983 | 434 |
! ! |
12861
3106975dc3e1
class: Tools::CodeViewService
Claus Gittinger <cg@exept.de>
parents:
11182
diff
changeset
|
435 |