author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Wed, 09 Apr 2014 17:33:56 +0200 | |
changeset 14194 | efb533b63fee |
parent 14145 | 78c992303423 |
child 14321 | eaf5e19afbd7 |
permissions | -rw-r--r-- |
9985 | 1 |
" |
10072 | 2 |
COPYRIGHT (c) 2010 by Jan Vrany, SWING Research Group. CTU in Prague |
3 |
All Rights Reserved |
|
4 |
||
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. |
|
9985 | 25 |
" |
26 |
"{ Package: 'stx:libtool' }" |
|
27 |
||
28 |
"{ NameSpace: Tools }" |
|
29 |
||
30 |
SimpleView subclass:#CodeView2 |
|
13975
21b5fc56a638
Added Tools::CodeView2>>#flash
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13962
diff
changeset
|
31 |
instanceVariableNames:'gutterView textView textViewScroller methodHolder languageHolder |
21b5fc56a638
Added Tools::CodeView2>>#flash
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13962
diff
changeset
|
32 |
classHolder browserHolder codeAspect modifiedChannel |
21b5fc56a638
Added Tools::CodeView2>>#flash
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13962
diff
changeset
|
33 |
showGutterChannel showAcceptCancelBarChannel modeHolder |
21b5fc56a638
Added Tools::CodeView2>>#flash
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13962
diff
changeset
|
34 |
serviceManager services servicesFromClient syntaxElements |
21b5fc56a638
Added Tools::CodeView2>>#flash
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13962
diff
changeset
|
35 |
currentParseNodeHolder currentBlockNodeHolder |
21b5fc56a638
Added Tools::CodeView2>>#flash
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13962
diff
changeset
|
36 |
syntaxElementSelection highlightEmphasis diffMode |
21b5fc56a638
Added Tools::CodeView2>>#flash
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13962
diff
changeset
|
37 |
synchronizedCodeViews' |
21b5fc56a638
Added Tools::CodeView2>>#flash
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13962
diff
changeset
|
38 |
classVariableNames:'TraceSelectors' |
21b5fc56a638
Added Tools::CodeView2>>#flash
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13962
diff
changeset
|
39 |
poolDictionaries:'' |
21b5fc56a638
Added Tools::CodeView2>>#flash
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13962
diff
changeset
|
40 |
category:'Interface-CodeView' |
9985 | 41 |
! |
42 |
||
43 |
SimpleView subclass:#GutterView |
|
13975
21b5fc56a638
Added Tools::CodeView2>>#flash
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13962
diff
changeset
|
44 |
instanceVariableNames:'codeView textView textViewScroller widthAcceptCancel |
21b5fc56a638
Added Tools::CodeView2>>#flash
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13962
diff
changeset
|
45 |
widthAnnotations widthDiffInfo numberOfLines acceptColor |
21b5fc56a638
Added Tools::CodeView2>>#flash
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13962
diff
changeset
|
46 |
cancelColor diffColor menuHolder currentBlockNodeHolder |
21b5fc56a638
Added Tools::CodeView2>>#flash
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13962
diff
changeset
|
47 |
showLineNumbers' |
21b5fc56a638
Added Tools::CodeView2>>#flash
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13962
diff
changeset
|
48 |
classVariableNames:'' |
21b5fc56a638
Added Tools::CodeView2>>#flash
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13962
diff
changeset
|
49 |
poolDictionaries:'' |
21b5fc56a638
Added Tools::CodeView2>>#flash
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13962
diff
changeset
|
50 |
privateIn:CodeView2 |
9985 | 51 |
! |
52 |
||
53 |
CodeView subclass:#TextView |
|
13975
21b5fc56a638
Added Tools::CodeView2>>#flash
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13962
diff
changeset
|
54 |
instanceVariableNames:'listOriginal codeView gutterView diffMode deletedLines |
21b5fc56a638
Added Tools::CodeView2>>#flash
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13962
diff
changeset
|
55 |
insertedLines lastFirstLine changedLines scrollInProgress |
21b5fc56a638
Added Tools::CodeView2>>#flash
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13962
diff
changeset
|
56 |
originDiffText emptyLines changedDiffText suppressNotifications |
21b5fc56a638
Added Tools::CodeView2>>#flash
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13962
diff
changeset
|
57 |
reallyModifiedChannel' |
21b5fc56a638
Added Tools::CodeView2>>#flash
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13962
diff
changeset
|
58 |
classVariableNames:'' |
21b5fc56a638
Added Tools::CodeView2>>#flash
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13962
diff
changeset
|
59 |
poolDictionaries:'' |
21b5fc56a638
Added Tools::CodeView2>>#flash
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13962
diff
changeset
|
60 |
privateIn:CodeView2 |
9985 | 61 |
! |
62 |
||
63 |
!CodeView2 class methodsFor:'documentation'! |
|
64 |
||
65 |
copyright |
|
66 |
" |
|
10072 | 67 |
COPYRIGHT (c) 2010 by Jan Vrany, SWING Research Group. CTU in Prague |
68 |
All Rights Reserved |
|
69 |
||
70 |
Permission is hereby granted, free of charge, to any person |
|
71 |
obtaining a copy of this software and associated documentation |
|
72 |
files (the 'Software'), to deal in the Software without |
|
73 |
restriction, including without limitation the rights to use, |
|
74 |
copy, modify, merge, publish, distribute, sublicense, and/or sell |
|
75 |
copies of the Software, and to permit persons to whom the |
|
76 |
Software is furnished to do so, subject to the following |
|
77 |
conditions: |
|
78 |
||
79 |
The above copyright notice and this permission notice shall be |
|
80 |
included in all copies or substantial portions of the Software. |
|
81 |
||
82 |
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, |
|
83 |
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES |
|
84 |
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
|
85 |
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT |
|
86 |
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, |
|
87 |
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
|
88 |
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
|
89 |
OTHER DEALINGS IN THE SOFTWARE. |
|
9985 | 90 |
" |
91 |
! ! |
|
92 |
||
93 |
!CodeView2 class methodsFor:'initialization'! |
|
94 |
||
95 |
initialize |
|
96 |
"Invoked at system start or when the class is dynamically loaded." |
|
97 |
||
98 |
"/ please change as required (and remove this comment) |
|
99 |
||
100 |
TraceSelectors := IdentitySet new. |
|
101 |
||
102 |
"Modified: / 14-02-2010 / 15:36:11 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
103 |
! ! |
|
104 |
||
105 |
!CodeView2 class methodsFor:'debugging'! |
|
106 |
||
107 |
trace: aSelector |
|
108 |
||
109 |
TraceSelectors add: aSelector |
|
110 |
||
111 |
"Created: / 14-02-2010 / 09:26:30 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
112 |
! |
|
113 |
||
114 |
untrace: aSelector |
|
115 |
||
116 |
TraceSelectors remove: aSelector ifAbsent:[] |
|
117 |
||
118 |
"Created: / 14-02-2010 / 09:50:31 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
119 |
! |
|
120 |
||
121 |
untraceAll |
|
122 |
||
123 |
TraceSelectors := IdentitySet new |
|
124 |
||
125 |
"Created: / 14-02-2010 / 09:53:32 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
126 |
! ! |
|
127 |
||
128 |
!CodeView2 class methodsFor:'examples'! |
|
129 |
||
130 |
example1 |
|
131 |
||
132 |
| window codeView | |
|
133 |
||
134 |
||
135 |
window := StandardSystemView new. |
|
136 |
window extent: 300 @ 300. |
|
137 |
window label: 'CodeView2 example1'. |
|
138 |
||
139 |
codeView := Tools::CodeView2 in: window. |
|
140 |
codeView |
|
141 |
origin: 0.1 @ 0.1 |
|
142 |
corner: 0.9 @ 0.9. |
|
143 |
||
144 |
||
145 |
window open. |
|
146 |
||
147 |
"Created: / 02-09-2009 / 21:48:56 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
148 |
! ! |
|
149 |
||
150 |
!CodeView2 class methodsFor:'menu specs'! |
|
151 |
||
10293 | 152 |
debugMenu |
153 |
"This resource specification was automatically generated |
|
154 |
by the MenuEditor of ST/X." |
|
155 |
||
156 |
"Do not manually edit this!! If it is corrupted, |
|
157 |
the MenuEditor may not be able to read the specification." |
|
158 |
||
159 |
" |
|
160 |
MenuEditor new openOnClass:Tools::CodeView2 andSelector:#editMenu_stxStyle |
|
161 |
(Menu new fromLiteralArrayEncoding:(Tools::CodeView2 editMenu_stxStyle)) startUp |
|
162 |
" |
|
163 |
||
164 |
<resource: #menu> |
|
165 |
||
166 |
^ |
|
167 |
#(Menu |
|
168 |
( |
|
169 |
(MenuItem |
|
170 |
label: 'Inspect ' |
|
171 |
itemValue: inspectView |
|
172 |
translateLabel: true |
|
173 |
) |
|
174 |
(MenuItem |
|
175 |
label: 'Inspect Syntax Elements' |
|
176 |
itemValue: inspectSyntaxElements |
|
177 |
translateLabel: true |
|
178 |
) |
|
179 |
(MenuItem |
|
11398
84d3987c0155
better search (for variables)
Claus Gittinger <cg@exept.de>
parents:
11393
diff
changeset
|
180 |
label: 'Inspect Selected Selector' |
10293 | 181 |
itemValue: inspectSelectedSelector |
182 |
translateLabel: true |
|
183 |
) |
|
184 |
) |
|
185 |
nil |
|
186 |
nil |
|
187 |
) |
|
188 |
||
189 |
"Created: / 08-07-2011 / 13:36:02 / cg" |
|
190 |
! |
|
191 |
||
9985 | 192 |
editMenu |
193 |
"This resource specification was automatically generated |
|
194 |
by the MenuEditor of ST/X." |
|
195 |
||
196 |
"Do not manually edit this!! If it is corrupted, |
|
197 |
the MenuEditor may not be able to read the specification." |
|
198 |
||
199 |
" |
|
200 |
MenuEditor new openOnClass:Tools::CodeView2 andSelector:#editMenu |
|
201 |
(Menu new fromLiteralArrayEncoding:(Tools::CodeView2 editMenu)) startUp |
|
202 |
" |
|
203 |
||
10290 | 204 |
UserPreferences current eclipseStyleMenus ifTrue:[ |
205 |
^ self editMenu_eclipseStyle |
|
206 |
]. |
|
207 |
^ self editMenu_stxStyle |
|
208 |
||
209 |
"Modified: / 08-07-2011 / 13:23:35 / cg" |
|
210 |
! |
|
211 |
||
212 |
editMenu_eclipseStyle |
|
213 |
"This resource specification was automatically generated |
|
214 |
by the MenuEditor of ST/X." |
|
215 |
||
216 |
"Do not manually edit this!! If it is corrupted, |
|
217 |
the MenuEditor may not be able to read the specification." |
|
218 |
||
11311 | 219 |
|
10290 | 220 |
" |
11311 | 221 |
MenuEditor new openOnClass:Tools::CodeView2 andSelector:#editMenu_eclipseStyle |
222 |
(Menu new fromLiteralArrayEncoding:(Tools::CodeView2 editMenu_eclipseStyle)) startUp |
|
10290 | 223 |
" |
224 |
||
9985 | 225 |
<resource: #menu> |
226 |
||
13813 | 227 |
^ |
9985 | 228 |
#(Menu |
13942 | 229 |
( |
230 |
(MenuItem |
|
231 |
label: 'Implementors...' |
|
232 |
itemValue: browseImplementorsOfIt |
|
233 |
submenuChannel: implementorsMenu |
|
234 |
shortcutKey: ImplementorsOfIt |
|
235 |
) |
|
236 |
(MenuItem |
|
237 |
label: 'Senders...' |
|
238 |
itemValue: browseSendersOfIt |
|
239 |
submenuChannel: sendersMenu |
|
240 |
shortcutKey: SendersOfIt |
|
241 |
) |
|
242 |
(MenuItem |
|
243 |
label: 'Refactor' |
|
244 |
nameKey: refactor |
|
245 |
isVisible: false |
|
246 |
shortcutKey: Shift |
|
247 |
) |
|
248 |
(MenuItem |
|
249 |
label: '-' |
|
250 |
) |
|
251 |
(MenuItem |
|
252 |
label: 'Accept' |
|
253 |
itemValue: accept |
|
254 |
shortcutKey: Accept |
|
255 |
) |
|
256 |
(MenuItem |
|
257 |
label: '-' |
|
258 |
) |
|
259 |
(MenuItem |
|
260 |
label: 'Cut' |
|
261 |
itemValue: cut |
|
262 |
shortcutKey: Cut |
|
263 |
) |
|
264 |
(MenuItem |
|
265 |
label: 'Copy' |
|
266 |
itemValue: copySelection |
|
267 |
shortcutKey: Copy |
|
268 |
) |
|
269 |
(MenuItem |
|
270 |
label: 'Paste' |
|
271 |
itemValue: pasteOrReplace |
|
272 |
shortcutKey: Paste |
|
273 |
) |
|
274 |
(MenuItem |
|
275 |
label: '-' |
|
276 |
) |
|
277 |
(MenuItem |
|
278 |
label: 'Undo' |
|
279 |
itemValue: undo |
|
280 |
shortcutKey: Undo |
|
281 |
) |
|
282 |
(MenuItem |
|
283 |
label: 'Redo' |
|
284 |
itemValue: redo |
|
285 |
shortcutKey: Redo |
|
286 |
) |
|
287 |
(MenuItem |
|
288 |
label: '-' |
|
289 |
) |
|
290 |
(MenuItem |
|
291 |
label: 'Do it' |
|
292 |
itemValue: doIt |
|
293 |
shortcutKey: DoIt |
|
294 |
) |
|
295 |
(MenuItem |
|
296 |
label: 'Print it' |
|
297 |
itemValue: printIt |
|
298 |
shortcutKey: PrintIt |
|
299 |
) |
|
300 |
(MenuItem |
|
301 |
label: 'Inspect it' |
|
302 |
itemValue: inspectIt |
|
303 |
shortcutKey: InspectIt |
|
304 |
) |
|
305 |
(MenuItem |
|
306 |
label: 'Profile it' |
|
307 |
itemValue: profileIt |
|
308 |
shortcutKey: InspectIt |
|
309 |
) |
|
310 |
(MenuItem |
|
311 |
label: '-' |
|
312 |
) |
|
313 |
(MenuItem |
|
314 |
label: 'Show Gutter' |
|
315 |
nameKey: ShowGutter |
|
316 |
indication: showGutterChannel |
|
317 |
) |
|
318 |
(MenuItem |
|
319 |
label: 'More' |
|
320 |
nameKey: More |
|
321 |
) |
|
322 |
(MenuItem |
|
323 |
label: 'Services' |
|
324 |
submenuChannel: servicesMenu |
|
325 |
) |
|
326 |
(MenuItem |
|
327 |
label: 'Debug' |
|
328 |
submenuChannel: debugMenu |
|
329 |
) |
|
330 |
) |
|
331 |
nil |
|
332 |
nil |
|
9985 | 333 |
) |
10290 | 334 |
! |
335 |
||
336 |
editMenu_stxStyle |
|
337 |
"This resource specification was automatically generated |
|
338 |
by the MenuEditor of ST/X." |
|
339 |
||
340 |
"Do not manually edit this!! If it is corrupted, |
|
341 |
the MenuEditor may not be able to read the specification." |
|
342 |
||
11241
e3d6bdc7a790
changed: #editMenu_stxStyle
Claus Gittinger <cg@exept.de>
parents:
11220
diff
changeset
|
343 |
|
10290 | 344 |
" |
345 |
MenuEditor new openOnClass:Tools::CodeView2 andSelector:#editMenu_stxStyle |
|
346 |
(Menu new fromLiteralArrayEncoding:(Tools::CodeView2 editMenu_stxStyle)) startUp |
|
347 |
" |
|
348 |
||
349 |
<resource: #menu> |
|
350 |
||
351 |
^ |
|
352 |
#(Menu |
|
353 |
( |
|
354 |
(MenuItem |
|
355 |
label: 'Undo' |
|
356 |
itemValue: undo |
|
357 |
translateLabel: true |
|
358 |
shortcutKey: Undo |
|
359 |
) |
|
360 |
(MenuItem |
|
361 |
label: 'Again' |
|
362 |
itemValue: again |
|
363 |
translateLabel: true |
|
364 |
shortcutKey: Again |
|
365 |
) |
|
366 |
(MenuItem |
|
367 |
label: '-' |
|
368 |
) |
|
369 |
(MenuItem |
|
370 |
label: 'Cut' |
|
371 |
itemValue: cut |
|
372 |
translateLabel: true |
|
373 |
shortcutKey: Cut |
|
374 |
) |
|
375 |
(MenuItem |
|
376 |
label: 'Copy' |
|
377 |
itemValue: copySelection |
|
378 |
translateLabel: true |
|
379 |
shortcutKey: Copy |
|
380 |
) |
|
381 |
(MenuItem |
|
382 |
label: 'Paste' |
|
383 |
itemValue: pasteOrReplace |
|
384 |
translateLabel: true |
|
385 |
shortcutKey: Paste |
|
386 |
) |
|
387 |
(MenuItem |
|
388 |
label: '-' |
|
389 |
) |
|
390 |
(MenuItem |
|
391 |
label: 'DoIt' |
|
392 |
itemValue: doIt |
|
393 |
translateLabel: true |
|
394 |
shortcutKey: DoIt |
|
395 |
) |
|
396 |
(MenuItem |
|
397 |
label: 'PrintIt' |
|
398 |
itemValue: printIt |
|
399 |
translateLabel: true |
|
400 |
shortcutKey: PrintIt |
|
401 |
) |
|
402 |
(MenuItem |
|
403 |
label: 'InspectIt' |
|
404 |
itemValue: inspectIt |
|
405 |
translateLabel: true |
|
406 |
shortcutKey: InspectIt |
|
407 |
) |
|
408 |
(MenuItem |
|
409 |
label: '-' |
|
410 |
) |
|
411 |
(MenuItem |
|
412 |
label: 'Accept' |
|
413 |
itemValue: accept |
|
414 |
translateLabel: true |
|
415 |
shortcutKey: Accept |
|
416 |
) |
|
417 |
(MenuItem |
|
418 |
label: '-' |
|
11353
5cb468550ad2
changed: #editMenu_stxStyle
Claus Gittinger <cg@exept.de>
parents:
11311
diff
changeset
|
419 |
isVisible: false |
10290 | 420 |
) |
421 |
(MenuItem |
|
422 |
label: 'Refactor' |
|
11311 | 423 |
nameKey: refactor |
10290 | 424 |
translateLabel: true |
425 |
isVisible: false |
|
426 |
shortcutKey: Shift |
|
427 |
) |
|
428 |
(MenuItem |
|
429 |
label: 'Services' |
|
430 |
translateLabel: true |
|
11241
e3d6bdc7a790
changed: #editMenu_stxStyle
Claus Gittinger <cg@exept.de>
parents:
11220
diff
changeset
|
431 |
isVisible: false |
10290 | 432 |
submenuChannel: servicesMenu |
433 |
) |
|
434 |
(MenuItem |
|
11353
5cb468550ad2
changed: #editMenu_stxStyle
Claus Gittinger <cg@exept.de>
parents:
11311
diff
changeset
|
435 |
label: '=' |
10290 | 436 |
) |
437 |
(MenuItem |
|
438 |
label: 'More' |
|
439 |
nameKey: More |
|
440 |
translateLabel: true |
|
441 |
shortcutKey: Ctrl |
|
442 |
) |
|
443 |
) |
|
444 |
nil |
|
445 |
nil |
|
446 |
) |
|
11353
5cb468550ad2
changed: #editMenu_stxStyle
Claus Gittinger <cg@exept.de>
parents:
11311
diff
changeset
|
447 |
|
5cb468550ad2
changed: #editMenu_stxStyle
Claus Gittinger <cg@exept.de>
parents:
11311
diff
changeset
|
448 |
"Modified: / 02-03-2012 / 19:53:19 / cg" |
9985 | 449 |
! ! |
450 |
||
13813 | 451 |
!CodeView2 methodsFor:'* As yet uncategorized *'! |
452 |
||
453 |
defaultFileNameForSave |
|
454 |
self halt:'please define defaultFileNameForSave here'. |
|
455 |
||
456 |
"Created: / 11-05-2012 / 15:38:31 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
457 |
! ! |
|
458 |
||
9985 | 459 |
!CodeView2 methodsFor:'accessing'! |
460 |
||
461 |
acceptAction:aBlock |
|
462 |
||
463 |
textView acceptAction: aBlock |
|
464 |
||
465 |
"Modified: / 01-08-2010 / 20:40:17 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
466 |
! |
|
467 |
||
10224 | 468 |
breakpoints |
13097 | 469 |
|s| |
470 |
||
471 |
(s := self breakpointService) notNil ifTrue:[ |
|
472 |
^ s breakpoints |
|
10224 | 473 |
]. |
10767 | 474 |
^ nil |
10224 | 475 |
|
476 |
"Created: / 06-07-2011 / 18:05:35 / jv" |
|
10767 | 477 |
"Modified: / 06-10-2011 / 14:13:53 / cg" |
10224 | 478 |
! |
479 |
||
10245 | 480 |
browser |
481 |
||
482 |
^self browserHolder value |
|
483 |
||
484 |
"Created: / 07-07-2011 / 12:25:59 / Jan Vrany <jan.vrant@fit.cvut,cz>" |
|
485 |
! |
|
486 |
||
9985 | 487 |
codeAspect |
13587
0f06b4a66ae7
Refactoring after moving codeAspect to EditTextView.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13584
diff
changeset
|
488 |
^ textView codeAspect |
0f06b4a66ae7
Refactoring after moving codeAspect to EditTextView.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13584
diff
changeset
|
489 |
|
11706 | 490 |
"Modified: / 27-07-2012 / 22:22:27 / cg" |
13587
0f06b4a66ae7
Refactoring after moving codeAspect to EditTextView.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13584
diff
changeset
|
491 |
"Modified: / 27-09-2013 / 10:01:11 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
9985 | 492 |
! |
493 |
||
13587
0f06b4a66ae7
Refactoring after moving codeAspect to EditTextView.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13584
diff
changeset
|
494 |
codeAspect: aSymbol |
0f06b4a66ae7
Refactoring after moving codeAspect to EditTextView.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13584
diff
changeset
|
495 |
^ textView codeAspect: aSymbol |
11706 | 496 |
|
497 |
"Modified: / 27-07-2012 / 22:32:19 / cg" |
|
13587
0f06b4a66ae7
Refactoring after moving codeAspect to EditTextView.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13584
diff
changeset
|
498 |
"Modified: / 27-09-2013 / 10:01:23 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
9985 | 499 |
! |
500 |
||
13813 | 501 |
compilerClass |
502 |
^textView compilerClass |
|
503 |
||
504 |
"Created: / 10-05-2012 / 23:47:34 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
505 |
! |
|
506 |
||
507 |
compilerClass: aClass |
|
508 |
textView compilerClass: aClass |
|
509 |
||
510 |
"Created: / 10-05-2012 / 23:47:25 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
511 |
! |
|
512 |
||
9985 | 513 |
contents |
514 |
||
515 |
^textView contents |
|
516 |
||
517 |
"Created: / 14-02-2010 / 22:13:47 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
518 |
! |
|
519 |
||
520 |
contents: aStringOrStringCollection |
|
521 |
||
522 |
textView contents: aStringOrStringCollection. |
|
523 |
"/self update:#value with: aStringOrStringCollection from: textView model |
|
524 |
||
10330 | 525 |
"Modified: / 19-07-2011 / 13:18:42 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
9985 | 526 |
! |
527 |
||
13813 | 528 |
contents: aStringOrStringCollection clear: clearPrevious |
529 |
"Set the contents. If clearPrevous is true, then |
|
530 |
previous original text is cleared and set to given one. |
|
531 |
(so the text is considered not modified)" |
|
532 |
||
533 |
textView contents: aStringOrStringCollection clear: clearPrevious |
|
534 |
||
535 |
"Modified: / 19-07-2011 / 13:18:42 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
536 |
"Created: / 17-02-2012 / 00:33:24 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
537 |
! |
|
538 |
||
539 |
currentParseNode |
|
14101 | 540 |
|sel| |
541 |
||
542 |
sel := self syntaxElementSelection. |
|
543 |
sel isNil ifTrue:[^ nil]. |
|
544 |
^ sel node |
|
13813 | 545 |
|
546 |
"Created: / 21-02-2012 / 14:20:12 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
14057
94bd4556cf5d
Fixes in CodeNavigationService - semi-modal navigation should work again.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14050
diff
changeset
|
547 |
"Modified: / 25-02-2014 / 22:06:54 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
13813 | 548 |
! |
549 |
||
550 |
delegate: anObject |
|
551 |
||
552 |
super delegate: anObject. |
|
553 |
self textView delegate: anObject. |
|
554 |
self gutterView delegate: anObject. |
|
555 |
||
556 |
"Created: / 11-05-2012 / 10:29:56 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
557 |
! |
|
558 |
||
9985 | 559 |
diffMode |
560 |
^ diffMode |
|
561 |
! |
|
562 |
||
563 |
diffMode:aBoolean |
|
564 |
diffMode := aBoolean. |
|
565 |
textView diffMode: aBoolean |
|
566 |
||
567 |
"Modified: / 08-04-2011 / 20:50:51 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
568 |
! |
|
569 |
||
14194
efb533b63fee
Tools::CodeView2>>#editedLanguage:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14145
diff
changeset
|
570 |
editedLanguage: aProgrammingLanguage |
efb533b63fee
Tools::CodeView2>>#editedLanguage:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14145
diff
changeset
|
571 |
self languageHolder value: aProgrammingLanguage |
efb533b63fee
Tools::CodeView2>>#editedLanguage:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14145
diff
changeset
|
572 |
|
efb533b63fee
Tools::CodeView2>>#editedLanguage:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14145
diff
changeset
|
573 |
"Created: / 09-04-2014 / 14:49:38 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
efb533b63fee
Tools::CodeView2>>#editedLanguage:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14145
diff
changeset
|
574 |
! |
efb533b63fee
Tools::CodeView2>>#editedLanguage:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14145
diff
changeset
|
575 |
|
12914 | 576 |
editedMethodOrClass:aMethodOrClass |
12950 | 577 |
textView editedMethodOrClass:aMethodOrClass. |
578 |
aMethodOrClass isBehavior ifFalse:[ |
|
579 |
self methodHolder value:aMethodOrClass |
|
580 |
]. |
|
12914 | 581 |
! |
582 |
||
9985 | 583 |
font |
584 |
||
585 |
^textView font |
|
586 |
||
587 |
"Created: / 16-02-2010 / 10:26:31 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
588 |
! |
|
589 |
||
590 |
font: aFont |
|
591 |
||
592 |
^textView font: aFont |
|
593 |
||
594 |
"Created: / 16-02-2010 / 10:26:26 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
595 |
! |
|
596 |
||
597 |
mode |
|
598 |
||
599 |
^self modeHolder value |
|
600 |
||
601 |
"Created: / 13-06-2011 / 10:49:52 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
602 |
! |
|
603 |
||
604 |
mode: aSymbol |
|
11706 | 605 |
"is this the same as codeAspect ?" |
9985 | 606 |
|
607 |
self assert: (#(expression method) includes: aSymbol). |
|
608 |
||
609 |
^self modeHolder value: aSymbol |
|
610 |
||
611 |
"Created: / 13-06-2011 / 10:50:28 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
612 |
"Modified: / 15-06-2011 / 16:37:45 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
11706 | 613 |
"Modified (comment): / 27-07-2012 / 22:19:49 / cg" |
9985 | 614 |
! |
615 |
||
10409 | 616 |
model |
617 |
||
618 |
^textView model. |
|
619 |
||
620 |
"Created: / 27-07-2011 / 12:47:18 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
621 |
! |
|
622 |
||
623 |
model: aValueModel |
|
624 |
||
625 |
|oldValue newValue| |
|
626 |
||
627 |
textView model notNil ifTrue:[ |
|
13942 | 628 |
oldValue := textView model value. |
629 |
textView model removeDependent:self. |
|
10409 | 630 |
]. |
631 |
textView model: aValueModel. |
|
632 |
textView model notNil ifTrue:[ |
|
13942 | 633 |
textView model addDependent:self. |
10409 | 634 |
]. |
635 |
newValue := textView model value. |
|
636 |
oldValue ~~ newValue ifTrue:[ |
|
13942 | 637 |
self update:#value with:newValue from:textView model. |
10409 | 638 |
]. |
639 |
||
13813 | 640 |
"Modified: / 17-03-2012 / 16:11:19 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
10409 | 641 |
! |
642 |
||
9985 | 643 |
modified |
644 |
"return true if text was modified" |
|
645 |
||
10245 | 646 |
^ self modifiedChannel value |
647 |
||
648 |
"Modified: / 07-07-2011 / 12:15:43 / Jan Vrany <jan.vrant@fit.cvut,cz>" |
|
9985 | 649 |
! |
650 |
||
651 |
modified:aBoolean |
|
652 |
"set/clear the modified flag" |
|
653 |
||
10245 | 654 |
self modifiedChannel value:aBoolean |
655 |
||
656 |
"Modified: / 14-02-1997 / 16:44:05 / cg" |
|
657 |
"Modified: / 07-07-2011 / 12:15:39 / Jan Vrany <jan.vrant@fit.cvut,cz>" |
|
9985 | 658 |
! |
659 |
||
660 |
scrolledView |
|
661 |
||
662 |
^self |
|
663 |
||
664 |
"Created: / 14-02-2010 / 22:54:56 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
665 |
! |
|
666 |
||
10487 | 667 |
services |
10767 | 668 |
^ services ? #() |
10487 | 669 |
|
670 |
"Created: / 05-08-2011 / 10:14:59 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
10767 | 671 |
"Modified (format): / 06-10-2011 / 14:11:11 / cg" |
10487 | 672 |
! |
673 |
||
10755 | 674 |
services:aCollectionOfServices |
675 |
"allow setting of the services (instances); |
|
676 |
this is needed for FileBrowser, to setup a codeView2 without Smalltalk-specific |
|
677 |
services" |
|
678 |
||
10767 | 679 |
servicesFromClient := true. |
680 |
services := aCollectionOfServices. |
|
681 |
||
682 |
"Created: / 06-10-2011 / 14:15:36 / cg" |
|
10755 | 683 |
! |
684 |
||
10793
c19380a197aa
Added channel for controlling visibility of accept/cancel
vrany
parents:
10791
diff
changeset
|
685 |
showAcceptCancelBar |
c19380a197aa
Added channel for controlling visibility of accept/cancel
vrany
parents:
10791
diff
changeset
|
686 |
|
c19380a197aa
Added channel for controlling visibility of accept/cancel
vrany
parents:
10791
diff
changeset
|
687 |
^showAcceptCancelBarChannel value |
c19380a197aa
Added channel for controlling visibility of accept/cancel
vrany
parents:
10791
diff
changeset
|
688 |
|
c19380a197aa
Added channel for controlling visibility of accept/cancel
vrany
parents:
10791
diff
changeset
|
689 |
"Created: / 10-10-2011 / 16:25:53 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
c19380a197aa
Added channel for controlling visibility of accept/cancel
vrany
parents:
10791
diff
changeset
|
690 |
! |
c19380a197aa
Added channel for controlling visibility of accept/cancel
vrany
parents:
10791
diff
changeset
|
691 |
|
9985 | 692 |
showGutter |
693 |
||
694 |
^showGutterChannel value |
|
695 |
||
696 |
"Created: / 23-06-2010 / 19:37:47 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
697 |
! |
|
698 |
||
699 |
synchronizeWith: aCodeView |
|
700 |
||
701 |
self assert: aCodeView ~= self. |
|
702 |
(synchronizedCodeViews includes: aCodeView) ifTrue:[^self]. |
|
703 |
synchronizedCodeViews := synchronizedCodeViews copyWith: aCodeView. |
|
704 |
||
705 |
"Created: / 06-04-2010 / 14:13:14 / Jakub <zelenja7@fel.cvut.cz>" |
|
706 |
"Modified: / 23-06-2010 / 17:01:47 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
13813 | 707 |
! |
708 |
||
709 |
unsynchronizeWith: aCodeView |
|
710 |
||
711 |
self assert: aCodeView ~= self. |
|
712 |
(synchronizedCodeViews includes: aCodeView) ifFalse:[^self]. |
|
713 |
synchronizedCodeViews := synchronizedCodeViews copyWithout: aCodeView. |
|
714 |
||
715 |
"Created: / 06-04-2010 / 14:13:14 / Jakub <zelenja7@fel.cvut.cz>" |
|
716 |
"Modified: / 23-06-2010 / 17:01:47 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
717 |
"Created: / 19-03-2012 / 14:25:51 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
9985 | 718 |
! ! |
719 |
||
14050
39037498b7e1
class: Tools::CodeView2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14005
diff
changeset
|
720 |
!CodeView2 methodsFor:'accessing-behavior'! |
39037498b7e1
class: Tools::CodeView2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14005
diff
changeset
|
721 |
|
39037498b7e1
class: Tools::CodeView2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14005
diff
changeset
|
722 |
readOnly:aBoolean |
39037498b7e1
class: Tools::CodeView2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14005
diff
changeset
|
723 |
"ignored here; present for compatibility with some textView subclasses, |
39037498b7e1
class: Tools::CodeView2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14005
diff
changeset
|
724 |
so that UIPainter can handle it in its TextView spec (which contains a |
39037498b7e1
class: Tools::CodeView2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14005
diff
changeset
|
725 |
readOnly field)" |
39037498b7e1
class: Tools::CodeView2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14005
diff
changeset
|
726 |
|
39037498b7e1
class: Tools::CodeView2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14005
diff
changeset
|
727 |
super readOnly:aBoolean. |
39037498b7e1
class: Tools::CodeView2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14005
diff
changeset
|
728 |
textView readOnly: aBoolean. |
39037498b7e1
class: Tools::CodeView2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14005
diff
changeset
|
729 |
gutterView readOnly: aBoolean. |
39037498b7e1
class: Tools::CodeView2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14005
diff
changeset
|
730 |
|
39037498b7e1
class: Tools::CodeView2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14005
diff
changeset
|
731 |
"Created: / 21-02-2014 / 11:45:09 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
39037498b7e1
class: Tools::CodeView2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14005
diff
changeset
|
732 |
! ! |
39037498b7e1
class: Tools::CodeView2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14005
diff
changeset
|
733 |
|
14005 | 734 |
!CodeView2 methodsFor:'accessing-code component'! |
10409 | 735 |
|
736 |
klass |
|
737 |
| v | |
|
738 |
||
739 |
(v := self classHolder value) notNil ifTrue:[^v]. |
|
13199 | 740 |
(v := self method) notNil ifTrue:[^v mclass]. |
10409 | 741 |
|
13813 | 742 |
^nil |
10409 | 743 |
|
744 |
"Created: / 27-07-2011 / 13:14:20 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
13199 | 745 |
"Modified: / 22-07-2013 / 13:34:05 / cg" |
14005 | 746 |
! |
10409 | 747 |
|
748 |
klass: aClass |
|
749 |
||
750 |
"Created: / 27-07-2011 / 13:13:02 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
751 |
! |
|
752 |
||
753 |
language |
|
754 |
"return the value in 'languageHolder'" |
|
755 |
||
756 |
| v | |
|
757 |
||
758 |
(v := self languageHolder value) notNil ifTrue:[^v]. |
|
13199 | 759 |
(v := self method) notNil ifTrue:[^v programmingLanguage]. |
10409 | 760 |
(v := self classHolder value) notNil ifTrue:[^v programmingLanguage]. |
761 |
||
10967
8c142eff5641
No highlighting by default (either method or language must be set)
vrany
parents:
10877
diff
changeset
|
762 |
"/No, no default language, please. |
8c142eff5641
No highlighting by default (either method or language must be set)
vrany
parents:
10877
diff
changeset
|
763 |
"/^SmalltalkLanguage instance |
8c142eff5641
No highlighting by default (either method or language must be set)
vrany
parents:
10877
diff
changeset
|
764 |
^nil |
8c142eff5641
No highlighting by default (either method or language must be set)
vrany
parents:
10877
diff
changeset
|
765 |
|
8c142eff5641
No highlighting by default (either method or language must be set)
vrany
parents:
10877
diff
changeset
|
766 |
"Modified: / 07-12-2011 / 16:38:47 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
13199 | 767 |
"Modified: / 22-07-2013 / 13:34:17 / cg" |
10409 | 768 |
! |
769 |
||
770 |
language: newValue |
|
771 |
"set the value in 'languageHolder'" |
|
772 |
||
773 |
self languageHolder value: newValue |
|
774 |
! |
|
775 |
||
776 |
method |
|
777 |
||
778 |
^self methodHolder value |
|
779 |
||
780 |
"Created: / 27-07-2011 / 13:12:32 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
781 |
! |
|
782 |
||
783 |
method: aMethod |
|
784 |
||
785 |
^self methodHolder value: aMethod |
|
786 |
||
787 |
"Created: / 27-07-2011 / 13:12:42 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
788 |
! ! |
|
789 |
||
9985 | 790 |
!CodeView2 methodsFor:'aspects'! |
791 |
||
792 |
browserHolder |
|
10877 | 793 |
browserHolder isNil ifTrue:[ |
9985 | 794 |
browserHolder := ValueHolder new |
795 |
]. |
|
796 |
^browserHolder |
|
797 |
||
798 |
"Modified: / 14-02-2010 / 19:27:33 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
10877 | 799 |
"Modified: / 18-11-2011 / 14:58:15 / cg" |
9985 | 800 |
! |
801 |
||
802 |
browserHolder:aValueModel |
|
803 |
browserHolder := aValueModel. |
|
804 |
! |
|
805 |
||
806 |
classHolder |
|
807 |
"return/create the 'classHolder' value holder (automatically generated)" |
|
808 |
||
809 |
classHolder isNil ifTrue:[ |
|
10409 | 810 |
classHolder := ValueHolder with: nil. |
9985 | 811 |
classHolder addDependent:self. |
812 |
]. |
|
813 |
^ classHolder |
|
814 |
||
10409 | 815 |
"Modified: / 27-07-2011 / 13:15:16 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
9985 | 816 |
! |
817 |
||
818 |
classHolder:aValueModel |
|
819 |
"set the 'classHolder' value holder (automatically generated)" |
|
820 |
||
821 |
|old oldValue newValue| |
|
822 |
||
823 |
classHolder notNil ifTrue:[ |
|
824 |
oldValue := classHolder value. |
|
825 |
classHolder removeDependent:self. |
|
826 |
]. |
|
827 |
classHolder := aValueModel. |
|
828 |
classHolder notNil ifTrue:[ |
|
829 |
classHolder addDependent:self. |
|
830 |
]. |
|
831 |
old := methodHolder. |
|
832 |
newValue := classHolder value. |
|
833 |
oldValue ~~ newValue ifTrue:[ |
|
834 |
self update:#value with:newValue from:classHolder. |
|
835 |
]. |
|
836 |
||
837 |
self changed: #classHolder with: old -> classHolder |
|
838 |
||
839 |
"Modified: / 17-06-2011 / 12:56:10 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
840 |
! |
|
841 |
||
13813 | 842 |
currentBlockNodeHolder |
843 |
"return/create the 'currentBlockNodeHolder' value holder (automatically generated)" |
|
844 |
||
845 |
currentBlockNodeHolder isNil ifTrue:[ |
|
13942 | 846 |
currentBlockNodeHolder := ValueHolder new. |
13813 | 847 |
]. |
848 |
^ currentBlockNodeHolder |
|
849 |
! |
|
850 |
||
851 |
currentBlockNodeHolder:something |
|
852 |
"set the 'currentBlockNodeHolder' value holder (automatically generated)" |
|
853 |
||
854 |
currentBlockNodeHolder := something. |
|
855 |
! |
|
856 |
||
857 |
currentParseNodeHolder |
|
858 |
"return/create the 'currentParseNodeHolder' value holder (automatically generated)" |
|
859 |
||
860 |
currentParseNodeHolder isNil ifTrue:[ |
|
13942 | 861 |
currentParseNodeHolder := ValueHolder new. |
13813 | 862 |
]. |
863 |
^ currentParseNodeHolder |
|
864 |
! |
|
865 |
||
866 |
currentParseNodeHolder:something |
|
867 |
"set the 'currentParseNodeHolder' value holder (automatically generated)" |
|
868 |
||
869 |
currentParseNodeHolder := something. |
|
870 |
gutterView notNil ifTrue:[ gutterView currentBlockNodeHolder: currentBlockNodeHolder ]. |
|
871 |
||
872 |
"Modified: / 16-02-2012 / 23:11:55 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
873 |
! |
|
874 |
||
9985 | 875 |
languageHolder |
876 |
languageHolder isNil ifTrue:[ |
|
11616 | 877 |
"/ cg: I dont like the smalltalk default here, because everyone who is not showing ST-code (expecco, filebrowser etc.) |
10723 | 878 |
"/ has to explicitely clear the valueholder. I guess, it is better for the few |
879 |
"/ others to explicitely set it, if they do not provide syntaxHighlighter per method |
|
880 |
"/ or class. |
|
881 |
languageHolder := ValueHolder with: nil "SmalltalkLanguage instance". |
|
9985 | 882 |
languageHolder addDependent:self. |
883 |
]. |
|
884 |
^ languageHolder |
|
10723 | 885 |
|
11616 | 886 |
"Modified: / 19-07-2012 / 16:51:04 / cg" |
9985 | 887 |
! |
888 |
||
889 |
languageHolder:aValueModel |
|
890 |
"set the 'languageHolder' value holder (automatically generated)" |
|
891 |
||
892 |
|old oldValue newValue| |
|
893 |
||
894 |
languageHolder notNil ifTrue:[ |
|
895 |
oldValue := languageHolder value. |
|
896 |
languageHolder removeDependent:self. |
|
897 |
]. |
|
898 |
languageHolder := aValueModel. |
|
899 |
languageHolder notNil ifTrue:[ |
|
900 |
languageHolder addDependent:self. |
|
901 |
]. |
|
902 |
old := languageHolder. |
|
903 |
newValue := languageHolder value. |
|
904 |
oldValue ~~ newValue ifTrue:[ |
|
905 |
self update:#value with:newValue from:languageHolder. |
|
906 |
]. |
|
907 |
||
908 |
self changed: #languageHolder with: old -> languageHolder |
|
909 |
||
910 |
"Modified: / 17-06-2011 / 12:56:30 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
11616 | 911 |
"Modified: / 19-07-2012 / 16:51:08 / cg" |
9985 | 912 |
! |
913 |
||
914 |
methodHolder |
|
915 |
"return/create the 'methodHolder' value holder (automatically generated)" |
|
916 |
||
917 |
methodHolder isNil ifTrue:[ |
|
918 |
methodHolder := ValueHolder new. |
|
919 |
methodHolder addDependent:self. |
|
920 |
]. |
|
921 |
^ methodHolder |
|
922 |
! |
|
923 |
||
924 |
methodHolder:aValueModel |
|
925 |
"set the 'methodHolder' value holder (automatically generated)" |
|
926 |
||
927 |
|old oldValue newValue| |
|
928 |
||
929 |
methodHolder notNil ifTrue:[ |
|
930 |
oldValue := methodHolder value. |
|
931 |
methodHolder removeDependent:self. |
|
932 |
]. |
|
933 |
old := methodHolder. |
|
934 |
methodHolder := aValueModel. |
|
935 |
methodHolder notNil ifTrue:[ |
|
936 |
methodHolder addDependent:self. |
|
937 |
]. |
|
938 |
newValue := methodHolder value. |
|
939 |
oldValue ~~ newValue ifTrue:[ |
|
940 |
self update:#value with:newValue from:methodHolder. |
|
941 |
]. |
|
942 |
||
943 |
self changed: #methodHolder with: old -> methodHolder |
|
944 |
||
945 |
"Modified: / 17-06-2011 / 12:55:47 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
946 |
! |
|
947 |
||
948 |
modeHolder |
|
949 |
"return/create the 'modeHolder' value holder (automatically generated)" |
|
950 |
||
11706 | 951 |
"is this the codeAspect?" |
9985 | 952 |
modeHolder isNil ifTrue:[ |
953 |
modeHolder := #expression asValue. |
|
954 |
modeHolder addDependent:self. |
|
955 |
]. |
|
956 |
^ modeHolder |
|
957 |
||
958 |
"Modified: / 13-06-2011 / 10:52:11 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
11706 | 959 |
"Modified (comment): / 27-07-2012 / 22:22:19 / cg" |
9985 | 960 |
! |
961 |
||
962 |
modeHolder:something |
|
963 |
"set the 'modeHolder' value holder (automatically generated)" |
|
964 |
||
965 |
|oldValue newValue| |
|
966 |
||
967 |
modeHolder notNil ifTrue:[ |
|
968 |
oldValue := modeHolder value. |
|
969 |
modeHolder removeDependent:self. |
|
970 |
]. |
|
971 |
modeHolder := something. |
|
972 |
modeHolder notNil ifTrue:[ |
|
973 |
modeHolder addDependent:self. |
|
974 |
]. |
|
975 |
newValue := modeHolder value. |
|
976 |
oldValue ~~ newValue ifTrue:[ |
|
977 |
self update:#value with:newValue from:modeHolder. |
|
978 |
]. |
|
979 |
||
980 |
self changed: #modeHolder with: modeHolder |
|
981 |
||
982 |
"Modified: / 17-06-2011 / 12:55:01 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
983 |
! ! |
|
984 |
||
985 |
!CodeView2 methodsFor:'change & update'! |
|
986 |
||
987 |
update:aspect with:param from:sender |
|
13587
0f06b4a66ae7
Refactoring after moving codeAspect to EditTextView.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13584
diff
changeset
|
988 |
|
0f06b4a66ae7
Refactoring after moving codeAspect to EditTextView.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13584
diff
changeset
|
989 |
|
0f06b4a66ae7
Refactoring after moving codeAspect to EditTextView.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13584
diff
changeset
|
990 |
sender == methodHolder ifTrue:[ |
13942 | 991 |
textView editedMethodOrClass: methodHolder value. |
13587
0f06b4a66ae7
Refactoring after moving codeAspect to EditTextView.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13584
diff
changeset
|
992 |
]. |
0f06b4a66ae7
Refactoring after moving codeAspect to EditTextView.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13584
diff
changeset
|
993 |
|
0f06b4a66ae7
Refactoring after moving codeAspect to EditTextView.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13584
diff
changeset
|
994 |
sender == classHolder ifTrue:[ |
13942 | 995 |
methodHolder value isNil ifTrue:[ |
996 |
textView editedMethodOrClass: classHolder value. |
|
997 |
]. |
|
13587
0f06b4a66ae7
Refactoring after moving codeAspect to EditTextView.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13584
diff
changeset
|
998 |
]. |
0f06b4a66ae7
Refactoring after moving codeAspect to EditTextView.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13584
diff
changeset
|
999 |
|
0f06b4a66ae7
Refactoring after moving codeAspect to EditTextView.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13584
diff
changeset
|
1000 |
sender == languageHolder ifTrue:[ |
13942 | 1001 |
textView editedLanguage: languageHolder value. |
13813 | 1002 |
]. |
1003 |
||
1004 |
sender == modeHolder ifTrue:[ |
|
13942 | 1005 |
codeAspect := modeHolder value |
13587
0f06b4a66ae7
Refactoring after moving codeAspect to EditTextView.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13584
diff
changeset
|
1006 |
]. |
9985 | 1007 |
|
10245 | 1008 |
sender == showGutterChannel ifTrue: [ |
13942 | 1009 |
self updateGutterVisibility. |
1010 |
^self. |
|
10245 | 1011 |
]. |
9985 | 1012 |
|
13813 | 1013 |
services do:[:each | |
13942 | 1014 |
each isEnabled ifTrue:[ |
1015 |
each update:aspect with:param from:sender |
|
1016 |
] |
|
10662
4d67f850e4f7
comment/format in: #update:with:from:
Claus Gittinger <cg@exept.de>
parents:
10630
diff
changeset
|
1017 |
]. |
9985 | 1018 |
|
1019 |
super update:aspect with:param from:sender |
|
1020 |
||
10245 | 1021 |
"Modified: / 07-07-2011 / 12:07:04 / Jan Vrany <jan.vrant@fit.cvut,cz>" |
10767 | 1022 |
"Modified: / 06-10-2011 / 14:14:36 / cg" |
13587
0f06b4a66ae7
Refactoring after moving codeAspect to EditTextView.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13584
diff
changeset
|
1023 |
"Modified: / 27-09-2013 / 10:16:10 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
9985 | 1024 |
! |
1025 |
||
12950 | 1026 |
updateGutter |
1027 |
||
1028 |
self showGutterChannel value ifTrue:[ |
|
1029 |
gutterView invalidate. |
|
1030 |
] |
|
1031 |
||
1032 |
"Created: / 23-06-2010 / 19:05:39 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1033 |
! |
|
1034 |
||
9985 | 1035 |
updateGutterVisibility |
1036 |
||
1037 |
self showGutterChannel value ifTrue:[ |
|
1038 |
textViewScroller origin:(gutterView width @ 0.0) corner:(1.0 @ 1.0). |
|
1039 |
gutterView beVisible. |
|
1040 |
] ifFalse:[ |
|
1041 |
textViewScroller origin:(0.0 @ 0.0) corner:(1.0 @ 1.0). |
|
1042 |
gutterView beInvisible. |
|
1043 |
] |
|
1044 |
||
1045 |
"Created: / 23-06-2010 / 19:05:39 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1046 |
! ! |
|
1047 |
||
1048 |
!CodeView2 methodsFor:'channels'! |
|
1049 |
||
1050 |
modifiedChannel |
|
1051 |
"return the valueHolder holding true if text was modified" |
|
1052 |
||
10245 | 1053 |
^ textView modifiedChannel |
1054 |
"/ ^ modifiedChannel |
|
1055 |
||
1056 |
"Modified: / 07-07-2011 / 12:07:26 / Jan Vrany <jan.vrant@fit.cvut,cz>" |
|
9985 | 1057 |
! |
1058 |
||
1059 |
modifiedChannel:aValueHolder |
|
1060 |
"set the valueHolder holding true if text was modified" |
|
1061 |
||
10662
4d67f850e4f7
comment/format in: #update:with:from:
Claus Gittinger <cg@exept.de>
parents:
10630
diff
changeset
|
1062 |
textView modifiedChannel removeDependent:self. |
4d67f850e4f7
comment/format in: #update:with:from:
Claus Gittinger <cg@exept.de>
parents:
10630
diff
changeset
|
1063 |
textView modifiedChannel:aValueHolder. |
4d67f850e4f7
comment/format in: #update:with:from:
Claus Gittinger <cg@exept.de>
parents:
10630
diff
changeset
|
1064 |
textView modifiedChannel addDependent:self. |
10245 | 1065 |
|
1066 |
"/ |prev| |
|
1067 |
"/ |
|
1068 |
"/ prev := modifiedChannel. |
|
1069 |
"/ modifiedChannel := aValueHolder. |
|
1070 |
"/ self setupChannel:aValueHolder for:nil withOld:prev |
|
1071 |
||
1072 |
"Created: / 30-01-1998 / 14:51:32 / cg" |
|
1073 |
"Modified: / 07-07-2011 / 12:07:43 / Jan Vrany <jan.vrant@fit.cvut,cz>" |
|
10662
4d67f850e4f7
comment/format in: #update:with:from:
Claus Gittinger <cg@exept.de>
parents:
10630
diff
changeset
|
1074 |
"Modified: / 05-09-2011 / 05:13:27 / cg" |
9985 | 1075 |
! |
1076 |
||
10785 | 1077 |
reallyModifiedChannel |
1078 |
"return the valueHolder holding true if text was modified" |
|
1079 |
||
1080 |
^ textView reallyModifiedChannel |
|
1081 |
||
1082 |
"Modified: / 07-07-2011 / 12:07:26 / Jan Vrany <jan.vrant@fit.cvut,cz>" |
|
1083 |
"Created: / 08-10-2011 / 12:47:25 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1084 |
! |
|
1085 |
||
1086 |
reallyModifiedChannel: aValueModel |
|
1087 |
||
1088 |
^ textView reallyModifiedChannel: aValueModel |
|
1089 |
||
1090 |
"Modified: / 07-07-2011 / 12:07:26 / Jan Vrany <jan.vrant@fit.cvut,cz>" |
|
1091 |
"Created: / 08-10-2011 / 12:47:37 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1092 |
! |
|
1093 |
||
10793
c19380a197aa
Added channel for controlling visibility of accept/cancel
vrany
parents:
10791
diff
changeset
|
1094 |
showAcceptCancelBarChannel |
c19380a197aa
Added channel for controlling visibility of accept/cancel
vrany
parents:
10791
diff
changeset
|
1095 |
|
c19380a197aa
Added channel for controlling visibility of accept/cancel
vrany
parents:
10791
diff
changeset
|
1096 |
^showAcceptCancelBarChannel |
c19380a197aa
Added channel for controlling visibility of accept/cancel
vrany
parents:
10791
diff
changeset
|
1097 |
|
c19380a197aa
Added channel for controlling visibility of accept/cancel
vrany
parents:
10791
diff
changeset
|
1098 |
"Created: / 10-10-2011 / 16:23:42 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
c19380a197aa
Added channel for controlling visibility of accept/cancel
vrany
parents:
10791
diff
changeset
|
1099 |
! |
c19380a197aa
Added channel for controlling visibility of accept/cancel
vrany
parents:
10791
diff
changeset
|
1100 |
|
c19380a197aa
Added channel for controlling visibility of accept/cancel
vrany
parents:
10791
diff
changeset
|
1101 |
showAcceptCancelBarChannel:aValueHolder |
c19380a197aa
Added channel for controlling visibility of accept/cancel
vrany
parents:
10791
diff
changeset
|
1102 |
"set the valueHolder holding true if text was modified" |
c19380a197aa
Added channel for controlling visibility of accept/cancel
vrany
parents:
10791
diff
changeset
|
1103 |
|
c19380a197aa
Added channel for controlling visibility of accept/cancel
vrany
parents:
10791
diff
changeset
|
1104 |
|prev| |
c19380a197aa
Added channel for controlling visibility of accept/cancel
vrany
parents:
10791
diff
changeset
|
1105 |
|
c19380a197aa
Added channel for controlling visibility of accept/cancel
vrany
parents:
10791
diff
changeset
|
1106 |
prev := showAcceptCancelBarChannel. |
c19380a197aa
Added channel for controlling visibility of accept/cancel
vrany
parents:
10791
diff
changeset
|
1107 |
showAcceptCancelBarChannel := aValueHolder. |
c19380a197aa
Added channel for controlling visibility of accept/cancel
vrany
parents:
10791
diff
changeset
|
1108 |
self setupChannel:aValueHolder for:nil withOld:prev. |
c19380a197aa
Added channel for controlling visibility of accept/cancel
vrany
parents:
10791
diff
changeset
|
1109 |
|
c19380a197aa
Added channel for controlling visibility of accept/cancel
vrany
parents:
10791
diff
changeset
|
1110 |
"Created: / 10-10-2011 / 16:24:15 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
c19380a197aa
Added channel for controlling visibility of accept/cancel
vrany
parents:
10791
diff
changeset
|
1111 |
! |
c19380a197aa
Added channel for controlling visibility of accept/cancel
vrany
parents:
10791
diff
changeset
|
1112 |
|
9985 | 1113 |
showGutterChannel |
1114 |
||
1115 |
^showGutterChannel |
|
1116 |
||
1117 |
"Created: / 23-06-2010 / 19:02:15 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1118 |
! |
|
1119 |
||
1120 |
showGutterChannel:aValueHolder |
|
1121 |
"set the valueHolder holding true if text was modified" |
|
1122 |
||
1123 |
|prev| |
|
1124 |
||
1125 |
prev := showGutterChannel. |
|
1126 |
showGutterChannel := aValueHolder. |
|
1127 |
self setupChannel:aValueHolder for:nil withOld:prev |
|
1128 |
||
1129 |
"Created: / 23-06-2010 / 19:03:26 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1130 |
! ! |
|
1131 |
||
10262 | 1132 |
!CodeView2 methodsFor:'code services'! |
1133 |
||
1134 |
browseMethod: method |
|
1135 |
||
1136 |
self browseMethod: method label: nil. |
|
1137 |
||
1138 |
"Created: / 14-02-2010 / 19:41:46 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1139 |
! |
|
1140 |
||
1141 |
browseMethod: method label: label |
|
1142 |
||
10877 | 1143 |
self browser isNil ifTrue: [^NewSystemBrowser openInMethod:method]. |
10262 | 1144 |
(UserPreferences current alwaysOpenNewTabWhenCtrlClick |
1145 |
or:[self browser navigationState modified]) |
|
1146 |
ifTrue: |
|
1147 |
[self browser |
|
1148 |
spawnFullBrowserInClass: method mclass |
|
1149 |
selector:method selector |
|
1150 |
in:#newBuffer] |
|
1151 |
ifFalse: |
|
1152 |
[self browser |
|
1153 |
switchToClass: method containingClass |
|
1154 |
selector: method selector]. |
|
1155 |
||
1156 |
"Modified: / 19-02-2008 / 10:15:17 / janfrog" |
|
1157 |
"Created: / 19-10-2008 / 08:16:17 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
1158 |
"Modified: / 25-07-2010 / 13:34:27 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
10877 | 1159 |
"Modified: / 18-11-2011 / 14:58:12 / cg" |
10262 | 1160 |
! |
1161 |
||
1162 |
browseMethods: methods label: label |
|
1163 |
||
1164 |
methods size = 1 ifTrue: |
|
1165 |
[^self browseMethod: methods anyOne label: label]. |
|
1166 |
||
1167 |
self browser |
|
1168 |
ifNil: [NewSystemBrowser browseMethods: methods title: label] |
|
1169 |
ifNotNil:[self browser spawnMethodBrowserFor:methods in:#newBuffer label:label] |
|
1170 |
||
1171 |
"Created: / 26-12-2007 / 11:32:04 / janfrog" |
|
1172 |
"Modified: / 19-10-2008 / 08:17:28 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
1173 |
! |
|
1174 |
||
1175 |
extractSelectorAndSelectedTextFrom: givenSelectedText |
|
1176 |
| selector selectedText compilerClass na | |
|
11359 | 1177 |
|
10262 | 1178 |
selectedText := givenSelectedText. |
1179 |
compilerClass := self language compilerClass. |
|
1180 |
selectedText size > 0 ifTrue:[ |
|
11359 | 1181 |
"/ self windowGroup withWaitCursorDo:[ |
10262 | 1182 |
"/ hack, for now and expecco; must ask the Parser eventually... |
1183 |
(compilerClass notNil and:[compilerClass includesBehavior:JavaScriptParser]) ifTrue:[ |
|
1184 |
"/ selector is in one piece anyway |
|
1185 |
(selectedText includes:$_) ifFalse:[ |
|
1186 |
"/ zero or one args - sigh (need to parse more to figure this out) |
|
1187 |
selector := JavaScriptParser basicNew translatedSmalltalkSelectorFor:selectedText numArgs:1. |
|
1188 |
selectedText := JavaScriptParser basicNew translatedSmalltalkSelectorFor:selectedText numArgs:0. |
|
1189 |
] ifTrue:[ |
|
1190 |
"/ count _#s plus one arg - sigh |
|
1191 |
na := (selectedText occurrencesOf:$_) + 1. |
|
1192 |
selector := JavaScriptParser basicNew translatedSmalltalkSelectorFor:selectedText numArgs:na |
|
1193 |
]. |
|
1194 |
] ifFalse:[ |
|
1195 |
selector := SystemBrowser extractSelectorFrom:selectedText. |
|
1196 |
]. |
|
11359 | 1197 |
"/ ] |
10262 | 1198 |
]. |
1199 |
^Array with: selector with: selectedText |
|
1200 |
||
1201 |
"Created: / 30-06-2011 / 19:49:53 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
11359 | 1202 |
"Modified: / 05-03-2012 / 09:04:12 / cg" |
10262 | 1203 |
! |
1204 |
||
1205 |
implementorsOf: selector |
|
1206 |
||
10877 | 1207 |
selector isNil ifTrue:[^#()]. |
10262 | 1208 |
^SystemBrowser |
1209 |
findImplementorsOf: selector |
|
1210 |
in: Smalltalk allClasses |
|
1211 |
ignoreCase: false |
|
1212 |
||
1213 |
"Created: / 26-12-2007 / 11:37:11 / janfrog" |
|
10877 | 1214 |
"Modified: / 18-11-2011 / 14:58:17 / cg" |
10262 | 1215 |
! |
1216 |
||
1217 |
sendersOf: selector |
|
12868 | 1218 |
|senderBlock| |
10262 | 1219 |
|
10877 | 1220 |
selector isNil ifTrue:[^#()]. |
12868 | 1221 |
|
1222 |
"/ not exact, but much faster (looks for symbol only, does not parse code for real send) |
|
1223 |
senderBlock := SystemBrowser searchBlockForSymbol:selector. |
|
1224 |
senderBlock == false ifTrue:[ ^ #() ]. |
|
1225 |
||
1226 |
^ SystemBrowser |
|
13942 | 1227 |
allMethodsIn:Smalltalk allClasses |
1228 |
where:senderBlock. |
|
13813 | 1229 |
|
1230 |
"/ exact, but much slower |
|
12868 | 1231 |
"/ ^SystemBrowser |
1232 |
"/ findSendersOf: selector |
|
1233 |
"/ in: Smalltalk allClasses |
|
1234 |
"/ ignoreCase: false |
|
10262 | 1235 |
|
1236 |
"Created: / 26-12-2007 / 11:37:22 / janfrog" |
|
1237 |
"Modified: / 30-06-2011 / 19:32:52 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
10877 | 1238 |
"Modified: / 18-11-2011 / 14:58:19 / cg" |
10262 | 1239 |
! ! |
1240 |
||
9985 | 1241 |
!CodeView2 methodsFor:'delegation'! |
1242 |
||
1243 |
doesNotUnderstand: aMessage |
|
1244 |
||
1245 |
((textView respondsTo: aMessage selector) |
|
1246 |
and:[(TraceSelectors includes:aMessage selector) not]) |
|
1247 |
ifTrue:[^aMessage sendTo: textView]. |
|
1248 |
^super doesNotUnderstand: aMessage |
|
1249 |
||
1250 |
"Created: / 13-02-2010 / 23:27:09 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1251 |
"Modified: / 14-02-2010 / 09:53:06 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1252 |
! |
|
1253 |
||
1254 |
hasSelection |
|
1255 |
||
1256 |
^textView hasSelection |
|
1257 |
||
1258 |
"Created: / 14-02-2010 / 09:53:54 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1259 |
! ! |
|
1260 |
||
11393 | 1261 |
!CodeView2 methodsFor:'delegation-drawing'! |
9985 | 1262 |
|
1263 |
drawLine:lineNo in: view atX:x y:y width: w height:h from:startCol to:endColOrNil with:fg and:bg |
|
1264 |
"See the comment in |
|
1265 |
CodeViewService>>drawLine:in:atX..." |
|
1266 |
||
1267 |
services do:[:each| |
|
1268 |
each drawLine:lineNo in: view atX:x y:y width: w height:h from:startCol to:endColOrNil with:fg and:bg |
|
1269 |
] |
|
1270 |
||
1271 |
"Created: / 17-06-2011 / 13:50:20 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
10767 | 1272 |
"Modified: / 06-10-2011 / 14:14:04 / cg" |
9985 | 1273 |
! |
1274 |
||
1275 |
redrawVisibleLine: visLineNr |
|
1276 |
||
1277 |
"Created: / 07-03-2010 / 14:44:23 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1278 |
! |
|
1279 |
||
1280 |
redrawVisibleLine:visLine col:colNr |
|
1281 |
||
1282 |
"Modified: / 05-11-2007 / 17:35:53 / cg" |
|
1283 |
"Modified: / 07-03-2010 / 14:45:32 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1284 |
! |
|
1285 |
||
1286 |
redrawVisibleLine:visLine from:startCol |
|
1287 |
||
1288 |
"Modified: / 07-03-2010 / 14:46:18 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1289 |
! |
|
1290 |
||
1291 |
redrawVisibleLine:visLine from:startCol to:endCol |
|
1292 |
||
1293 |
"Modified: / 07-03-2010 / 14:46:22 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1294 |
! ! |
|
1295 |
||
11393 | 1296 |
!CodeView2 methodsFor:'delegation-events'! |
9985 | 1297 |
|
1298 |
buttonMotion: button x:x y:y in: view |
|
1299 |
"Delegates events to services. Answers true iff at least |
|
1300 |
one service handler method returns true. In that case, |
|
1301 |
the event is is NOT processes by the view." |
|
1302 |
||
12868 | 1303 |
^ services |
1304 |
contains:[:service | |
|
1305 |
service isEnabled and:[ ((service buttonMotion: button x:x y:y in: view) == true) ] |
|
1306 |
]. |
|
9985 | 1307 |
|
1308 |
"Modified: / 07-03-2010 / 13:53:18 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
10767 | 1309 |
"Modified: / 06-10-2011 / 14:13:57 / cg" |
9985 | 1310 |
! |
1311 |
||
14005 | 1312 |
buttonPress: button x:x y:y in: view |
1313 |
"Delegates events to services. Answers true iff at least |
|
1314 |
one service handler method returns true. In that case, |
|
1315 |
the event is is NOT processes by the view." |
|
1316 |
||
1317 |
^ services |
|
1318 |
contains:[:service | |
|
1319 |
service isEnabled and:[ ((service buttonPress: button x:x y:y in: view) == true) ] |
|
1320 |
]. |
|
1321 |
||
1322 |
"Modified: / 07-03-2010 / 13:53:47 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1323 |
"Modified: / 06-10-2011 / 14:14:00 / cg" |
|
1324 |
"Modified (format): / 05-03-2012 / 08:56:02 / cg" |
|
1325 |
! |
|
1326 |
||
12868 | 1327 |
buttonRelease: button x:x y:y in: view |
9985 | 1328 |
"Delegates events to services. Answers true iff at least |
1329 |
one service handler method returns true. In that case, |
|
1330 |
the event is is NOT processes by the view." |
|
1331 |
||
12868 | 1332 |
^ services |
1333 |
contains:[:service | |
|
1334 |
service isEnabled and:[ ((service buttonRelease: button x:x y:y in: view) == true) ] |
|
1335 |
]. |
|
1336 |
! |
|
1337 |
||
12992 | 1338 |
highlightInstanceVariable:name |
1339 |
services do:[:each| |
|
1340 |
each highlightInstanceVariable:name |
|
1341 |
]. |
|
1342 |
! |
|
1343 |
||
12868 | 1344 |
keyPress: key x:x y:y in: view |
1345 |
"Delegates events to services. Answers true iff at least |
|
1346 |
one service handler method returns true. In that case, |
|
1347 |
the event is is NOT processes by the view." |
|
1348 |
||
1349 |
^ services |
|
1350 |
contains:[:service | |
|
13582 | 1351 |
|handledByService| |
1352 |
||
1353 |
handledByService := service isEnabled |
|
1354 |
and:[ ((service keyPress: key x:x y:y in: view) == true)]. |
|
1355 |
"/ handledByService ifTrue:[ Transcript showCR:'handled by ',service printString ]. |
|
1356 |
handledByService |
|
12868 | 1357 |
]. |
9985 | 1358 |
|
1359 |
"Modified: / 07-03-2010 / 13:54:15 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
10767 | 1360 |
"Modified: / 06-10-2011 / 14:14:11 / cg" |
9985 | 1361 |
! |
1362 |
||
1363 |
keyRelease: key x:x y:y in: view |
|
1364 |
"Delegates events to services. Answers true iff at least |
|
1365 |
one service handler method returns true. In that case, |
|
1366 |
the event is is NOT processes by the view." |
|
1367 |
||
12868 | 1368 |
^ services |
1369 |
contains:[:service | |
|
1370 |
service isEnabled and:[ ((service keyRelease: key x:x y:y in: view) == true) ] |
|
1371 |
]. |
|
9985 | 1372 |
|
1373 |
"Modified: / 07-03-2010 / 13:54:27 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
10767 | 1374 |
"Modified: / 06-10-2011 / 14:14:13 / cg" |
9985 | 1375 |
! |
1376 |
||
10224 | 1377 |
linesDeletedFrom: start to: end |
1378 |
||
1379 |
services do: [:each | |
|
1380 |
each isEnabled ifTrue: [ |
|
1381 |
each linesDeletedFrom: start to: end |
|
1382 |
] |
|
1383 |
]. |
|
1384 |
||
1385 |
"Created: / 06-07-2011 / 17:12:54 / jv" |
|
10767 | 1386 |
"Modified: / 06-10-2011 / 14:14:16 / cg" |
10781 | 1387 |
"Modified: / 07-10-2011 / 19:14:48 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
10224 | 1388 |
! |
1389 |
||
1390 |
linesInsertedFrom: start to: end |
|
1391 |
||
1392 |
services do: [:each | |
|
1393 |
each isEnabled ifTrue: [ |
|
1394 |
each linesInsertedFrom: start to: end |
|
1395 |
] |
|
1396 |
]. |
|
1397 |
||
1398 |
"Created: / 06-07-2011 / 17:12:48 / jv" |
|
10767 | 1399 |
"Modified: / 06-10-2011 / 14:14:20 / cg" |
10224 | 1400 |
! |
1401 |
||
1402 |
linesModifiedFrom: start to: end |
|
1403 |
||
1404 |
services do: [:each | |
|
1405 |
each isEnabled ifTrue: [ |
|
1406 |
each linesModifiedFrom: start to: end |
|
1407 |
] |
|
1408 |
]. |
|
1409 |
||
1410 |
"Created: / 06-07-2011 / 17:12:58 / jv" |
|
10767 | 1411 |
"Modified: / 06-10-2011 / 14:13:44 / cg" |
10224 | 1412 |
! |
1413 |
||
9985 | 1414 |
scrollDown: nLines in: view |
1415 |
||
1416 |
view == textView |
|
1417 |
ifTrue: |
|
1418 |
["/my text view scrolled... |
|
1419 |
synchronizedCodeViews do:[:codeView|codeView scrollDown: nLines in: view]] |
|
1420 |
ifFalse: |
|
1421 |
["/other code view scrolls and I'm notified about that |
|
1422 |
textView basicScrollDown: nLines] |
|
1423 |
||
1424 |
"Created: / 06-04-2010 / 14:02:39 / Jakub <zelenja7@fel.cvut.cz>" |
|
1425 |
! |
|
1426 |
||
14005 | 1427 |
scrollTo:origin redraw:doRedraw in: view |
1428 |
view == textView ifTrue: [ |
|
1429 |
"/my text view scrolled... |
|
1430 |
synchronizedCodeViews do:[:codeView| |
|
1431 |
codeView scrollTo:origin redraw:doRedraw in: view. |
|
1432 |
] |
|
1433 |
] ifFalse: [ |
|
1434 |
"/other code view scrolls and I'm notified about that |
|
1435 |
textView basicScrollTo:origin redraw:doRedraw. |
|
1436 |
] |
|
1437 |
||
1438 |
"Created: / 06-04-2010 / 14:02:39 / Jakub <zelenja7@fel.cvut.cz>" |
|
1439 |
"Created: / 19-03-2012 / 17:05:09 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1440 |
! |
|
1441 |
||
9985 | 1442 |
scrollUp: nLines in: view |
1443 |
||
1444 |
view == textView |
|
1445 |
ifTrue: |
|
1446 |
["/my text view scrolled... |
|
1447 |
synchronizedCodeViews do:[:codeView|codeView scrollUp: nLines in: view]] |
|
1448 |
ifFalse: |
|
1449 |
["/other code view scrolls and I'm notified about that |
|
1450 |
textView basicScrollUp: nLines] |
|
1451 |
||
1452 |
"Created: / 06-04-2010 / 14:02:39 / Jakub <zelenja7@fel.cvut.cz>" |
|
1453 |
! ! |
|
1454 |
||
1455 |
!CodeView2 methodsFor:'diff mode'! |
|
1456 |
||
1457 |
recomputeDiff:view |
|
1458 |
|t1 t2 pom diffHelper view2| |
|
1459 |
||
1460 |
t1 := view getNewOriginText. |
|
1461 |
synchronizedCodeViews do:[:codeView | |
|
1462 |
view2 := codeView |
|
1463 |
]. |
|
1464 |
view changedDiffText:false. |
|
1465 |
view2 changedDiffText:false. |
|
1466 |
t2 := view2 getNewOriginText. |
|
1467 |
pom := DiffCodeView2 new. |
|
1468 |
(view == textView) ifTrue:[ |
|
1469 |
diffHelper := pom computeDiffDataForText1:t1 text2:t2. |
|
1470 |
(view) contents:(diffHelper text1). |
|
1471 |
(view) deletedLines:(diffHelper deleted). |
|
1472 |
(view) changedLines:(diffHelper changed). |
|
1473 |
(view) originDiffText:t1. |
|
1474 |
(view) emptyLines:(diffHelper inserted). |
|
1475 |
(view) changedLines:(diffHelper changed). |
|
1476 |
(view2) contents:(diffHelper text2). |
|
1477 |
(view2) insertedLines:(diffHelper inserted). |
|
1478 |
(view2) changedLines:(diffHelper changed). |
|
1479 |
(view2) originDiffText:t2. |
|
1480 |
(view2) emptyLines:(diffHelper deleted). |
|
1481 |
]. |
|
1482 |
||
1483 |
"Modified: / 22-06-2010 / 23:35:41 / Jakub <zelenja7@fel.cvut.cz>" |
|
1484 |
"Modified: / 23-06-2010 / 17:25:59 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1485 |
! ! |
|
1486 |
||
1487 |
!CodeView2 methodsFor:'initialization'! |
|
1488 |
||
13208 | 1489 |
defaultServices |
1490 |
"/ used to call "CodeViewService availableServices", |
|
1491 |
"/ which enumerated all subclasses. |
|
1492 |
"/ this is BAD BAD BAD, because it does not allow for additional service |
|
1493 |
"/ subclasses to be built for special applications. For example, |
|
1494 |
"/ a debugging breakpoint service for a GDB application, a breakpoint service for |
|
1495 |
"/ expecco's codeview. |
|
1496 |
||
1497 |
"/ therefore, the list of services to use in codeView2 is now filtered |
|
1498 |
||
1499 |
^ CodeViewService availableServices |
|
1500 |
select:[:service | service isUsefulFor:self] |
|
1501 |
||
1502 |
"Created: / 22-07-2013 / 13:57:40 / cg" |
|
1503 |
! |
|
1504 |
||
9985 | 1505 |
initialize |
1506 |
"Invoked when a new instance is created." |
|
1507 |
"Call super initialize" |
|
13813 | 1508 |
|
9985 | 1509 |
super initialize. |
1510 |
"Now set up some visual properties" |
|
1511 |
self level:-1. |
|
1512 |
"Now initialize sub-views" |
|
11988
b482d2c77040
changed to not take up screen space for the accept/cancel gutter,
Claus Gittinger <cg@exept.de>
parents:
11903
diff
changeset
|
1513 |
showGutterChannel := ValueHolder with: true. |
13813 | 1514 |
showGutterChannel addDependent: self. |
11988
b482d2c77040
changed to not take up screen space for the accept/cancel gutter,
Claus Gittinger <cg@exept.de>
parents:
11903
diff
changeset
|
1515 |
"/ toDo: I don't like two options in the settings; |
b482d2c77040
changed to not take up screen space for the accept/cancel gutter,
Claus Gittinger <cg@exept.de>
parents:
11903
diff
changeset
|
1516 |
"/ showAcceptCancelBarChannel := (ValueHolder with: (UserPreferences current showAcceptCancelBarInBrowser)). |
b482d2c77040
changed to not take up screen space for the accept/cancel gutter,
Claus Gittinger <cg@exept.de>
parents:
11903
diff
changeset
|
1517 |
showAcceptCancelBarChannel := ValueHolder with: (UserPreferences current codeView2ShowAcceptCancel). |
b482d2c77040
changed to not take up screen space for the accept/cancel gutter,
Claus Gittinger <cg@exept.de>
parents:
11903
diff
changeset
|
1518 |
|
b482d2c77040
changed to not take up screen space for the accept/cancel gutter,
Claus Gittinger <cg@exept.de>
parents:
11903
diff
changeset
|
1519 |
"/ these views must be created first, as they refer to each other's channels in their |
b482d2c77040
changed to not take up screen space for the accept/cancel gutter,
Claus Gittinger <cg@exept.de>
parents:
11903
diff
changeset
|
1520 |
"/ initialize methods |
b482d2c77040
changed to not take up screen space for the accept/cancel gutter,
Claus Gittinger <cg@exept.de>
parents:
11903
diff
changeset
|
1521 |
gutterView := CodeView2::GutterView new. |
b482d2c77040
changed to not take up screen space for the accept/cancel gutter,
Claus Gittinger <cg@exept.de>
parents:
11903
diff
changeset
|
1522 |
textViewScroller := HVScrollableView for: CodeView2::TextView in: self. |
b482d2c77040
changed to not take up screen space for the accept/cancel gutter,
Claus Gittinger <cg@exept.de>
parents:
11903
diff
changeset
|
1523 |
textView := textViewScroller scrolledView. |
10793
c19380a197aa
Added channel for controlling visibility of accept/cancel
vrany
parents:
10791
diff
changeset
|
1524 |
|
9985 | 1525 |
self initializeGutterView. |
1526 |
self initializeTextView. |
|
1527 |
textView setCodeView:self. |
|
13813 | 1528 |
modifiedChannel := ValueHolder with:false. |
9985 | 1529 |
diffMode := false. |
1530 |
synchronizedCodeViews := #(). |
|
13813 | 1531 |
currentParseNodeHolder := ValueHolder new. |
1532 |
currentBlockNodeHolder := ValueHolder new. |
|
10767 | 1533 |
|
1534 |
servicesFromClient := false. |
|
9985 | 1535 |
services := OrderedCollection new. |
10834 | 1536 |
self initializeServices. |
9985 | 1537 |
|
1538 |
"Modified: / 14-12-2009 / 13:59:53 / Jindra <a>" |
|
1539 |
"Modified: / 06-04-2010 / 13:56:35 / Jakub <zelenja7@fel.cvut.cz>" |
|
10767 | 1540 |
"Modified: / 06-10-2011 / 14:15:48 / cg" |
13813 | 1541 |
"Modified: / 16-02-2012 / 23:05:34 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
9985 | 1542 |
! |
1543 |
||
1544 |
initializeGutterView |
|
1545 |
||
11988
b482d2c77040
changed to not take up screen space for the accept/cancel gutter,
Claus Gittinger <cg@exept.de>
parents:
11903
diff
changeset
|
1546 |
gutterView setCodeView:self. |
13993 | 1547 |
gutterView currentBlockNodeHolder: self currentBlockNodeHolder. |
13316 | 1548 |
gutterView origin:(0.0 @ 0.0) corner:(gutterView preferredWidth+1 @ 1.0). |
9985 | 1549 |
showGutterChannel value ifTrue:[self addSubView: gutterView]. |
1550 |
||
1551 |
"Created: / 02-09-2009 / 21:35:56 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1552 |
"Modified: / 23-06-2010 / 19:14:55 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1553 |
! |
|
1554 |
||
1555 |
initializeServices |
|
1556 |
| serviceClasses | |
|
10409 | 1557 |
|
10755 | 1558 |
"/ only do it, if the services have not yet been defined by the user of this view |
1559 |
"/ (FileBrowser does not want Smalltalk-specific services) |
|
10767 | 1560 |
servicesFromClient ifFalse:[ |
13942 | 1561 |
serviceClasses := self defaultServices sort:[:a :b|a priority = b priority ifTrue:[a name < b name] ifFalse:[a priority > b priority]]. |
1562 |
serviceClasses do:[:cls| |
|
1563 |
self registerService: cls new |
|
1564 |
]. |
|
10755 | 1565 |
]. |
9985 | 1566 |
|
13208 | 1567 |
"Modified: / 22-07-2013 / 14:02:59 / cg" |
13813 | 1568 |
"Modified: / 24-07-2013 / 11:56:56 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
9985 | 1569 |
! |
1570 |
||
1571 |
initializeTextView |
|
11988
b482d2c77040
changed to not take up screen space for the accept/cancel gutter,
Claus Gittinger <cg@exept.de>
parents:
11903
diff
changeset
|
1572 |
"Initialize textView. gutterView has to be already initialized!!" |
b482d2c77040
changed to not take up screen space for the accept/cancel gutter,
Claus Gittinger <cg@exept.de>
parents:
11903
diff
changeset
|
1573 |
|
9985 | 1574 |
textViewScroller |
1575 |
origin: ((self showGutter ifTrue:[gutterView width] ifFalse:[0.0]) @ 0.0) |
|
1576 |
corner: 1.0@1.0; |
|
1577 |
level: 0. |
|
1578 |
textView level: 0. |
|
1579 |
||
1580 |
textView modifiedChannel addDependent: self. |
|
1581 |
||
1582 |
"Created: / 02-09-2009 / 21:36:02 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1583 |
"Modified: / 23-06-2010 / 19:38:20 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1584 |
! ! |
|
1585 |
||
1586 |
!CodeView2 methodsFor:'menu actions'! |
|
1587 |
||
10689 | 1588 |
accept |
1589 |
textView accept |
|
1590 |
||
1591 |
"Created: / 07-09-2011 / 21:29:07 / cg" |
|
1592 |
! |
|
1593 |
||
10375 | 1594 |
again |
1595 |
textView again |
|
1596 |
||
1597 |
"Created: / 16-02-2010 / 19:36:06 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1598 |
"Created: / 22-07-2011 / 17:44:31 / cg" |
|
1599 |
! |
|
1600 |
||
9985 | 1601 |
browseImplementorsOfIt |
10262 | 1602 |
|
1603 |
textView browseImplementorsOfIt |
|
1604 |
||
1605 |
"Modified: / 30-06-2011 / 19:22:41 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
9985 | 1606 |
! |
1607 |
||
1608 |
browseSendersOfIt |
|
10262 | 1609 |
|
1610 |
textView browseSendersOfIt |
|
1611 |
||
1612 |
"Modified: / 30-06-2011 / 19:22:57 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
9985 | 1613 |
! |
1614 |
||
1615 |
copySelection |
|
1616 |
||
1617 |
textView copySelection |
|
1618 |
||
1619 |
"Created: / 16-02-2010 / 19:36:37 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1620 |
! |
|
1621 |
||
1622 |
cut |
|
1623 |
||
1624 |
textView cut |
|
1625 |
||
1626 |
"Created: / 16-02-2010 / 19:36:06 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1627 |
! |
|
1628 |
||
1629 |
doIt |
|
1630 |
||
1631 |
textView doIt |
|
1632 |
||
1633 |
"Modified: / 16-02-2010 / 19:38:15 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1634 |
! |
|
1635 |
||
1636 |
inspectIt |
|
1637 |
||
1638 |
textView inspectIt |
|
1639 |
||
1640 |
"Modified: / 16-02-2010 / 19:38:26 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1641 |
! |
|
1642 |
||
1643 |
inspectSelectedSelector |
|
1644 |
||
1645 |
self error: 'Not yet implemented' |
|
1646 |
||
1647 |
"Modified: / 14-02-2010 / 15:58:15 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1648 |
! |
|
1649 |
||
1650 |
inspectSyntaxElements |
|
1651 |
||
1652 |
syntaxElements inspect |
|
1653 |
||
1654 |
"Modified: / 14-02-2010 / 15:57:58 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1655 |
! |
|
1656 |
||
1657 |
inspectView |
|
1658 |
||
1659 |
self inspect |
|
1660 |
||
1661 |
"Modified: / 25-03-2010 / 17:58:10 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1662 |
! |
|
1663 |
||
1664 |
pasteOrReplace |
|
1665 |
||
1666 |
textView pasteOrReplace |
|
1667 |
||
1668 |
"Created: / 16-02-2010 / 19:37:08 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1669 |
! |
|
1670 |
||
1671 |
printIt |
|
1672 |
||
1673 |
textView printIt |
|
1674 |
||
1675 |
"Modified: / 16-02-2010 / 19:38:05 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1676 |
! |
|
1677 |
||
1678 |
profileIt |
|
1679 |
||
1680 |
textView profileIt |
|
1681 |
||
1682 |
"Created: / 27-08-2010 / 22:12:42 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1683 |
! |
|
1684 |
||
1685 |
undo |
|
1686 |
||
1687 |
textView undo |
|
1688 |
||
1689 |
"Created: / 16-02-2010 / 19:35:50 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1690 |
! ! |
|
1691 |
||
1692 |
!CodeView2 methodsFor:'menus-dynamic'! |
|
1693 |
||
13108 | 1694 |
debugMenu |
1695 |
^ self class debugMenu decodeAsLiteralArray |
|
1696 |
receiver:self. |
|
1697 |
! |
|
1698 |
||
9985 | 1699 |
editMenu |
10780 | 1700 |
| editMenu superEditMenu moreMenu moreMenuItem | |
1701 |
||
1702 |
superEditMenu := textView superEditMenu. |
|
1703 |
||
1704 |
textView sensor ctrlDown ifTrue:[ |
|
1705 |
^superEditMenu |
|
1706 |
]. |
|
10293 | 1707 |
|
13072 | 1708 |
"/ install the standard 'more' menu into my own menu |
1709 |
moreMenu := superEditMenu subMenuAt: superEditMenu numberOfItems. |
|
1710 |
||
9985 | 1711 |
editMenu := self class editMenu decodeAsLiteralArray. |
1712 |
moreMenuItem := editMenu menuItemLabeled: 'More'. |
|
1713 |
moreMenuItem submenu: moreMenu asMenu. |
|
1714 |
editMenu findGuiResourcesIn: self. |
|
1715 |
^editMenu |
|
1716 |
||
1717 |
"Created: / 25-12-2007 / 10:10:01 / janfrog" |
|
1718 |
"Modified: / 25-12-2007 / 19:50:53 / janfrog" |
|
1719 |
"Modified: / 18-10-2008 / 20:31:16 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
10293 | 1720 |
"Modified: / 08-07-2011 / 13:35:31 / cg" |
10780 | 1721 |
"Modified: / 07-10-2011 / 17:58:39 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
9985 | 1722 |
! |
1723 |
||
10262 | 1724 |
implementorsMenu |
1725 |
||
1726 |
| selectorAndSelectedText selector selectedText implementors | |
|
1727 |
||
1728 |
selectedText := textView selectionAsString. |
|
1729 |
selectedText size > 0 ifTrue:[ |
|
11359 | 1730 |
"/ self windowGroup withWaitCursorDo:[ |
10262 | 1731 |
selectorAndSelectedText := self extractSelectorAndSelectedTextFrom: selectedText. |
1732 |
selector := selectorAndSelectedText first. |
|
1733 |
selectedText := selectorAndSelectedText second. |
|
1734 |
||
1735 |
(selector notNil and:[selector = selectedText]) ifTrue:[ |
|
1736 |
implementors := (SystemBrowser |
|
11359 | 1737 |
findImplementorsOf:selectedText "Any: (Array with:selectedText)" |
1738 |
in:(Smalltalk allClasses) |
|
1739 |
ignoreCase:false) |
|
1740 |
||
1741 |
] ifFalse:[ |
|
10262 | 1742 |
implementors := (SystemBrowser |
11359 | 1743 |
findImplementorsOfAny:(Array with:selectedText with: selector) |
1744 |
in:(Smalltalk allClasses) |
|
1745 |
ignoreCase:false) |
|
1746 |
]. |
|
1747 |
"/ ] |
|
10262 | 1748 |
] ifFalse:[ |
1749 |
implementors := #(). |
|
1750 |
]. |
|
1751 |
||
1752 |
^self implementorsMenu: implementors selector: (selector ? selectedText) |
|
1753 |
||
1754 |
"Modified: / 19-10-2008 / 08:16:50 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
1755 |
"Created: / 30-06-2011 / 19:28:14 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
11359 | 1756 |
"Modified: / 05-03-2012 / 09:02:43 / cg" |
10262 | 1757 |
! |
1758 |
||
13813 | 1759 |
implementorsMenu: implementors selector: selector |
9985 | 1760 |
| menu| |
1761 |
||
1762 |
menu := Menu new. |
|
10465 | 1763 |
implementors isEmptyOrNil ifTrue:[ |
13942 | 1764 |
menu addItem:(MenuItem label:'No implementors found') disable |
9985 | 1765 |
] ifFalse:[ |
13942 | 1766 |
menu addItem:(MenuItem |
1767 |
label:(selector storeString , (' (all implementors) ') asText allItalic) |
|
1768 |
itemValue:[ |
|
1769 |
self browseMethods:implementors |
|
1770 |
label:'Implementors of ' , selector storeString |
|
1771 |
]). |
|
1772 |
||
1773 |
menu addSeparator. |
|
1774 |
(implementors asOrderedCollection sort:[:a :b | a mclass name < b mclass name]) |
|
1775 |
"implementors" do:[:mth | |
|
1776 |
menu |
|
1777 |
addItem:(MenuItem label:(selector storeString |
|
1778 |
, (' in ' , mth containingClass nameInBrowser asText allBold)) |
|
1779 |
itemValue:[ self browseMethod:mth label: 'Implementor of ' , selector storeString ]) |
|
1780 |
] |
|
9985 | 1781 |
]. |
1782 |
^ menu |
|
1783 |
||
1784 |
"Modified: / 19-10-2008 / 08:16:50 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
1785 |
"Created: / 14-02-2010 / 19:39:37 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
13813 | 1786 |
"Modified: / 07-03-2012 / 12:56:56 / cg" |
1787 |
"Modified: / 14-10-2013 / 10:47:02 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
9985 | 1788 |
! |
1789 |
||
10262 | 1790 |
sendersMenu |
1791 |
||
1792 |
| selectorAndSelectedText selector selectedText senders | |
|
1793 |
||
1794 |
selectedText := textView selectionAsString. |
|
1795 |
selectedText size > 0 ifTrue:[ |
|
11359 | 1796 |
"/ self windowGroup withWaitCursorDo:[ |
10262 | 1797 |
selectorAndSelectedText := self extractSelectorAndSelectedTextFrom: selectedText. |
1798 |
selector := selectorAndSelectedText first. |
|
1799 |
selectedText := selectorAndSelectedText second. |
|
1800 |
||
1801 |
(selector notNil and:[selector = selectedText]) ifTrue:[ |
|
1802 |
senders := (SystemBrowser |
|
11359 | 1803 |
findSendersOf:selectedText "Any:(Array with:selectedText)" |
10262 | 1804 |
in:(Smalltalk allClasses) |
1805 |
ignoreCase:false) |
|
1806 |
||
11359 | 1807 |
] ifFalse:[ |
10262 | 1808 |
senders := (SystemBrowser |
1809 |
findSendersOfAny:(Array with:selectedText with: selector) |
|
1810 |
in:(Smalltalk allClasses) |
|
1811 |
ignoreCase:false) |
|
11359 | 1812 |
]. |
1813 |
"/ ] |
|
10262 | 1814 |
] ifFalse:[ |
1815 |
senders := #(). |
|
1816 |
]. |
|
1817 |
||
1818 |
^self sendersMenu: senders selector: (selector ? selectedText) |
|
1819 |
||
1820 |
"Modified: / 19-10-2008 / 08:16:50 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
1821 |
"Created: / 30-06-2011 / 19:28:14 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
11359 | 1822 |
"Modified: / 05-03-2012 / 09:02:56 / cg" |
10262 | 1823 |
! |
1824 |
||
13813 | 1825 |
sendersMenu: senders selector: selector |
11377 | 1826 |
| menu shownSenderItems numCut sendersSorted| |
9985 | 1827 |
|
10262 | 1828 |
menu := Menu new. |
10465 | 1829 |
senders isEmptyOrNil ifTrue:[ |
13942 | 1830 |
menu addItem:(MenuItem label:'No senders found') disable |
9985 | 1831 |
] ifFalse:[ |
13942 | 1832 |
menu addItem:(MenuItem |
1833 |
label:(selector storeString , (' (all senders)') asText allItalic) |
|
1834 |
itemValue:[ |
|
1835 |
self browseMethods:senders |
|
1836 |
label:'Senders of ' , selector storeString |
|
1837 |
]). |
|
1838 |
menu addSeparator. |
|
1839 |
sendersSorted := senders asOrderedCollection |
|
1840 |
sort:[:a :b | a whoString < b whoString]. |
|
1841 |
shownSenderItems := (senders size > 20) ifTrue:[sendersSorted copyTo:20] ifFalse:[sendersSorted]. |
|
1842 |
numCut := senders size - 20. |
|
1843 |
shownSenderItems do:[:mth | |
|
1844 |
menu |
|
1845 |
addItem:(MenuItem label:(mth selector storeString |
|
1846 |
, (' in ' , mth containingClass nameInBrowser asText allBold)) |
|
1847 |
itemValue:[ self browseMethod:mth label: 'Sender of ' , selector storeString ]) |
|
1848 |
]. |
|
1849 |
numCut > 0 ifTrue:[ |
|
1850 |
menu addSeparator. |
|
1851 |
menu addItem:(MenuItem label:('... %1 more senders not shown here' bindWith:numCut)) disable |
|
1852 |
]. |
|
9985 | 1853 |
]. |
1854 |
^ menu |
|
1855 |
||
1856 |
"Modified: / 19-10-2008 / 08:17:00 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
1857 |
"Created: / 14-02-2010 / 19:40:10 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
10262 | 1858 |
"Modified: / 07-07-2011 / 14:51:54 / jv" |
13813 | 1859 |
"Modified: / 07-03-2012 / 12:58:31 / cg" |
1860 |
"Modified: / 14-10-2013 / 10:47:17 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
9985 | 1861 |
! |
1862 |
||
1863 |
servicesMenu |
|
10293 | 1864 |
|menu item anyService| |
1865 |
||
9985 | 1866 |
menu := Menu new. |
13110 | 1867 |
item := (MenuItem label:(resources string:'Services (experimental)')) enabled:false. |
1868 |
menu addItem:item. |
|
1869 |
menu addSeparator. |
|
10293 | 1870 |
|
13097 | 1871 |
"/ disabled, because this menu is now on the gutter, |
1872 |
"/ and it makes it hard to show it again, once hidden |
|
1873 |
||
1874 |
"/ item := MenuItem label:(resources string:'Show Gutter'). |
|
1875 |
"/ item indication:(self showGutterChannel). |
|
1876 |
"/ menu addItem:item. |
|
1877 |
"/ menu addSeparator. |
|
10293 | 1878 |
|
1879 |
anyService := false. |
|
1880 |
services do:[:service | |
|
1881 |
|item| |
|
1882 |
||
1883 |
item := MenuItem label:(resources string:service label). |
|
1884 |
item indication:((AspectAdaptor forAspect:#enabled) subject:service). |
|
13108 | 1885 |
item hideMenuOnActivated:false. |
10293 | 1886 |
menu addItem:item. |
1887 |
anyService := true. |
|
1888 |
]. |
|
1889 |
||
1890 |
anyService ifTrue:[ |
|
1891 |
menu addSeparator. |
|
1892 |
]. |
|
1893 |
||
1894 |
item := MenuItem label:(resources string:'Debug'). |
|
13108 | 1895 |
item submenuChannel:[ self debugMenu ]. |
10293 | 1896 |
menu addItem:item. |
1897 |
||
1898 |
^ menu |
|
9985 | 1899 |
|
1900 |
"Created: / 07-03-2010 / 14:03:00 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
10767 | 1901 |
"Modified: / 06-10-2011 / 14:14:30 / cg" |
9985 | 1902 |
! ! |
1903 |
||
1904 |
!CodeView2 methodsFor:'private'! |
|
1905 |
||
1906 |
codeCompletion |
|
14110 | 1907 |
"/ I found this code 3 times (CodeView2, NewSystemBrowser and DebugView) - smell? |
1908 |
"/ (can we move that to a utility - probably DoWhatIMeanSupport) |
|
1909 |
||
1910 |
|cls language| |
|
9985 | 1911 |
|
1912 |
cls := self classHolder value. |
|
14110 | 1913 |
cls notNil ifTrue:[ |
1914 |
language := cls programmingLanguage |
|
9985 | 1915 |
]. |
1916 |
UserInformation handle:[:ex | |
|
1917 |
self showInfo:(ex messageText). |
|
1918 |
ex proceed. |
|
1919 |
] do:[ |
|
1920 |
self withWaitCursorDo:[ |
|
14110 | 1921 |
DoWhatIMeanSupport codeCompletionForLanguage:language class:cls context:nil codeView:self. |
9985 | 1922 |
] |
1923 |
]. |
|
1924 |
^ self. |
|
1925 |
||
1926 |
"Modified: / 04-07-2006 / 18:48:26 / fm" |
|
1927 |
"Modified: / 20-11-2006 / 12:30:59 / cg" |
|
13559
5215c061491c
Pass programming language when asking DWIM to complete code
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13517
diff
changeset
|
1928 |
"Modified: / 18-09-2013 / 14:18:02 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
9985 | 1929 |
! |
1930 |
||
1931 |
reallyModified |
|
1932 |
"check for modified code by comparing the source against |
|
1933 |
the codeViews contents. |
|
1934 |
Thats the true modified value (in case user undid its changes, |
|
1935 |
and the displayed text is actually original" |
|
1936 |
||
1937 |
|modified changedSource originalSource s1 s2| |
|
1938 |
||
1939 |
textView modified ifTrue:[^true]. |
|
1940 |
||
1941 |
"/ higher prio to prevent it from being changed while we convert it (by editing) |
|
1942 |
Processor activeProcess |
|
1943 |
withHigherPriorityDo:[ |
|
11559 | 1944 |
changedSource := textView contentsAsString asStringCollection. |
9985 | 1945 |
]. |
1946 |
changedSource := changedSource collect:[:line | line string withoutTrailingSeparators withTabsExpanded]. |
|
1947 |
changedSource := changedSource collect:[:line | line isEmpty ifTrue:[nil] ifFalse:[line]]. |
|
1948 |
[changedSource size > 0 and:[changedSource last isNil]] whileTrue:[ |
|
12708
c463b5656d84
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
12354
diff
changeset
|
1949 |
changedSource := changedSource copyButLast:1 |
9985 | 1950 |
]. |
1951 |
changedSource := changedSource asString. |
|
1952 |
||
1953 |
originalSource := textView model value ? ''. |
|
1954 |
||
1955 |
originalSource := originalSource asStringCollection. |
|
1956 |
originalSource := originalSource collect:[:line | line string withoutTrailingSeparators withTabsExpanded]. |
|
13165 | 1957 |
originalSource := originalSource collect:[:line | line asNilIfEmpty]. |
9985 | 1958 |
[originalSource size > 0 and:[originalSource last isNil]] whileTrue:[ |
12708
c463b5656d84
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
12354
diff
changeset
|
1959 |
originalSource := originalSource copyButLast:1 |
9985 | 1960 |
]. |
1961 |
||
1962 |
s1 := originalSource asString. |
|
1963 |
s2 := changedSource asString. |
|
1964 |
modified := (s1 ~= s2). |
|
1965 |
||
1966 |
^ modified |
|
1967 |
||
1968 |
"Created: / 06-02-2010 / 19:59:37 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
11559 | 1969 |
"Modified (format): / 05-06-2012 / 23:55:02 / cg" |
9985 | 1970 |
! |
1971 |
||
1972 |
showInfo: message |
|
1973 |
||
1974 |
| app | |
|
1975 |
(app := self topView application) ifNotNil: |
|
1976 |
[(app respondsTo: #showInfo:) ifTrue: |
|
1977 |
[app showInfo: message]]. |
|
1978 |
||
1979 |
"Modified: / 13-02-2010 / 23:25:53 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1980 |
! ! |
|
1981 |
||
1982 |
!CodeView2 methodsFor:'private-accessing'! |
|
1983 |
||
1984 |
gutterView |
|
1985 |
||
1986 |
^gutterView |
|
1987 |
||
1988 |
"Created: / 14-02-2010 / 15:21:27 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1989 |
! |
|
1990 |
||
1991 |
syntaxElementSelection |
|
1992 |
^ syntaxElementSelection |
|
1993 |
! |
|
1994 |
||
13813 | 1995 |
syntaxElementSelection:anElement |
1996 |
syntaxElementSelection := anElement. |
|
1997 |
"/ anElement isNil ifTrue:[ |
|
1998 |
"/ currentParseNodeHolder value: nil. |
|
1999 |
"/"/ currentBlockNodeHolder value: nil. |
|
2000 |
"/ ] ifFalse:[ |
|
2001 |
"/ currentParseNodeHolder value: anElement node. |
|
2002 |
"/"/ currentBlockNodeHolder value: anElement node enclosingBlock. |
|
2003 |
"/ ] |
|
2004 |
||
2005 |
"Modified: / 24-09-2013 / 00:14:07 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
9985 | 2006 |
! |
2007 |
||
2008 |
syntaxElements |
|
2009 |
^ syntaxElements |
|
2010 |
! |
|
2011 |
||
2012 |
syntaxElements:something |
|
2013 |
syntaxElements := something. |
|
2014 |
! |
|
2015 |
||
2016 |
textView |
|
2017 |
||
2018 |
^textView |
|
2019 |
||
2020 |
"Created: / 14-02-2010 / 15:21:12 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2021 |
! |
|
2022 |
||
2023 |
textViewScroller |
|
2024 |
||
2025 |
^textViewScroller |
|
2026 |
||
2027 |
"Created: / 14-02-2010 / 15:21:18 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2028 |
! ! |
|
2029 |
||
11179 | 2030 |
!CodeView2 methodsFor:'realization'! |
2031 |
||
13062 | 2032 |
disableAllServices |
2033 |
||
2034 |
services do:[:service| |
|
2035 |
service enabled:false. |
|
2036 |
] |
|
2037 |
! |
|
2038 |
||
2039 |
enableAllServices |
|
2040 |
||
2041 |
services do:[:service| |
|
2042 |
service enabled:true. |
|
2043 |
] |
|
2044 |
! |
|
2045 |
||
11179 | 2046 |
postRealize |
2047 |
||
2048 |
services do:[:service| |
|
2049 |
service viewRealized. |
|
2050 |
] |
|
2051 |
||
2052 |
"Created: / 23-01-2012 / 10:35:06 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2053 |
! ! |
|
2054 |
||
13975
21b5fc56a638
Added Tools::CodeView2>>#flash
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13962
diff
changeset
|
2055 |
!CodeView2 methodsFor:'redrawing'! |
21b5fc56a638
Added Tools::CodeView2>>#flash
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13962
diff
changeset
|
2056 |
|
21b5fc56a638
Added Tools::CodeView2>>#flash
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13962
diff
changeset
|
2057 |
flash |
21b5fc56a638
Added Tools::CodeView2>>#flash
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13962
diff
changeset
|
2058 |
textView flash. |
21b5fc56a638
Added Tools::CodeView2>>#flash
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13962
diff
changeset
|
2059 |
|
21b5fc56a638
Added Tools::CodeView2>>#flash
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13962
diff
changeset
|
2060 |
"Created: / 21-02-2014 / 16:57:30 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
21b5fc56a638
Added Tools::CodeView2>>#flash
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13962
diff
changeset
|
2061 |
! ! |
21b5fc56a638
Added Tools::CodeView2>>#flash
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13962
diff
changeset
|
2062 |
|
9985 | 2063 |
!CodeView2 methodsFor:'services'! |
2064 |
||
13108 | 2065 |
breakpointService |
2066 |
"that one or nil" |
|
2067 |
||
2068 |
^ services detect:[:any| (any isKindOf: BreakpointService)] ifNone:nil |
|
2069 |
! |
|
2070 |
||
9985 | 2071 |
registerService: aCodeViewService |
2072 |
||
2073 |
services add: aCodeViewService. |
|
2074 |
aCodeViewService registerIn: self |
|
2075 |
||
2076 |
"Created: / 06-03-2010 / 19:19:40 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2077 |
! |
|
2078 |
||
13108 | 2079 |
syntaxHighlightingService |
2080 |
"that one or nil" |
|
2081 |
||
2082 |
^ services detect:[:any| (any isKindOf: CodeHighlightingService)] ifNone:nil |
|
2083 |
! |
|
2084 |
||
13125 | 2085 |
unregisterAllServices |
2086 |
||
2087 |
services copy do:[:eachService | self unregisterService:eachService ]. |
|
2088 |
! |
|
2089 |
||
11616 | 2090 |
unregisterService: aCodeViewService |
9985 | 2091 |
|
2092 |
services remove: aCodeViewService ifAbsent:[^self]. |
|
2093 |
aCodeViewService unregister. |
|
2094 |
||
2095 |
"Created: / 06-03-2010 / 19:21:10 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
11616 | 2096 |
"Created: / 19-07-2012 / 16:34:18 / cg" |
9985 | 2097 |
! ! |
2098 |
||
2099 |
!CodeView2 methodsFor:'testing'! |
|
2100 |
||
10722 | 2101 |
isCodeView2 |
2102 |
||
2103 |
^true |
|
2104 |
||
2105 |
"Created: / 20-07-2010 / 15:43:05 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2106 |
! |
|
2107 |
||
9985 | 2108 |
isTextView |
2109 |
||
2110 |
^true |
|
2111 |
||
2112 |
"Created: / 14-02-2010 / 22:13:37 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2113 |
! ! |
|
2114 |
||
2115 |
!CodeView2::GutterView methodsFor:'accessing'! |
|
2116 |
||
13098 | 2117 |
menuHolder:aValueThing |
2118 |
menuHolder := aValueThing |
|
2119 |
! |
|
2120 |
||
9985 | 2121 |
setTextView: aTextView |
2122 |
||
2123 |
self assert: textView isNil message:'Attempting to set textView twice'. |
|
2124 |
textView := aTextView. |
|
2125 |
||
13057 | 2126 |
textView addDependent:self. |
2127 |
||
10577 | 2128 |
"/ self backgroundPaint: textView backgroundPaint darkened lighter. |
2129 |
self viewBackground: (View defaultBackgroundColor). "/ textView backgroundPaint darkened lighter. |
|
9985 | 2130 |
self paint: textView paint. |
2131 |
self font: textView font. |
|
2132 |
||
2133 |
"Created: / 02-09-2009 / 21:55:43 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2134 |
"Modified: / 14-12-2009 / 15:09:29 / Jindra <a>" |
|
2135 |
"Modified: / 09-02-2010 / 20:03:06 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
10577 | 2136 |
"Modified: / 17-08-2011 / 15:15:09 / cg" |
9985 | 2137 |
! |
2138 |
||
2139 |
setTextViewScroller:aScr |
|
2140 |
textViewScroller := aScr. |
|
2141 |
||
2142 |
"Created: / 07-12-2009 / 22:36:31 / Jindra <a>" |
|
13567 | 2143 |
! |
2144 |
||
2145 |
showLineNumbers:aBoolean |
|
2146 |
"can be used to turn off linenumber drawing, |
|
2147 |
in case the gutter is used with another view anf only the other features (breakpoints) are needed" |
|
2148 |
||
2149 |
showLineNumbers := aBoolean. |
|
9985 | 2150 |
! ! |
2151 |
||
2152 |
!CodeView2::GutterView methodsFor:'accessing-dimensions'! |
|
2153 |
||
10781 | 2154 |
acceptButtonBottom |
2155 |
||
10791 | 2156 |
^(self height * 0.6) ceiling. |
10781 | 2157 |
|
2158 |
"Created: / 07-10-2011 / 19:53:47 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2159 |
! |
|
2160 |
||
13813 | 2161 |
acceptCancelRight |
13942 | 2162 |
^((self paddingLeft) + self usedWidthForAcceptCancel) |
13813 | 2163 |
|
2164 |
"Created: / 10-09-2013 / 03:00:53 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
13942 | 2165 |
"Modified: / 14-02-2014 / 12:06:25 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
13813 | 2166 |
! |
2167 |
||
10781 | 2168 |
cancelButtonBottom |
2169 |
||
10791 | 2170 |
^(self height * 0.8) ceiling. |
10781 | 2171 |
|
2172 |
"Created: / 07-10-2011 / 19:54:12 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2173 |
! |
|
2174 |
||
9985 | 2175 |
padding |
2176 |
||
2177 |
^self paddingLeft + self paddingRight |
|
11988
b482d2c77040
changed to not take up screen space for the accept/cancel gutter,
Claus Gittinger <cg@exept.de>
parents:
11903
diff
changeset
|
2178 |
+ self usedWidthForAcceptCancel |
9985 | 2179 |
+ (widthAnnotations ? 0) |
2180 |
+ (widthDiffInfo ? 0) |
|
2181 |
||
2182 |
"Created: / 14-02-2010 / 22:28:57 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
10781 | 2183 |
"Modified: / 07-10-2011 / 19:01:27 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2184 |
"Modified (format): / 07-10-2011 / 20:45:05 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
9985 | 2185 |
! |
2186 |
||
2187 |
paddingLeft |
|
2188 |
||
2189 |
^0"px" |
|
2190 |
||
2191 |
"Created: / 14-02-2010 / 22:27:17 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2192 |
"Modified: / 16-06-2011 / 13:47:53 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2193 |
! |
|
2194 |
||
2195 |
paddingRight |
|
2196 |
||
13813 | 2197 |
^3"px" |
9985 | 2198 |
|
2199 |
"Created: / 14-02-2010 / 22:27:22 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
13813 | 2200 |
"Modified: / 16-02-2012 / 22:40:16 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
9985 | 2201 |
! |
2202 |
||
2203 |
preferredExtent |
|
11467 | 2204 |
| font w h | |
9985 | 2205 |
|
2206 |
explicitExtent ifNotNil:[^explicitExtent]. |
|
2207 |
preferredExtent ifNotNil:[^preferredExtent]. |
|
2208 |
||
11467 | 2209 |
font := self font. |
2210 |
w := (font widthOf:'00') + self padding. |
|
2211 |
h := textView notNil |
|
2212 |
ifTrue:[textView height] |
|
2213 |
ifFalse:[font height * 12]. |
|
9985 | 2214 |
|
2215 |
^preferredExtent := w @ h |
|
2216 |
||
2217 |
"Modified: / 16-06-2011 / 14:03:11 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
11467 | 2218 |
"Modified (format): / 26-03-2012 / 11:19:54 / cg" |
11988
b482d2c77040
changed to not take up screen space for the accept/cancel gutter,
Claus Gittinger <cg@exept.de>
parents:
11903
diff
changeset
|
2219 |
! |
b482d2c77040
changed to not take up screen space for the accept/cancel gutter,
Claus Gittinger <cg@exept.de>
parents:
11903
diff
changeset
|
2220 |
|
b482d2c77040
changed to not take up screen space for the accept/cancel gutter,
Claus Gittinger <cg@exept.de>
parents:
11903
diff
changeset
|
2221 |
usedWidthForAcceptCancel |
13567 | 2222 |
^ (codeView notNil and:[codeView showAcceptCancelBar]) ifTrue:[widthAcceptCancel ? 0] ifFalse:[0] |
9985 | 2223 |
! ! |
2224 |
||
10781 | 2225 |
!CodeView2::GutterView methodsFor:'actions'! |
2226 |
||
2227 |
accept |
|
2228 |
||
2229 |
textView accept |
|
2230 |
||
2231 |
"Created: / 07-10-2011 / 20:23:20 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2232 |
! |
|
2233 |
||
2234 |
cancel |
|
2235 |
||
2236 |
textView cancel |
|
2237 |
||
2238 |
"Created: / 07-10-2011 / 20:23:23 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2239 |
! |
|
2240 |
||
2241 |
diff |
|
2242 |
||
2243 |
"Created: / 07-10-2011 / 20:23:27 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
13097 | 2244 |
! |
2245 |
||
13108 | 2246 |
inspectView |
2247 |
self halt. |
|
2248 |
! |
|
2249 |
||
13098 | 2250 |
middleButtonMenu |
2251 |
menuHolder notNil ifTrue:[^ menuHolder value]. |
|
13567 | 2252 |
codeView isNil ifTrue:[^ nil]. |
13097 | 2253 |
^ codeView servicesMenu |
10781 | 2254 |
! ! |
2255 |
||
13813 | 2256 |
!CodeView2::GutterView methodsFor:'aspects'! |
2257 |
||
2258 |
currentBlockNodeHolder |
|
2259 |
"return/create the 'currentBlockNodeHolder' value holder (automatically generated)" |
|
2260 |
||
2261 |
currentBlockNodeHolder isNil ifTrue:[ |
|
13942 | 2262 |
currentBlockNodeHolder := ValueHolder new. |
2263 |
currentBlockNodeHolder addDependent:self. |
|
13813 | 2264 |
]. |
2265 |
^ currentBlockNodeHolder |
|
2266 |
! |
|
2267 |
||
2268 |
currentBlockNodeHolder:something |
|
2269 |
"set the 'currentBlockNodeHolder' value holder (automatically generated)" |
|
2270 |
||
2271 |
|oldValue newValue| |
|
2272 |
||
2273 |
currentBlockNodeHolder notNil ifTrue:[ |
|
13942 | 2274 |
oldValue := currentBlockNodeHolder value. |
2275 |
currentBlockNodeHolder removeDependent:self. |
|
13813 | 2276 |
]. |
2277 |
currentBlockNodeHolder := something. |
|
2278 |
currentBlockNodeHolder notNil ifTrue:[ |
|
13942 | 2279 |
currentBlockNodeHolder addDependent:self. |
13813 | 2280 |
]. |
2281 |
newValue := currentBlockNodeHolder value. |
|
2282 |
oldValue ~~ newValue ifTrue:[ |
|
13942 | 2283 |
self update:#value with:newValue from:currentBlockNodeHolder. |
13813 | 2284 |
]. |
2285 |
! ! |
|
2286 |
||
9985 | 2287 |
!CodeView2::GutterView methodsFor:'change & update'! |
2288 |
||
13057 | 2289 |
adjustSizeForLongestLine |
13098 | 2290 |
"recompute the required width (longest linenumber present, not shown)" |
2291 |
||
2292 |
|newNumberOfLines longestLineString textW requiredW newWidth| |
|
2293 |
||
13568 | 2294 |
showLineNumbers ifFalse:[^ self]. |
2295 |
||
13105 | 2296 |
newNumberOfLines := (textView list size max:textView cursorLine). |
13098 | 2297 |
|
2298 |
longestLineString := self displayedString:(newNumberOfLines max:99). |
|
13057 | 2299 |
textW := (longestLineString widthOn:self). |
2300 |
requiredW := textW + self padding. |
|
2301 |
||
2302 |
((requiredW > width) or:[requiredW < (width * 3 // 4)]) ifTrue:[ |
|
2303 |
"/ some hysteresis to avoid quick readjust again |
|
13316 | 2304 |
newWidth := (requiredW "* 1.1") rounded. |
13057 | 2305 |
self corner:(newWidth+1 @ 1.0). |
13316 | 2306 |
|
13085 | 2307 |
[ |
2308 |
textView removeDependent:self. |
|
13568 | 2309 |
textViewScroller notNil ifTrue:[ textViewScroller origin:(newWidth+1 @ 0.0) corner:(1.0 @ 1.0) ]. |
13085 | 2310 |
] ensure:[ |
2311 |
textView addDependent:self. |
|
2312 |
]. |
|
13057 | 2313 |
self invalidate. |
13098 | 2314 |
] ifFalse:[ |
2315 |
numberOfLines ~= newNumberOfLines ifTrue:[ |
|
2316 |
self invalidate |
|
2317 |
] |
|
13057 | 2318 |
]. |
2319 |
! |
|
2320 |
||
9985 | 2321 |
update:something with:aParameter from:changedObject |
14127 | 2322 |
|deltaY numPixels hScrollerHeight| |
9985 | 2323 |
|
10326 | 2324 |
(changedObject == textView) ifTrue:[ |
13942 | 2325 |
((something == #sizeOfContents) |
2326 |
or:[ "false "(something == #visibility)"" ]) ifTrue:[ |
|
2327 |
self adjustSizeForLongestLine. |
|
13057 | 2328 |
|
14127 | 2329 |
"/ (numberOfLines ~= (textView list size max:textView cursorLine)) ifTrue:[ |
2330 |
"/ self invalidate. |
|
2331 |
"/ ]. |
|
13942 | 2332 |
^ self. |
2333 |
]. |
|
2334 |
something == #originOfContents ifTrue:[ |
|
14127 | 2335 |
aParameter notNil ifTrue:[ |
2336 |
deltaY := aParameter y. |
|
2337 |
deltaY = 0 ifTrue:[^ self]. |
|
2338 |
||
2339 |
numPixels := deltaY abs. |
|
2340 |
numPixels < (height // 5) ifTrue:[ |
|
2341 |
deltaY < 0 ifTrue:[ |
|
2342 |
self invalidateX:0 y:0 width:width height:numPixels. |
|
2343 |
] ifFalse:[ |
|
2344 |
hScrollerHeight := 0. |
|
2345 |
(textViewScroller notNil |
|
2346 |
and:[textViewScroller horizontalScrollBar notNil]) ifTrue:[ |
|
2347 |
hScrollerHeight := textViewScroller horizontalScrollBar height. |
|
2348 |
]. |
|
2349 |
numPixels := numPixels + 4. |
|
2350 |
self invalidateX:0 y:height-numPixels-hScrollerHeight width:width height:numPixels+hScrollerHeight. |
|
2351 |
]. |
|
2352 |
self repairDamage. |
|
2353 |
^ self. |
|
2354 |
]. |
|
2355 |
]. |
|
13942 | 2356 |
self invalidateLines. |
2357 |
^ self. |
|
2358 |
]. |
|
2359 |
"/ something printCR. |
|
10312 | 2360 |
]. |
13057 | 2361 |
|
10781 | 2362 |
(changedObject == textView reallyModifiedChannel) ifTrue:[ |
13942 | 2363 |
self invalidateAcceptCancelBar. |
2364 |
^self. |
|
10781 | 2365 |
]. |
9985 | 2366 |
|
2367 |
super update:something with:aParameter from:changedObject |
|
2368 |
||
10326 | 2369 |
"Modified (format): / 15-07-2011 / 20:14:04 / cg" |
13942 | 2370 |
"Modified: / 14-02-2014 / 12:08:40 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
9985 | 2371 |
! ! |
2372 |
||
2373 |
!CodeView2::GutterView methodsFor:'event handling'! |
|
2374 |
||
2375 |
buttonPress: btn x: x y: y |
|
11520
091c7e0e435a
added a save-area (line-number) into which a click does not toggle
Claus Gittinger <cg@exept.de>
parents:
11467
diff
changeset
|
2376 |
|extraSafeArea| |
091c7e0e435a
added a save-area (line-number) into which a click does not toggle
Claus Gittinger <cg@exept.de>
parents:
11467
diff
changeset
|
2377 |
|
11988
b482d2c77040
changed to not take up screen space for the accept/cancel gutter,
Claus Gittinger <cg@exept.de>
parents:
11903
diff
changeset
|
2378 |
(x <= (self paddingLeft + self usedWidthForAcceptCancel)) ifTrue:[ |
b482d2c77040
changed to not take up screen space for the accept/cancel gutter,
Claus Gittinger <cg@exept.de>
parents:
11903
diff
changeset
|
2379 |
textView reallyModified ifTrue:[ |
b482d2c77040
changed to not take up screen space for the accept/cancel gutter,
Claus Gittinger <cg@exept.de>
parents:
11903
diff
changeset
|
2380 |
(y < self acceptButtonBottom) ifTrue:[ |
b482d2c77040
changed to not take up screen space for the accept/cancel gutter,
Claus Gittinger <cg@exept.de>
parents:
11903
diff
changeset
|
2381 |
self accept. |
b482d2c77040
changed to not take up screen space for the accept/cancel gutter,
Claus Gittinger <cg@exept.de>
parents:
11903
diff
changeset
|
2382 |
^self. |
b482d2c77040
changed to not take up screen space for the accept/cancel gutter,
Claus Gittinger <cg@exept.de>
parents:
11903
diff
changeset
|
2383 |
]. |
b482d2c77040
changed to not take up screen space for the accept/cancel gutter,
Claus Gittinger <cg@exept.de>
parents:
11903
diff
changeset
|
2384 |
(y < self cancelButtonBottom) ifTrue:[ |
b482d2c77040
changed to not take up screen space for the accept/cancel gutter,
Claus Gittinger <cg@exept.de>
parents:
11903
diff
changeset
|
2385 |
self cancel. |
b482d2c77040
changed to not take up screen space for the accept/cancel gutter,
Claus Gittinger <cg@exept.de>
parents:
11903
diff
changeset
|
2386 |
^self. |
b482d2c77040
changed to not take up screen space for the accept/cancel gutter,
Claus Gittinger <cg@exept.de>
parents:
11903
diff
changeset
|
2387 |
]. |
b482d2c77040
changed to not take up screen space for the accept/cancel gutter,
Claus Gittinger <cg@exept.de>
parents:
11903
diff
changeset
|
2388 |
self diff. |
10781 | 2389 |
]. |
2390 |
^self. |
|
2391 |
]. |
|
2392 |
||
13567 | 2393 |
false ifTrue:[ |
2394 |
"Do not allow clicking on line numbers..." |
|
2395 |
extraSafeArea := "('999' widthOn:self)" 5. |
|
2396 |
x < (self width - self paddingRight - widthDiffInfo - extraSafeArea) ifFalse:[^ self]. |
|
2397 |
]. |
|
2398 |
||
2399 |
codeView notNil ifTrue:[ |
|
2400 |
((x > (self paddingLeft + self usedWidthForAcceptCancel)) or: |
|
2401 |
[x < (self width - self paddingRight - widthDiffInfo)] |
|
2402 |
) ifTrue:[ |
|
2403 |
(codeView buttonPress: btn x:x y:y in: self) ifTrue:[^ self]. "/ event eaten |
|
2404 |
]. |
|
2405 |
]. |
|
2406 |
super buttonPress: btn x: x y: y |
|
9985 | 2407 |
|
2408 |
"Created: / 17-06-2011 / 13:02:54 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
11520
091c7e0e435a
added a save-area (line-number) into which a click does not toggle
Claus Gittinger <cg@exept.de>
parents:
11467
diff
changeset
|
2409 |
"Modified (comment): / 18-05-2012 / 10:56:54 / cg" |
13813 | 2410 |
! |
2411 |
||
2412 |
sizeChanged:how |
|
2413 |
super sizeChanged:how. |
|
2414 |
self invalidateAcceptCancelBar. |
|
2415 |
||
2416 |
"Created: / 10-09-2013 / 03:19:29 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
9985 | 2417 |
! ! |
2418 |
||
11220 | 2419 |
!CodeView2::GutterView methodsFor:'help'! |
2420 |
||
2421 |
flyByHelpText |
|
13127 | 2422 |
|bpntService| |
12903 | 2423 |
|
13568 | 2424 |
(codeView notNil |
2425 |
and:[ (bpntService := codeView breakpointService) notNil |
|
2426 |
and:[ bpntService isEnabled ]]) ifTrue:[ |
|
2427 |
^ bpntService flyByHelpText |
|
12903 | 2428 |
]. |
13568 | 2429 |
^ nil |
11220 | 2430 |
! ! |
2431 |
||
9985 | 2432 |
!CodeView2::GutterView methodsFor:'initialization'! |
2433 |
||
2434 |
initialize |
|
2435 |
||
2436 |
super initialize. |
|
11988
b482d2c77040
changed to not take up screen space for the accept/cancel gutter,
Claus Gittinger <cg@exept.de>
parents:
11903
diff
changeset
|
2437 |
|
13567 | 2438 |
showLineNumbers := true. |
2439 |
||
10781 | 2440 |
widthAcceptCancel := 16. |
13813 | 2441 |
widthAnnotations := "16"8. |
9985 | 2442 |
widthDiffInfo := 5. |
2443 |
||
13962 | 2444 |
acceptColor := Color green lighter onDevice:self graphicsDevice. |
2445 |
cancelColor := Color red lighter lighter onDevice:self graphicsDevice. |
|
2446 |
diffColor := Color yellow lighter lighter onDevice:self graphicsDevice. |
|
10781 | 2447 |
|
9985 | 2448 |
"Created: / 16-06-2011 / 13:47:10 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2449 |
! |
|
2450 |
||
2451 |
setCodeView: aCodeView2 |
|
2452 |
||
2453 |
codeView := aCodeView2. |
|
11988
b482d2c77040
changed to not take up screen space for the accept/cancel gutter,
Claus Gittinger <cg@exept.de>
parents:
11903
diff
changeset
|
2454 |
|
9985 | 2455 |
codeView addDependent: self. |
10784 | 2456 |
codeView reallyModifiedChannel addDependent: self. |
13993 | 2457 |
"/ codeView currentBlockNodeHolder addDependent: self. - not needed; currentBlockNodeHolder: does it |
13813 | 2458 |
|
2459 |
textView := aCodeView2 textView. |
|
9985 | 2460 |
textView addDependent: self. |
13993 | 2461 |
"/ do not fetch stuff from others - let others give me things (caller change to send currentBlockNodeHolder: explicitly) |
2462 |
"/ self currentBlockNodeHolder: codeView currentBlockNodeHolder. |
|
9985 | 2463 |
textViewScroller := aCodeView2 textViewScroller. |
10577 | 2464 |
"/ self backgroundPaint: (textView viewBackground "backgroundPaint" blendWith: (Color gray:80)). |
2465 |
self viewBackground: (View defaultBackgroundColor). |
|
9985 | 2466 |
|
2467 |
"Created: / 14-02-2010 / 15:19:40 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
10577 | 2468 |
"Modified: / 17-08-2011 / 15:15:55 / cg" |
13813 | 2469 |
"Modified: / 05-04-2012 / 17:46:21 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
9985 | 2470 |
! ! |
2471 |
||
2472 |
!CodeView2::GutterView methodsFor:'queries'! |
|
2473 |
||
2474 |
displayedString: line |
|
2475 |
"get text to display in gutter for specified list line number" |
|
2476 |
||
2477 |
^(line asString). |
|
2478 |
||
2479 |
"Created: / 14-12-2009 / 13:37:47 / Jindra <a>" |
|
2480 |
! |
|
2481 |
||
13105 | 2482 |
lineColorForLine:line |
9985 | 2483 |
"return special color for given line if required, nil otherwise" |
13105 | 2484 |
"used only if lineFont returns nil" |
9985 | 2485 |
|
2486 |
^nil |
|
2487 |
||
2488 |
"Created: / 14-12-2009 / 15:01:31 / Jindra <a>" |
|
2489 |
! |
|
2490 |
||
2491 |
lineDisplayable:line |
|
2492 |
"true if this list line can be displayed" |
|
2493 |
^(textView listLineIsVisible:line) |
|
2494 |
||
2495 |
"Created: / 14-12-2009 / 13:38:23 / Jindra <a>" |
|
2496 |
! |
|
2497 |
||
13105 | 2498 |
lineFontForLine:line |
9985 | 2499 |
"return special font for given line if required, nil otherwise" |
2500 |
||
2501 |
^nil |
|
2502 |
||
2503 |
"Created: / 14-12-2009 / 14:40:17 / Jindra <a>" |
|
2504 |
! |
|
2505 |
||
13566 | 2506 |
wantsFocusWithButtonPress |
2507 |
^ false. |
|
2508 |
! |
|
2509 |
||
13213 | 2510 |
yOfTextViewLine:lineNr |
2511 |
"defined to allow computation of a line below what is visible in |
|
2512 |
the textView (because gutter may become higher than textView, iff |
|
2513 |
the textView has a horizontal scrollbar" |
|
2514 |
||
2515 |
|visibleLineNr "{ Class: SmallInteger }"| |
|
2516 |
||
13813 | 2517 |
"/JV: BAD, BAD BAD - check senders, they are not prepared |
2518 |
"/ to get nil!! |
|
13213 | 2519 |
shown ifFalse:[^ nil]. |
2520 |
lineNr isNil ifTrue:[^ nil]. |
|
2521 |
visibleLineNr := lineNr - textView firstLineShown + 1. |
|
2522 |
^ textView yOfVisibleLine:visibleLineNr |
|
13813 | 2523 |
|
2524 |
"Modified (format): / 28-08-2013 / 12:49:47 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
9985 | 2525 |
! ! |
2526 |
||
2527 |
!CodeView2::GutterView methodsFor:'redrawing'! |
|
2528 |
||
13813 | 2529 |
invalidateAcceptCancelBar |
2530 |
| w | |
|
2531 |
||
13978
f4adc42d7354
Fixed some redraw problems when internal accept-cancel is disabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13975
diff
changeset
|
2532 |
w := self acceptCancelRight. |
f4adc42d7354
Fixed some redraw problems when internal accept-cancel is disabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13975
diff
changeset
|
2533 |
w == 0 ifTrue:[ ^ self ]. |
13813 | 2534 |
self |
13942 | 2535 |
invalidateX: 0 |
2536 |
y: 0 |
|
2537 |
width: w |
|
2538 |
height: self height. |
|
13813 | 2539 |
|
2540 |
"Created: / 10-09-2013 / 03:07:45 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
13978
f4adc42d7354
Fixed some redraw problems when internal accept-cancel is disabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13975
diff
changeset
|
2541 |
"Modified: / 21-02-2014 / 21:50:35 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
13813 | 2542 |
! |
2543 |
||
13097 | 2544 |
invalidateDeviceRectangle:aRectangle repairNow:doRepairNow |
2545 |
^ super invalidateDeviceRectangle:aRectangle repairNow:doRepairNow |
|
2546 |
! |
|
2547 |
||
13813 | 2548 |
invalidateLines |
2549 |
||
2550 |
| x0 | |
|
13942 | 2551 |
x0 := self acceptCancelRight + 1. |
13813 | 2552 |
self |
13942 | 2553 |
invalidateX: x0 |
2554 |
y: 0 |
|
2555 |
width: self width - x0 |
|
2556 |
height: self height. |
|
13813 | 2557 |
|
2558 |
"Created: / 10-09-2013 / 03:08:18 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
13942 | 2559 |
"Modified: / 14-02-2014 / 12:19:55 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
13813 | 2560 |
! |
2561 |
||
10781 | 2562 |
redrawAcceptCancelBarX: x y: y width:w height:h |
2563 |
||
13978
f4adc42d7354
Fixed some redraw problems when internal accept-cancel is disabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13975
diff
changeset
|
2564 |
| rw acceptRight acceptBottom cancelBottom | |
f4adc42d7354
Fixed some redraw problems when internal accept-cancel is disabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13975
diff
changeset
|
2565 |
|
f4adc42d7354
Fixed some redraw problems when internal accept-cancel is disabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13975
diff
changeset
|
2566 |
acceptRight := self acceptCancelRight. |
f4adc42d7354
Fixed some redraw problems when internal accept-cancel is disabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13975
diff
changeset
|
2567 |
x >= acceptRight ifTrue:[ |
13942 | 2568 |
^self. |
10781 | 2569 |
]. |
13978
f4adc42d7354
Fixed some redraw problems when internal accept-cancel is disabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13975
diff
changeset
|
2570 |
rw := ((x + w) min: acceptRight) - x. |
13813 | 2571 |
|
10781 | 2572 |
|
2573 |
textView reallyModified ifFalse:[ |
|
13942 | 2574 |
self fillRectangleX:x y:y width:rw height:h color: self viewBackground |
10781 | 2575 |
] ifTrue:[ |
13942 | 2576 |
acceptBottom := self acceptButtonBottom. |
2577 |
cancelBottom := self cancelButtonBottom. |
|
2578 |
y < acceptBottom ifTrue:[ |
|
2579 |
self fillRectangleX:x y:y width:rw height: ((y + h) min: acceptBottom) color: acceptColor. |
|
2580 |
]. |
|
2581 |
(y < cancelBottom) ifTrue:[ |
|
2582 |
self fillRectangleX:x y: acceptBottom + 1width:rw height: ((y + h) min: cancelBottom) - acceptBottom - 1color: cancelColor. |
|
2583 |
]. |
|
2584 |
(y + h >= cancelBottom) ifTrue:[ |
|
2585 |
self fillRectangleX:x y: cancelBottom + 1 width:rw height: (y + h) - cancelBottom - 1 color: diffColor. |
|
2586 |
] |
|
13813 | 2587 |
|
10781 | 2588 |
] |
2589 |
||
2590 |
"Created: / 07-10-2011 / 19:44:57 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
13978
f4adc42d7354
Fixed some redraw problems when internal accept-cancel is disabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13975
diff
changeset
|
2591 |
"Modified: / 21-02-2014 / 21:49:45 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
10781 | 2592 |
! |
2593 |
||
9985 | 2594 |
redrawBackgroundX:x y:y width:w height:h |
2595 |
"redraws gutter background" |
|
2596 |
||
13091 | 2597 |
|savPaint| |
2598 |
||
9985 | 2599 |
"background is filled with background color" |
2600 |
self |
|
13057 | 2601 |
clearRectangleX:x |
9985 | 2602 |
y:y |
2603 |
width:w |
|
13057 | 2604 |
height:h. |
9985 | 2605 |
|
13091 | 2606 |
"separator line is drawn in grey" |
2607 |
savPaint := self paint. |
|
2608 |
self paint:Color grey. |
|
2609 |
||
9985 | 2610 |
self |
13057 | 2611 |
displayLineFromX:(width - 1) |
9985 | 2612 |
y:y |
13057 | 2613 |
toX:(width - 1) |
9985 | 2614 |
y:(y+h). |
2615 |
||
13091 | 2616 |
self paint:savPaint. |
2617 |
||
9985 | 2618 |
"Created: / 14-12-2009 / 13:15:53 / Jindra <a>" |
2619 |
"Modified: / 14-12-2009 / 15:09:54 / Jindra <a>" |
|
10577 | 2620 |
"Modified: / 17-08-2011 / 15:12:47 / cg" |
10781 | 2621 |
"Modified (comment): / 07-10-2011 / 19:37:05 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
9985 | 2622 |
! |
2623 |
||
2624 |
redrawLine:line |
|
2625 |
||
2626 |
^self redrawLine:line cleared: false. |
|
2627 |
||
2628 |
"Modified: / 17-06-2011 / 14:12:31 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2629 |
! |
|
2630 |
||
2631 |
redrawLine:line cleared: cleared |
|
2632 |
"redraws specified line. Returns width of drawn object. Color of drawn objects should be taken from lineFont, lineColor" |
|
2633 |
||
13057 | 2634 |
^ self redrawLine:line cleared:cleared drawServices:true |
2635 |
! |
|
2636 |
||
2637 |
redrawLine:line cleared:cleared drawServices:drawServices |
|
13813 | 2638 |
"redraws specified line. Returns width of drawn object. |
13213 | 2639 |
Color of drawn objects should be taken from lineFont, lineColor" |
13813 | 2640 |
|
13213 | 2641 |
|lineString yTop yBaseline fontAscent fontDescent |
2642 |
textW requiredW oldFont newFont oldColor newColor| |
|
9985 | 2643 |
|
13813 | 2644 |
shown ifFalse:[ ^ self ]. "/ Do not bother if the view is not shown. |
13574 | 2645 |
textView isNil ifTrue:[^ self]. "/ happens when shown in UIPainter |
2646 |
||
13567 | 2647 |
requiredW := self width. |
2648 |
||
2649 |
showLineNumbers ifTrue:[ |
|
13942 | 2650 |
lineString := self displayedString:line. |
2651 |
||
2652 |
textW := (lineString widthOn:self). |
|
2653 |
requiredW := textW + self padding. |
|
2654 |
||
2655 |
oldFont := self font. |
|
2656 |
oldColor := self paint. |
|
2657 |
||
2658 |
newFont := self lineFontForLine:line. |
|
2659 |
newFont isNil ifTrue:[ |
|
2660 |
newFont := oldFont. |
|
2661 |
newColor := self lineColorForLine:line. |
|
13943
510f0343785e
Fixes off-by-one error when drawing annotations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13942
diff
changeset
|
2662 |
newColor notNil ifTrue:[ self paint:newColor ]. |
13942 | 2663 |
]. |
2664 |
newFont ~~ oldFont ifTrue:[ |
|
2665 |
"/ ensure that the line number lines are not higher than the text lines |
|
14145
78c992303423
Access graphicsDevice via method send instead of instVar access
Stefan Vogel <sv@exept.de>
parents:
14127
diff
changeset
|
2666 |
(newFont heightOn:self graphicsDevice) > (textView font heightOn:self graphicsDevice) ifTrue:[ |
13942 | 2667 |
newFont := textView font. |
2668 |
]. |
|
2669 |
newFont ~~ oldFont ifTrue:[ |
|
2670 |
self font:newFont |
|
2671 |
]. |
|
2672 |
]. |
|
11424
69b3960c7757
care for small text-font in gutterview
Claus Gittinger <cg@exept.de>
parents:
11398
diff
changeset
|
2673 |
]. |
9985 | 2674 |
|
13962 | 2675 |
fontAscent := textView font ascentOn:self graphicsDevice. |
2676 |
fontDescent := textView font descentOn:self graphicsDevice. |
|
13574 | 2677 |
|
13943
510f0343785e
Fixes off-by-one error when drawing annotations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13942
diff
changeset
|
2678 |
|
13584 | 2679 |
yTop := (self yOfTextViewLine:line) ? 0. |
13574 | 2680 |
yBaseline := yTop + fontAscent. |
2681 |
||
9985 | 2682 |
cleared ifFalse:[ |
13962 | 2683 |
self clearRectangleX:0 y:yBaseline - gc font ascent |
2684 |
width:width - 2 |
|
2685 |
height:gc font ascent + gc font descent. |
|
9985 | 2686 |
]. |
2687 |
||
13057 | 2688 |
"/ cg: this should be done differently: services know about the |
2689 |
"/ gutter, so they should respond to a special drawGutter message. |
|
13105 | 2690 |
"/ otherwise, some redraws become unusably slow (especially |
13057 | 2691 |
"/ with multiple fonts/colors/emphases)... |
2692 |
drawServices ifTrue:[ |
|
13942 | 2693 |
"Let services draw annotations and other stuff" |
2694 |
codeView notNil ifTrue:[ |
|
2695 |
codeView |
|
2696 |
drawLine:line in: self |
|
13962 | 2697 |
atX: self acceptCancelRight + 1 y:yBaseline width: widthAnnotations height:gc font height |
13942 | 2698 |
from:nil to:nil with:self paint and: self backgroundColor. |
2699 |
] |
|
13057 | 2700 |
]. |
9985 | 2701 |
|
13567 | 2702 |
showLineNumbers ifTrue:[ |
13942 | 2703 |
self |
2704 |
displayString:lineString |
|
13943
510f0343785e
Fixes off-by-one error when drawing annotations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13942
diff
changeset
|
2705 |
x:width - widthDiffInfo - textW |
13942 | 2706 |
y:yBaseline. |
13943
510f0343785e
Fixes off-by-one error when drawing annotations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13942
diff
changeset
|
2707 |
newFont notNil ifTrue:[ |
510f0343785e
Fixes off-by-one error when drawing annotations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13942
diff
changeset
|
2708 |
self font:oldFont. |
510f0343785e
Fixes off-by-one error when drawing annotations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13942
diff
changeset
|
2709 |
self paint:oldColor |
510f0343785e
Fixes off-by-one error when drawing annotations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13942
diff
changeset
|
2710 |
] ifFalse:[ |
510f0343785e
Fixes off-by-one error when drawing annotations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13942
diff
changeset
|
2711 |
newColor notNil ifTrue:[ self paint:oldColor ]. |
510f0343785e
Fixes off-by-one error when drawing annotations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13942
diff
changeset
|
2712 |
]. |
13567 | 2713 |
]. |
2714 |
||
13813 | 2715 |
"/ If the view has been cleared here, we have also to redraw corresponding portion |
2716 |
"/ of accept/cancel bar !! |
|
2717 |
cleared ifFalse:[ |
|
13942 | 2718 |
"/ In that case it was cleared above. |
13962 | 2719 |
self redrawAcceptCancelBarX:0 y:yBaseline - gc font ascent |
2720 |
width:width - 2 |
|
2721 |
height:gc font ascent + gc font descent. |
|
13813 | 2722 |
]. |
9985 | 2723 |
^ requiredW. |
2724 |
||
2725 |
"Modified: / 14-12-2009 / 15:30:44 / Jindra <a>" |
|
2726 |
"Created: / 17-06-2011 / 14:11:45 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
11606 | 2727 |
"Modified: / 18-07-2012 / 19:05:24 / cg" |
13943
510f0343785e
Fixes off-by-one error when drawing annotations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13942
diff
changeset
|
2728 |
"Modified: / 14-02-2014 / 17:58:16 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
9985 | 2729 |
! |
2730 |
||
10224 | 2731 |
redrawLinesFrom:start |
13057 | 2732 |
"/ cg: obsolete? |
10312 | 2733 |
start to: (textView lastLineShown - 1 min: textView list size) do:[:line| |
10224 | 2734 |
self redrawLine:line cleared: false. |
2735 |
] |
|
2736 |
||
2737 |
"Created: / 06-07-2011 / 17:25:36 / jv" |
|
10312 | 2738 |
"Modified: / 12-07-2011 / 17:14:25 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
10224 | 2739 |
! |
2740 |
||
13374 | 2741 |
redrawVisibleLine:line |
2742 |
|absLine| |
|
2743 |
||
2744 |
(absLine := textView visibleLineToListLine:line) notNil ifTrue:[ |
|
2745 |
self redrawLine:absLine cleared: false. |
|
2746 |
]. |
|
2747 |
||
2748 |
"Modified: / 17-06-2011 / 14:12:31 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2749 |
! |
|
2750 |
||
13105 | 2751 |
redrawX:x y:y width:w height:h |
13213 | 2752 |
|firstLine lastLine yBot| |
2753 |
||
9985 | 2754 |
self redrawBackgroundX:x y:y width:w height:h. |
10793
c19380a197aa
Added channel for controlling visibility of accept/cancel
vrany
parents:
10791
diff
changeset
|
2755 |
|
13567 | 2756 |
(codeView notNil and:[codeView showAcceptCancelBar]) ifTrue:[ |
10793
c19380a197aa
Added channel for controlling visibility of accept/cancel
vrany
parents:
10791
diff
changeset
|
2757 |
self redrawAcceptCancelBarX:x y:y width:w height:h. |
c19380a197aa
Added channel for controlling visibility of accept/cancel
vrany
parents:
10791
diff
changeset
|
2758 |
]. |
9985 | 2759 |
|
13575 | 2760 |
"/ textview may be nil, if Gutter is shown in the UIPainter!! |
2761 |
textView notNil ifTrue:[ |
|
2762 |
numberOfLines := (textView list size max:textView cursorLine). |
|
2763 |
yBot := y + h. |
|
2764 |
firstLine := textView visibleLineToAbsoluteLine:(textView visibleLineOfY:y). |
|
2765 |
lastLine := textView visibleLineToAbsoluteLine:(textView visibleLineOfY:yBot-1). |
|
2766 |
lastLine := lastLine min:numberOfLines. |
|
2767 |
||
2768 |
firstLine to:lastLine do: [:line | |
|
2769 |
self redrawLine:line cleared:true drawServices:true. |
|
2770 |
]. |
|
13567 | 2771 |
] |
9985 | 2772 |
! ! |
2773 |
||
2774 |
!CodeView2::TextView methodsFor:'accessing'! |
|
2775 |
||
2776 |
changedDiffText |
|
2777 |
^ changedDiffText |
|
2778 |
! |
|
2779 |
||
2780 |
changedDiffText:something |
|
2781 |
changedDiffText := something. |
|
2782 |
! |
|
2783 |
||
2784 |
changedLines |
|
2785 |
^ changedLines |
|
2786 |
||
2787 |
"Created: / 26-04-2010 / 20:30:32 / Jakub <zelenja7@fel.cvut.cz>" |
|
2788 |
"Modified: / 26-04-2010 / 21:48:13 / Jakub <zelenja7@fel.cvut.cz>" |
|
2789 |
! |
|
2790 |
||
2791 |
changedLines:something |
|
2792 |
changedLines := something. |
|
2793 |
||
2794 |
"Created: / 26-04-2010 / 20:30:19 / Jakub <zelenja7@fel.cvut.cz>" |
|
2795 |
"Modified: / 02-05-2010 / 19:13:32 / Jakub <zelenja7@fel.cvut.cz>" |
|
2796 |
! |
|
2797 |
||
10781 | 2798 |
contents: text |
2799 |
||
2800 |
super contents: text. |
|
2801 |
reallyModifiedChannel value: false. |
|
2802 |
||
2803 |
"Created: / 07-10-2011 / 20:32:27 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2804 |
! |
|
2805 |
||
13813 | 2806 |
contents: text clear: clearPrevious |
2807 |
||
2808 |
| savedListOriginal | |
|
2809 |
savedListOriginal := listOriginal. |
|
2810 |
super contents: text. |
|
2811 |
listOriginal := savedListOriginal. |
|
2812 |
self updateReallyModified. |
|
2813 |
||
2814 |
"Created: / 17-02-2012 / 00:35:22 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2815 |
! |
|
2816 |
||
9985 | 2817 |
deletedLines |
2818 |
^ deletedLines |
|
2819 |
||
2820 |
"Modified: / 26-04-2010 / 21:48:23 / Jakub <zelenja7@fel.cvut.cz>" |
|
2821 |
! |
|
2822 |
||
11597 | 2823 |
deletedLines:something |
2824 |
deletedLines := something. |
|
9985 | 2825 |
|
2826 |
"Modified: / 26-04-2010 / 21:48:54 / Jakub <zelenja7@fel.cvut.cz>" |
|
11597 | 2827 |
"Modified (format): / 17-07-2012 / 18:56:44 / cg" |
9985 | 2828 |
! |
2829 |
||
2830 |
diffMode |
|
2831 |
^ diffMode |
|
2832 |
! |
|
2833 |
||
2834 |
diffMode:something |
|
2835 |
diffMode := something. |
|
2836 |
! |
|
2837 |
||
2838 |
emptyLines |
|
2839 |
^ emptyLines |
|
2840 |
! |
|
2841 |
||
2842 |
emptyLines:something |
|
2843 |
emptyLines := something. |
|
2844 |
! |
|
2845 |
||
13813 | 2846 |
fontAscent |
2847 |
^fontAscent notNil ifTrue:[fontAscent] ifFalse:[super fontAscent] |
|
2848 |
||
2849 |
"Created: / 19-05-2012 / 14:13:14 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2850 |
! |
|
2851 |
||
9985 | 2852 |
insertedLines |
2853 |
^ insertedLines |
|
2854 |
||
2855 |
"Modified: / 26-04-2010 / 21:48:27 / Jakub <zelenja7@fel.cvut.cz>" |
|
2856 |
! |
|
2857 |
||
11597 | 2858 |
insertedLines:something |
2859 |
insertedLines := something. |
|
9985 | 2860 |
|
2861 |
"Modified: / 26-04-2010 / 21:48:59 / Jakub <zelenja7@fel.cvut.cz>" |
|
11597 | 2862 |
"Modified (format): / 17-07-2012 / 18:56:50 / cg" |
9985 | 2863 |
! |
2864 |
||
10245 | 2865 |
modifiedChannel: aValueHolder |
2866 |
||
2867 |
super modifiedChannel: aValueHolder |
|
2868 |
||
2869 |
"Created: / 07-07-2011 / 12:27:11 / Jan Vrany <jan.vrant@fit.cvut,cz>" |
|
2870 |
! |
|
2871 |
||
9985 | 2872 |
originDiffText |
2873 |
^ originDiffText |
|
2874 |
! |
|
2875 |
||
2876 |
originDiffText:something |
|
2877 |
originDiffText := something. |
|
10781 | 2878 |
! |
2879 |
||
2880 |
reallyModified |
|
2881 |
||
2882 |
^self reallyModifiedChannel value |
|
2883 |
||
2884 |
"Created: / 07-10-2011 / 19:28:11 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
9985 | 2885 |
! ! |
2886 |
||
11393 | 2887 |
!CodeView2::TextView methodsFor:'accessing-colors'! |
9985 | 2888 |
|
2889 |
colorChanged |
|
2890 |
^ Color redByte:240 greenByte: 192 blueByte: 192 |
|
2891 |
||
2892 |
"Modified: / 24-06-2010 / 14:05:03 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2893 |
! |
|
2894 |
||
2895 |
colorDeleted |
|
2896 |
^ self colorInserted. |
|
2897 |
"/^ Color pink |
|
2898 |
||
2899 |
"Modified: / 24-06-2010 / 14:16:42 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
10781 | 2900 |
"Modified (format): / 07-10-2011 / 20:26:47 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
11597 | 2901 |
"Modified (format): / 17-07-2012 / 18:57:14 / cg" |
9985 | 2902 |
! |
2903 |
||
2904 |
colorInserted |
|
2905 |
^ Color redByte: 239 greenByte: 225 blueByte: 152 |
|
2906 |
||
2907 |
"Modified: / 24-06-2010 / 14:13:14 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2908 |
! ! |
|
2909 |
||
10781 | 2910 |
!CodeView2::TextView methodsFor:'accessing-contents'! |
2911 |
||
10784 | 2912 |
list:aCollection expandTabs:expand scanForNonStrings:scan includesNonStrings:nonStrings |
2913 |
||
2914 |
super list:aCollection expandTabs:expand scanForNonStrings:scan includesNonStrings:nonStrings. |
|
13517 | 2915 |
|
10784 | 2916 |
listOriginal := aCollection copy. |
10834 | 2917 |
reallyModifiedChannel value: false. |
13813 | 2918 |
|
2919 |
"/JV: used to be notifyLines... but that method |
|
2920 |
"/ leaves suppressNotifications to true, which is not what |
|
2921 |
"/ we want!! |
|
2922 |
self updateReallyModified. |
|
2923 |
codeView linesModifiedFrom: 1 to: list size. |
|
10784 | 2924 |
|
2925 |
"Created: / 08-10-2011 / 12:23:52 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
13813 | 2926 |
"Modified (comment): / 03-08-2013 / 13:35:39 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
10784 | 2927 |
! |
2928 |
||
10781 | 2929 |
setList:aCollection expandTabs:expandTabs redraw:doRedraw |
2930 |
||
2931 |
super setList:aCollection expandTabs:expandTabs redraw:doRedraw. |
|
2932 |
listOriginal := aCollection copy. |
|
10834 | 2933 |
reallyModifiedChannel value: false. |
13813 | 2934 |
|
2935 |
"/JV: used to be notifyLines... but that method |
|
2936 |
"/ leaves suppressNotifications to true, which is not what |
|
2937 |
"/ we want!! |
|
2938 |
self updateReallyModified. |
|
2939 |
codeView linesModifiedFrom: 1 to: list size. |
|
10781 | 2940 |
|
2941 |
"Created: / 07-10-2011 / 18:42:56 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
13813 | 2942 |
"Modified (comment): / 03-08-2013 / 13:35:48 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2943 |
! ! |
|
2944 |
||
2945 |
!CodeView2::TextView methodsFor:'accessing-look'! |
|
2946 |
||
2947 |
lineSpacing |
|
2948 |
||
2949 |
^lineSpacing |
|
2950 |
||
2951 |
"Modified: / 22-05-1996 / 12:22:29 / cg" |
|
2952 |
"Created: / 19-03-2012 / 13:22:12 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
10781 | 2953 |
! ! |
2954 |
||
10785 | 2955 |
!CodeView2::TextView methodsFor:'accessing-state'! |
2956 |
||
2957 |
beUnmodified |
|
2958 |
||
2959 |
self modifiedChannel value: false. |
|
2960 |
reallyModifiedChannel value: false. |
|
2961 |
listOriginal := list copy. |
|
2962 |
||
2963 |
"Created: / 08-10-2011 / 12:51:44 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2964 |
! |
|
2965 |
||
2966 |
isModified |
|
2967 |
||
2968 |
^self modified |
|
2969 |
||
2970 |
"Created: / 08-10-2011 / 12:52:13 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2971 |
! |
|
2972 |
||
2973 |
isReallyModified |
|
2974 |
||
2975 |
^self reallyModified |
|
2976 |
||
2977 |
"Created: / 08-10-2011 / 12:52:31 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2978 |
! ! |
|
2979 |
||
13813 | 2980 |
!CodeView2::TextView methodsFor:'bit blitting'! |
2981 |
||
2982 |
copyFrom:aDrawable x:srcX y:srcY toX:dstX y:dstY width:w height:h async:async |
|
13942 | 2983 |
|
2984 |
"/ If doing a vertical scroll, optimized Gutter redraw by |
|
2985 |
"/ copying gutter's image... |
|
2986 |
(scrollInProgress and:[aDrawable == self]) ifTrue:[ |
|
2987 |
"/ Vertical scroll? |
|
2988 |
((srcY ~= dstY) and:[srcX = dstX]) ifTrue:[ |
|
2989 |
"/ Do copy in gutter, but not accept-cancel bar!! |
|
2990 |
| x0 | |
|
2991 |
||
2992 |
x0 := gutterView acceptCancelRight. |
|
2993 |
gutterView |
|
2994 |
copyFrom:gutterView |
|
2995 |
x:x0 |
|
2996 |
y:srcY |
|
2997 |
toX:x0 |
|
2998 |
y:dstY |
|
2999 |
width:(gutterView width - x0) |
|
3000 |
height:h |
|
3001 |
async:false |
|
3002 |
] |
|
13813 | 3003 |
]. |
3004 |
^ super |
|
13942 | 3005 |
copyFrom:aDrawable x:srcX y:srcY toX:dstX y:dstY width:w height:h async:async |
3006 |
||
3007 |
"Modified: / 14-02-2014 / 10:15:20 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
13813 | 3008 |
! ! |
3009 |
||
10781 | 3010 |
!CodeView2::TextView methodsFor:'channels'! |
3011 |
||
3012 |
reallyModifiedChannel |
|
13567 | 3013 |
"return the valueHolder holding true if text was really modified. |
3014 |
This is different from #modified, as the inherited modified flag is cleared |
|
3015 |
to trigger another change notification with every keystroke (for the syntaxHighighter). |
|
3016 |
This may be (now) considered a very bad hack" |
|
10781 | 3017 |
|
3018 |
^ reallyModifiedChannel |
|
3019 |
||
3020 |
"Created: / 07-10-2011 / 18:50:45 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3021 |
! |
|
3022 |
||
3023 |
reallyModifiedChannel: aValueModel |
|
3024 |
||
3025 |
|prev| |
|
3026 |
||
3027 |
prev := reallyModifiedChannel. |
|
3028 |
prev notNil ifTrue:[ |
|
3029 |
gutterView notNil ifTrue:[ |
|
3030 |
reallyModifiedChannel removeDependent: gutterView. |
|
3031 |
] |
|
3032 |
]. |
|
3033 |
reallyModifiedChannel := aValueModel. |
|
3034 |
self setupChannel:aValueModel for:nil withOld:prev. |
|
3035 |
gutterView notNil ifTrue:[ |
|
3036 |
reallyModifiedChannel addDependent: gutterView. |
|
3037 |
] |
|
3038 |
||
3039 |
"Created: / 07-10-2011 / 18:50:27 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3040 |
! ! |
|
3041 |
||
12354
8aac48d63ded
changed default for Jan's quick menus to use the ALT button isntead
Claus Gittinger <cg@exept.de>
parents:
12347
diff
changeset
|
3042 |
!CodeView2::TextView methodsFor:'delegation-events'! |
8aac48d63ded
changed default for Jan's quick menus to use the ALT button isntead
Claus Gittinger <cg@exept.de>
parents:
12347
diff
changeset
|
3043 |
|
8aac48d63ded
changed default for Jan's quick menus to use the ALT button isntead
Claus Gittinger <cg@exept.de>
parents:
12347
diff
changeset
|
3044 |
isQuickMenuModifierPressed |
8aac48d63ded
changed default for Jan's quick menus to use the ALT button isntead
Claus Gittinger <cg@exept.de>
parents:
12347
diff
changeset
|
3045 |
UserPreferences current codeView2QuickSendersAndImplementorsOnControl ifTrue:[ |
13942 | 3046 |
^ self sensor ctrlDown |
12354
8aac48d63ded
changed default for Jan's quick menus to use the ALT button isntead
Claus Gittinger <cg@exept.de>
parents:
12347
diff
changeset
|
3047 |
]. |
13813 | 3048 |
^ self sensor metaDown |
12354
8aac48d63ded
changed default for Jan's quick menus to use the ALT button isntead
Claus Gittinger <cg@exept.de>
parents:
12347
diff
changeset
|
3049 |
! |
8aac48d63ded
changed default for Jan's quick menus to use the ALT button isntead
Claus Gittinger <cg@exept.de>
parents:
12347
diff
changeset
|
3050 |
|
8aac48d63ded
changed default for Jan's quick menus to use the ALT button isntead
Claus Gittinger <cg@exept.de>
parents:
12347
diff
changeset
|
3051 |
isQuickMenuModifierReleased |
8aac48d63ded
changed default for Jan's quick menus to use the ALT button isntead
Claus Gittinger <cg@exept.de>
parents:
12347
diff
changeset
|
3052 |
UserPreferences current codeView2QuickSendersAndImplementorsOnControl ifTrue:[ |
8aac48d63ded
changed default for Jan's quick menus to use the ALT button isntead
Claus Gittinger <cg@exept.de>
parents:
12347
diff
changeset
|
3053 |
^ self sensor ctrlDown not |
8aac48d63ded
changed default for Jan's quick menus to use the ALT button isntead
Claus Gittinger <cg@exept.de>
parents:
12347
diff
changeset
|
3054 |
]. |
8aac48d63ded
changed default for Jan's quick menus to use the ALT button isntead
Claus Gittinger <cg@exept.de>
parents:
12347
diff
changeset
|
3055 |
^ self sensor metaDown not |
8aac48d63ded
changed default for Jan's quick menus to use the ALT button isntead
Claus Gittinger <cg@exept.de>
parents:
12347
diff
changeset
|
3056 |
! ! |
8aac48d63ded
changed default for Jan's quick menus to use the ALT button isntead
Claus Gittinger <cg@exept.de>
parents:
12347
diff
changeset
|
3057 |
|
9985 | 3058 |
!CodeView2::TextView methodsFor:'drawing'! |
3059 |
||
13813 | 3060 |
backgroundForVisibleLine:visLineNr default:bg |
3061 |
| lineNr | |
|
3062 |
||
3063 |
||
3064 |
diffMode ifTrue:[ |
|
13942 | 3065 |
lineNr := self visibleLineToListLine:visLineNr. |
3066 |
(insertedLines notEmptyOrNil and:[insertedLines includes:lineNr]) ifTrue:[ |
|
3067 |
^self colorInserted |
|
3068 |
]. |
|
3069 |
(changedLines notEmptyOrNil and:[changedLines includes:lineNr]) ifTrue:[ |
|
3070 |
^self colorChanged |
|
3071 |
]. |
|
3072 |
(deletedLines notEmptyOrNil and:[deletedLines includes:lineNr]) ifTrue:[ |
|
3073 |
^self colorDeleted |
|
3074 |
]. |
|
13813 | 3075 |
]. |
3076 |
^ bg |
|
3077 |
||
3078 |
"Modified: / 17-03-2012 / 12:22:08 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
9985 | 3079 |
! |
3080 |
||
13813 | 3081 |
drawFromVisibleLine:startVisLineNr to:endVisLineNr with:fg and:bg |
3082 |
"draw a visible line range in fg/bg" |
|
3083 |
||
3084 |
diffMode ifFalse:[ |
|
13942 | 3085 |
super drawFromVisibleLine:startVisLineNr to:endVisLineNr with:fg and:bg. |
3086 |
^self. |
|
13813 | 3087 |
]. |
3088 |
||
3089 |
startVisLineNr to: endVisLineNr do:[:visLineNr| |
|
13942 | 3090 |
self drawVisibleLine: visLineNr with:fg and:bg |
13813 | 3091 |
] |
3092 |
||
3093 |
"Modified: / 15-12-1999 / 23:19:39 / cg" |
|
3094 |
"Created: / 17-03-2012 / 09:44:19 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3095 |
! |
|
3096 |
||
3097 |
drawLine:line fromX:x inVisible:visLineNr with:fg and:bg |
|
3098 |
super |
|
13942 | 3099 |
drawLine:line |
3100 |
fromX:x |
|
3101 |
inVisible:visLineNr |
|
3102 |
with:fg |
|
3103 |
and:(self backgroundForVisibleLine:visLineNr default:bg). |
|
9985 | 3104 |
|
3105 |
"Created: / 05-04-2010 / 12:07:07 / Jakub <zelenja7@fel.cvut.cz>" |
|
3106 |
"Modified: / 02-05-2010 / 18:46:00 / Jakub <zelenja7@fel.cvut.cz>" |
|
13813 | 3107 |
"Modified: / 17-03-2012 / 10:05:02 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
9985 | 3108 |
! |
3109 |
||
13813 | 3110 |
drawLine:lineStringArg inVisible:visLineNr col:col with:fg and:bg |
3111 |
super |
|
13942 | 3112 |
drawLine:lineStringArg |
3113 |
inVisible:visLineNr |
|
3114 |
col:col |
|
3115 |
with:fg |
|
3116 |
and:(self backgroundForVisibleLine:visLineNr default:bg). |
|
9985 | 3117 |
|
3118 |
"Created: / 05-04-2010 / 11:49:42 / Jakub <zelenja7@fel.cvut.cz>" |
|
3119 |
"Modified: / 02-05-2010 / 18:45:56 / Jakub <zelenja7@fel.cvut.cz>" |
|
13813 | 3120 |
"Modified: / 17-03-2012 / 10:04:59 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
9985 | 3121 |
! |
3122 |
||
13813 | 3123 |
drawLine:lineStringArg inVisible:visLineNr from:startCol to:endColOrNil with:fg and:bg |
3124 |
super |
|
13942 | 3125 |
drawLine:lineStringArg |
3126 |
inVisible:visLineNr |
|
3127 |
from:startCol |
|
3128 |
to:endColOrNil |
|
3129 |
with:fg |
|
3130 |
and:(self backgroundForVisibleLine:visLineNr default:bg). |
|
9985 | 3131 |
|
3132 |
"Created: / 05-04-2010 / 11:54:54 / Jakub <zelenja7@fel.cvut.cz>" |
|
3133 |
"Modified: / 02-05-2010 / 18:45:52 / Jakub <zelenja7@fel.cvut.cz>" |
|
13813 | 3134 |
"Modified: / 17-03-2012 / 10:04:55 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
9985 | 3135 |
! |
3136 |
||
13813 | 3137 |
drawLine:lineString inVisible:visLineNr from:startCol with:fg and:bg |
3138 |
super |
|
13942 | 3139 |
drawLine:lineString |
3140 |
inVisible:visLineNr |
|
3141 |
from:startCol |
|
3142 |
with:fg |
|
3143 |
and:(self backgroundForVisibleLine:visLineNr default:bg). |
|
9985 | 3144 |
|
3145 |
"Created: / 05-04-2010 / 11:54:26 / Jakub <zelenja7@fel.cvut.cz>" |
|
3146 |
"Modified: / 02-05-2010 / 18:45:48 / Jakub <zelenja7@fel.cvut.cz>" |
|
13813 | 3147 |
"Modified: / 17-03-2012 / 10:04:52 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
9985 | 3148 |
! |
3149 |
||
13813 | 3150 |
drawVisibleLine:visLineNr with:fg and:bg |
3151 |
super |
|
13942 | 3152 |
drawVisibleLine:visLineNr |
3153 |
with:fg |
|
3154 |
and:(self backgroundForVisibleLine:visLineNr default:bg). |
|
9985 | 3155 |
|
3156 |
"Created: / 05-04-2010 / 11:49:42 / Jakub <zelenja7@fel.cvut.cz>" |
|
3157 |
"Modified: / 02-05-2010 / 18:45:44 / Jakub <zelenja7@fel.cvut.cz>" |
|
13813 | 3158 |
"Modified: / 17-03-2012 / 10:04:49 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
9985 | 3159 |
! |
3160 |
||
3161 |
redrawLines |
|
13374 | 3162 |
"redraw diff lines" |
3163 |
||
9985 | 3164 |
|i pom| |
3165 |
||
3166 |
diffMode ifFalse:[^self]. |
|
13813 | 3167 |
true ifTrue:[^self]. |
3168 |
||
9985 | 3169 |
|
3170 |
pom := self hasSelection. |
|
3171 |
(pom) ifTrue:[ ^ self. ]. |
|
12992 | 3172 |
|
9985 | 3173 |
i := 1. |
3174 |
[ |
|
13942 | 3175 |
i <= (deletedLines size) |
9985 | 3176 |
] whileTrue:[ |
13942 | 3177 |
((deletedLines at:i) > 0) ifTrue:[ |
3178 |
super |
|
3179 |
drawVisibleLine:(deletedLines at:i) |
|
3180 |
with:fgColor |
|
3181 |
and:self colorDeleted. |
|
3182 |
]. |
|
3183 |
i := i + 1. |
|
9985 | 3184 |
]. |
3185 |
i := 1. |
|
3186 |
[ |
|
13942 | 3187 |
i <= (insertedLines size) |
9985 | 3188 |
] whileTrue:[ |
13942 | 3189 |
((insertedLines at:i) > 0) ifTrue:[ |
3190 |
super |
|
3191 |
drawVisibleLine:(insertedLines at:i) |
|
3192 |
with:fgColor |
|
3193 |
and:self colorInserted. |
|
3194 |
]. |
|
3195 |
i := i + 1. |
|
9985 | 3196 |
]. |
3197 |
i := 1. |
|
3198 |
[ |
|
13942 | 3199 |
i <= (changedLines size) |
9985 | 3200 |
] whileTrue:[ |
13942 | 3201 |
((changedLines at:i) > 0) ifTrue:[ |
3202 |
super |
|
3203 |
drawVisibleLine:(changedLines at:i) |
|
3204 |
with:fgColor |
|
3205 |
and:self colorChanged. |
|
3206 |
]. |
|
3207 |
i := i + 1. |
|
9985 | 3208 |
]. |
3209 |
||
3210 |
"Created: / 26-04-2010 / 21:04:31 / Jakub <zelenja7@fel.cvut.cz>" |
|
3211 |
"Modified: / 22-06-2010 / 23:28:30 / Jakub <zelenja7@fel.cvut.cz>" |
|
13813 | 3212 |
"Modified: / 17-03-2012 / 09:27:40 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
9985 | 3213 |
! ! |
3214 |
||
3215 |
!CodeView2::TextView methodsFor:'editing'! |
|
3216 |
||
3217 |
contentsChanged |
|
13051 | 3218 |
"this one is sent, whenever contents changes its size" |
3219 |
||
9985 | 3220 |
super contentsChanged. |
13057 | 3221 |
|
3222 |
"/ codeView diffMode ifTrue:[ |
|
3223 |
"/ changedDiffText ifTrue:[ |
|
3224 |
"/ codeView recomputeDiff:self. |
|
3225 |
"/ ] ifFalse:[ |
|
3226 |
"/ changedDiffText := true. |
|
3227 |
"/ ]. |
|
3228 |
"/ ] |
|
3229 |
||
9985 | 3230 |
|
3231 |
"Created: / 22-06-2010 / 23:13:24 / Jakub <zelenja7@fel.cvut.cz>" |
|
3232 |
"Modified: / 01-08-2010 / 20:33:07 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3233 |
! |
|
3234 |
||
10971
aee24a2ac4fd
Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents:
10970
diff
changeset
|
3235 |
deleteCharBeforeCursor |
aee24a2ac4fd
Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents:
10970
diff
changeset
|
3236 |
"delete single character to the left of cursor and move cursor to left" |
aee24a2ac4fd
Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents:
10970
diff
changeset
|
3237 |
|
aee24a2ac4fd
Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents:
10970
diff
changeset
|
3238 |
"BIG FAT WARNING: This method is copied from TextEditView, |
aee24a2ac4fd
Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents:
10970
diff
changeset
|
3239 |
the fix should be there, but someone smarter should review it |
aee24a2ac4fd
Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents:
10970
diff
changeset
|
3240 |
before the patch will be pushed up" |
aee24a2ac4fd
Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents:
10970
diff
changeset
|
3241 |
|
12787 | 3242 |
|soCol wasOn lineNrAboveCursor ln originalLine prevTab| |
10971
aee24a2ac4fd
Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents:
10970
diff
changeset
|
3243 |
|
aee24a2ac4fd
Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents:
10970
diff
changeset
|
3244 |
wasOn := self hideCursor. |
12787 | 3245 |
|
12783 | 3246 |
"JV@2012-01-06: Do not play with autoindent iff cursor is at the very beginning of the line" |
12787 | 3247 |
(autoIndent |
3248 |
and:[cursorCol ~~ 1 |
|
3249 |
and:[ (tabPositions includes:cursorCol) |
|
3250 |
]]) ifTrue:[ |
|
10971
aee24a2ac4fd
Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents:
10970
diff
changeset
|
3251 |
prevTab := (self prevTabBefore:cursorCol) max:1. |
12782 | 3252 |
"JV@2011-12-10: The list can be shorter than cursorLine, |
10971
aee24a2ac4fd
Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents:
10970
diff
changeset
|
3253 |
trailing because empty lines are not physically in the list." |
aee24a2ac4fd
Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents:
10970
diff
changeset
|
3254 |
(list size >= cursorLine) ifTrue:[ |
12787 | 3255 |
ln := originalLine := (list at:cursorLine) ? ''. |
10971
aee24a2ac4fd
Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents:
10970
diff
changeset
|
3256 |
] ifFalse:[ |
12787 | 3257 |
ln := originalLine := ''. |
10971
aee24a2ac4fd
Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents:
10970
diff
changeset
|
3258 |
]. |
aee24a2ac4fd
Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents:
10970
diff
changeset
|
3259 |
ln size < prevTab ifTrue:[ |
aee24a2ac4fd
Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents:
10970
diff
changeset
|
3260 |
ln := ln , (String new:prevTab withAll:Character space). |
aee24a2ac4fd
Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents:
10970
diff
changeset
|
3261 |
]. |
aee24a2ac4fd
Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents:
10970
diff
changeset
|
3262 |
(ln copyTo:prevTab) isBlank ifTrue:[ |
aee24a2ac4fd
Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents:
10970
diff
changeset
|
3263 |
(ln copyFrom:prevTab+1) isBlank ifTrue:[ |
aee24a2ac4fd
Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents:
10970
diff
changeset
|
3264 |
cursorCol > prevTab ifTrue:[ |
12787 | 3265 |
self st80EditMode ifTrue:[ |
3266 |
"/ ensure that there is no conflict here: st80EditMode will |
|
3267 |
"/ not allow a cursor position beyond the end of line, |
|
3268 |
"/ so avoid that cursorLine:col: will force us to the beginning of the line |
|
3269 |
originalLine size < prevTab ifTrue:[ |
|
12797 | 3270 |
self at:cursorLine put:ln |
12787 | 3271 |
] |
3272 |
]. |
|
10971
aee24a2ac4fd
Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents:
10970
diff
changeset
|
3273 |
self cursorLine:cursorLine col:prevTab. |
aee24a2ac4fd
Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents:
10970
diff
changeset
|
3274 |
wasOn ifTrue:[ self showCursor ]. |
aee24a2ac4fd
Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents:
10970
diff
changeset
|
3275 |
^ self |
aee24a2ac4fd
Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents:
10970
diff
changeset
|
3276 |
]. |
aee24a2ac4fd
Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents:
10970
diff
changeset
|
3277 |
] ifFalse:[ |
12787 | 3278 |
"/ (ln copyFrom:prevTab+1 to:cursorCol-1) isBlank ifTrue:[ |
12782 | 3279 |
self deleteFromLine:cursorLine col:prevTab toLine:cursorLine col:cursorCol-1. |
3280 |
self cursorLine:cursorLine col:prevTab. |
|
3281 |
wasOn ifTrue:[ self showCursor ]. |
|
3282 |
^ self. |
|
12787 | 3283 |
"/ ] |
10971
aee24a2ac4fd
Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents:
10970
diff
changeset
|
3284 |
] |
aee24a2ac4fd
Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents:
10970
diff
changeset
|
3285 |
]. |
aee24a2ac4fd
Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents:
10970
diff
changeset
|
3286 |
]. |
aee24a2ac4fd
Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents:
10970
diff
changeset
|
3287 |
|
aee24a2ac4fd
Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents:
10970
diff
changeset
|
3288 |
"/ (autoIndent |
aee24a2ac4fd
Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents:
10970
diff
changeset
|
3289 |
"/ and:[cursorCol ~~ 1 |
aee24a2ac4fd
Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents:
10970
diff
changeset
|
3290 |
"/ and:[cursorLine <= (list size)]]) |
aee24a2ac4fd
Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents:
10970
diff
changeset
|
3291 |
"/ ifTrue:[ |
aee24a2ac4fd
Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents:
10970
diff
changeset
|
3292 |
"/ soCol := (self leftIndentForLine:cursorLine) + 1. |
aee24a2ac4fd
Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents:
10970
diff
changeset
|
3293 |
"/ |
aee24a2ac4fd
Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents:
10970
diff
changeset
|
3294 |
"/ (cursorCol == soCol and:[soCol > 1]) ifTrue:[ |
aee24a2ac4fd
Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents:
10970
diff
changeset
|
3295 |
"/ ln := list at:cursorLine. |
aee24a2ac4fd
Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents:
10970
diff
changeset
|
3296 |
"/ (ln notNil and:[(ln indexOfNonSeparatorStartingAt:1) < soCol]) ifTrue:[ |
aee24a2ac4fd
Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents:
10970
diff
changeset
|
3297 |
"/ soCol := 1 |
aee24a2ac4fd
Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents:
10970
diff
changeset
|
3298 |
"/ ] |
aee24a2ac4fd
Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents:
10970
diff
changeset
|
3299 |
"/ ] |
aee24a2ac4fd
Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents:
10970
diff
changeset
|
3300 |
"/ ] ifFalse:[ |
aee24a2ac4fd
Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents:
10970
diff
changeset
|
3301 |
soCol := 1. |
aee24a2ac4fd
Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents:
10970
diff
changeset
|
3302 |
"/ ]. |
aee24a2ac4fd
Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents:
10970
diff
changeset
|
3303 |
|
aee24a2ac4fd
Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents:
10970
diff
changeset
|
3304 |
(cursorCol ~~ soCol and:[cursorCol ~~ 1]) ifTrue:[ |
aee24a2ac4fd
Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents:
10970
diff
changeset
|
3305 |
" |
aee24a2ac4fd
Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents:
10970
diff
changeset
|
3306 |
somewhere in the middle of a line |
aee24a2ac4fd
Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents:
10970
diff
changeset
|
3307 |
" |
aee24a2ac4fd
Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents:
10970
diff
changeset
|
3308 |
self cursorLeft. |
aee24a2ac4fd
Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents:
10970
diff
changeset
|
3309 |
self deleteCharAtLine:cursorLine col:cursorCol. |
aee24a2ac4fd
Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents:
10970
diff
changeset
|
3310 |
] ifFalse:[ |
aee24a2ac4fd
Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents:
10970
diff
changeset
|
3311 |
" |
aee24a2ac4fd
Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents:
10970
diff
changeset
|
3312 |
at begin of line - merge with previous line; |
aee24a2ac4fd
Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents:
10970
diff
changeset
|
3313 |
except for the very first line. |
aee24a2ac4fd
Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents:
10970
diff
changeset
|
3314 |
" |
aee24a2ac4fd
Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents:
10970
diff
changeset
|
3315 |
(cursorLine == 1) ifFalse:[ |
aee24a2ac4fd
Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents:
10970
diff
changeset
|
3316 |
lineNrAboveCursor := self validateCursorLine:(cursorLine - 1). |
aee24a2ac4fd
Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents:
10970
diff
changeset
|
3317 |
lineNrAboveCursor < cursorLine ifTrue:[ |
aee24a2ac4fd
Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents:
10970
diff
changeset
|
3318 |
(lineNrAboveCursor > 0 and:[lineNrAboveCursor > list size]) ifTrue:[ |
aee24a2ac4fd
Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents:
10970
diff
changeset
|
3319 |
"/ we are beyond the end of the text. |
aee24a2ac4fd
Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents:
10970
diff
changeset
|
3320 |
"/ move the cursor to the previous line. |
aee24a2ac4fd
Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents:
10970
diff
changeset
|
3321 |
self cursorLine:lineNrAboveCursor col:1. |
aee24a2ac4fd
Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents:
10970
diff
changeset
|
3322 |
] ifFalse:[ |
aee24a2ac4fd
Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents:
10970
diff
changeset
|
3323 |
self mergeLine:lineNrAboveCursor removeBlanks:false. |
aee24a2ac4fd
Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents:
10970
diff
changeset
|
3324 |
] |
aee24a2ac4fd
Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents:
10970
diff
changeset
|
3325 |
] |
aee24a2ac4fd
Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents:
10970
diff
changeset
|
3326 |
] |
aee24a2ac4fd
Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents:
10970
diff
changeset
|
3327 |
]. |
aee24a2ac4fd
Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents:
10970
diff
changeset
|
3328 |
wasOn ifTrue:[ self showCursor ] |
aee24a2ac4fd
Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents:
10970
diff
changeset
|
3329 |
|
aee24a2ac4fd
Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents:
10970
diff
changeset
|
3330 |
"Modified: / 16-01-1998 / 22:33:04 / cg" |
11054
4a047a923805
fix for autoindent: deleting line when at the very beggining of the line
vrany
parents:
10977
diff
changeset
|
3331 |
"Modified: / 06-01-2012 / 12:42:55 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
10971
aee24a2ac4fd
Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents:
10970
diff
changeset
|
3332 |
! |
aee24a2ac4fd
Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents:
10970
diff
changeset
|
3333 |
|
9985 | 3334 |
getNewOriginText |
3335 |
|i size pole pom text helperText| |
|
3336 |
||
3337 |
i := 1. |
|
3338 |
pole := list. |
|
3339 |
size := list size. |
|
3340 |
text:=''. |
|
10877 | 3341 |
emptyLines isNil ifTrue:[emptyLines := #()]. |
9985 | 3342 |
[ i <= size ] whileTrue:[ |
3343 |
pom := emptyLines indexOf:i. |
|
3344 |
(pom = 0) ifFalse:[ |
|
3345 |
helperText := pole at:i. |
|
3346 |
(helperText = '') ifFalse:[ |
|
3347 |
(helperText isNil)ifTrue:[helperText:='']. |
|
3348 |
helperText:=helperText,Character cr. |
|
3349 |
text := text asString , helperText asString. |
|
3350 |
]. |
|
3351 |
] ifTrue:[ |
|
3352 |
helperText := pole at:i. |
|
3353 |
(helperText isNil)ifTrue:[helperText:='']. |
|
3354 |
helperText:=helperText,Character cr. |
|
3355 |
text := text asString , helperText asString. |
|
3356 |
]. |
|
3357 |
i:=i+1. |
|
3358 |
]. |
|
3359 |
^text |
|
3360 |
||
3361 |
"Created: / 22-06-2010 / 22:33:27 / Jakub <zelenja7@fel.cvut.cz>" |
|
3362 |
"Modified: / 24-06-2010 / 14:27:03 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
10877 | 3363 |
"Modified: / 18-11-2011 / 14:58:22 / cg" |
9985 | 3364 |
! ! |
3365 |
||
3366 |
!CodeView2::TextView methodsFor:'editing-basic'! |
|
3367 |
||
10708
dd79e944752e
Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents:
10689
diff
changeset
|
3368 |
basicDeleteCharsAtLine:lineNr fromCol:startCol toCol:endCol |
dd79e944752e
Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents:
10689
diff
changeset
|
3369 |
"delete characters from startCol to endCol in line lineNr" |
dd79e944752e
Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents:
10689
diff
changeset
|
3370 |
|
10731 | 3371 |
super basicDeleteCharsAtLine:lineNr fromCol:startCol toCol:endCol. |
10708
dd79e944752e
Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents:
10689
diff
changeset
|
3372 |
self notifyLinesModifiedFrom: lineNr to: lineNr. |
dd79e944752e
Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents:
10689
diff
changeset
|
3373 |
|
dd79e944752e
Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents:
10689
diff
changeset
|
3374 |
"Created: / 16-09-2011 / 15:13:48 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
dd79e944752e
Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents:
10689
diff
changeset
|
3375 |
! |
dd79e944752e
Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents:
10689
diff
changeset
|
3376 |
|
dd79e944752e
Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents:
10689
diff
changeset
|
3377 |
basicDeleteFromLine:startLineNr toLine:endLineNr |
10728 | 3378 |
|
3379 |
super basicDeleteFromLine:startLineNr toLine:endLineNr. |
|
10708
dd79e944752e
Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents:
10689
diff
changeset
|
3380 |
self notifyLinesDeletedFrom:startLineNr to:endLineNr. |
9985 | 3381 |
|
3382 |
"Created: / 28-06-2011 / 09:09:25 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3383 |
! |
|
3384 |
||
3385 |
basicDeleteLineWithoutRedraw:lineNr |
|
3386 |
||
10728 | 3387 |
super basicDeleteLineWithoutRedraw:lineNr. |
3388 |
self notifyLinesDeletedFrom: lineNr to: lineNr. |
|
9985 | 3389 |
|
3390 |
"Created: / 28-06-2011 / 09:10:04 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3391 |
! |
|
3392 |
||
10708
dd79e944752e
Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents:
10689
diff
changeset
|
3393 |
basicInsert:aCharacter atLine:lineNr col:colNr |
dd79e944752e
Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents:
10689
diff
changeset
|
3394 |
"insert a single character at lineNr/colNr; |
dd79e944752e
Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents:
10689
diff
changeset
|
3395 |
set emphasis to character at current position" |
dd79e944752e
Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents:
10689
diff
changeset
|
3396 |
|
10728 | 3397 |
super basicInsert:aCharacter atLine:lineNr col:colNr. |
10708
dd79e944752e
Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents:
10689
diff
changeset
|
3398 |
self notifyLinesModifiedFrom: lineNr to: lineNr. |
dd79e944752e
Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents:
10689
diff
changeset
|
3399 |
|
dd79e944752e
Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents:
10689
diff
changeset
|
3400 |
"Created: / 16-09-2011 / 15:14:26 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
dd79e944752e
Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents:
10689
diff
changeset
|
3401 |
! |
dd79e944752e
Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents:
10689
diff
changeset
|
3402 |
|
9985 | 3403 |
basicMergeLine:lineNr removeBlanks:removeBlanks |
3404 |
||
10728 | 3405 |
super basicMergeLine:lineNr removeBlanks:removeBlanks. |
9985 | 3406 |
self notifyLinesDeletedFrom: lineNr + 1 to: lineNr + 1. |
3407 |
||
3408 |
"Created: / 28-06-2011 / 09:13:36 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3409 |
! |
|
3410 |
||
3411 |
basicSplitLine:lineNr before:colNr |
|
3412 |
||
10728 | 3413 |
super basicSplitLine:lineNr before:colNr. |
3414 |
self notifyLinesInsertedFrom: lineNr +1 to: lineNr + 1. |
|
9985 | 3415 |
|
3416 |
"Created: / 28-06-2011 / 09:14:50 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
10977 | 3417 |
! |
3418 |
||
3419 |
insertLines:someText from:start to:end before:lineNr |
|
3420 |
||
3421 |
"/JV@2011-12-20: HACK, the super implementation should |
|
3422 |
"/not use leftIndent...when pasting. Following is a workaround" |
|
3423 |
| wasAutoIndent | |
|
3424 |
||
3425 |
wasAutoIndent := autoIndent. |
|
3426 |
autoIndent := false. |
|
12787 | 3427 |
[ |
3428 |
super insertLines:someText from:start to:end before:lineNr. |
|
3429 |
] ensure:[ |
|
3430 |
autoIndent := wasAutoIndent |
|
3431 |
] |
|
10977 | 3432 |
|
3433 |
"Created: / 20-12-2011 / 15:32:35 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
9985 | 3434 |
! ! |
3435 |
||
3436 |
!CodeView2::TextView methodsFor:'event handling'! |
|
3437 |
||
3438 |
buttonMotion:button x:x y:y |
|
3439 |
||
3440 |
(codeView buttonMotion:button x:x y:y in: self) |
|
3441 |
ifFalse:[super buttonMotion:button x:x y:y]. |
|
3442 |
||
3443 |
"Created: / 14-02-2010 / 16:23:09 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3444 |
"Modified: / 06-03-2010 / 20:10:10 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3445 |
! |
|
3446 |
||
3447 |
buttonPress: button x: x y: y |
|
3448 |
| ctrlDown | |
|
3449 |
||
3450 |
(codeView buttonPress:button x:x y:y in: self) |
|
12870 | 3451 |
ifFalse:[super buttonPress:button x:x y:y]. |
9985 | 3452 |
" |
3453 |
((ctrlDown := self sensor ctrlDown) and: [ codeView syntaxElementSelection notNil]) |
|
3454 |
ifTrue: [codeView buttonPressInTextView: button x:x y:y ctrlDown: ctrlDown]. |
|
3455 |
super |
|
3456 |
buttonPress: button |
|
3457 |
x: x |
|
3458 |
y: y |
|
3459 |
" |
|
3460 |
||
3461 |
"Created: / 14-02-2010 / 18:12:32 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3462 |
"Modified: / 06-03-2010 / 20:37:41 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3463 |
! |
|
3464 |
||
12868 | 3465 |
buttonRelease: button x: x y: y |
3466 |
(codeView buttonRelease:button x:x y:y in: self) |
|
12870 | 3467 |
ifFalse:[super buttonRelease:button x:x y:y]. |
12868 | 3468 |
! |
3469 |
||
9985 | 3470 |
exposeX:x y:y width:w height:h |
3471 |
super |
|
3472 |
exposeX:x |
|
3473 |
y:y |
|
3474 |
width:w |
|
3475 |
height:h. |
|
13374 | 3476 |
|
3477 |
"/ if in diffmode... |
|
9985 | 3478 |
self redrawLines. |
3479 |
||
3480 |
"Created: / 05-04-2010 / 10:07:50 / Jakub <zelenja7@fel.cvut.cz>" |
|
3481 |
"Modified: / 02-05-2010 / 18:41:07 / Jakub <zelenja7@fel.cvut.cz>" |
|
3482 |
! |
|
3483 |
||
3484 |
keyPress:key x:x y:y |
|
3485 |
(codeView keyPress:key x:x y:y in: self) |
|
3486 |
ifFalse:[super keyPress:key x:x y:y]. |
|
3487 |
||
3488 |
"Modified: / 06-03-2010 / 20:34:51 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3489 |
"Modified: / 05-04-2010 / 09:55:52 / Jakub <zelenja7@fel.cvut.cz>" |
|
3490 |
! |
|
3491 |
||
3492 |
keyRelease: key x: x y: y |
|
3493 |
||
3494 |
(codeView keyRelease:key x:x y:y in: self) |
|
3495 |
ifFalse:[super keyRelease:key x:x y:y]. |
|
3496 |
" |
|
3497 |
(key = #Control_L) ifTrue: |
|
3498 |
[ codeView highlightClear. self redraw ]. |
|
3499 |
||
3500 |
^ super |
|
3501 |
keyRelease: key |
|
3502 |
x: x |
|
3503 |
y: y |
|
3504 |
" |
|
3505 |
||
3506 |
"Created: / 14-02-2010 / 16:38:46 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3507 |
"Modified: / 06-03-2010 / 21:04:55 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3508 |
! ! |
|
3509 |
||
10970
dc9da0fc38ef
Small improvement for auto-indent (when enabled, not by default)
vrany
parents:
10967
diff
changeset
|
3510 |
!CodeView2::TextView methodsFor:'formatting'! |
dc9da0fc38ef
Small improvement for auto-indent (when enabled, not by default)
vrany
parents:
10967
diff
changeset
|
3511 |
|
dc9da0fc38ef
Small improvement for auto-indent (when enabled, not by default)
vrany
parents:
10967
diff
changeset
|
3512 |
leftIndentForLine:lineNr |
dc9da0fc38ef
Small improvement for auto-indent (when enabled, not by default)
vrany
parents:
10967
diff
changeset
|
3513 |
|
dc9da0fc38ef
Small improvement for auto-indent (when enabled, not by default)
vrany
parents:
10967
diff
changeset
|
3514 |
| lang | |
dc9da0fc38ef
Small improvement for auto-indent (when enabled, not by default)
vrany
parents:
10967
diff
changeset
|
3515 |
lang := codeView language. |
10973
44ccdbc1fb0a
fix in #leftIndentForLine: for view with nil language
vrany
parents:
10972
diff
changeset
|
3516 |
"Bit hacky here, should ask language some language toolbox |
44ccdbc1fb0a
fix in #leftIndentForLine: for view with nil language
vrany
parents:
10972
diff
changeset
|
3517 |
for formatting helper, that should do it..." |
44ccdbc1fb0a
fix in #leftIndentForLine: for view with nil language
vrany
parents:
10972
diff
changeset
|
3518 |
(lang notNil and:[lang isSmalltalk]) ifTrue:[ |
13942 | 3519 |
| line lineNo indent | |
3520 |
lineNo := lineNr. |
|
3521 |
[lineNo ~~ 1] whileTrue:[ |
|
3522 |
lineNo := lineNo - 1. |
|
3523 |
line := self listAt:lineNo. |
|
3524 |
||
3525 |
line notNil ifTrue:[ |
|
3526 |
indent := line indexOfNonSeparatorStartingAt:1. |
|
3527 |
"beggining od block" |
|
3528 |
line notEmptyOrNil ifTrue:[ |
|
3529 |
line last == $[ ifTrue:[ |
|
3530 |
indent := indent + 4. |
|
3531 |
] ifFalse:[ |
|
3532 |
"end of block args" |
|
3533 |
(line last == $| and: [line includes: $[]) ifTrue:[ |
|
3534 |
indent := indent + 4. |
|
3535 |
] |
|
3536 |
]. |
|
3537 |
]. |
|
3538 |
indent ~~ 0 ifTrue:[ |
|
3539 |
^ indent - 1 |
|
3540 |
] |
|
3541 |
] |
|
3542 |
]. |
|
3543 |
^0. |
|
10970
dc9da0fc38ef
Small improvement for auto-indent (when enabled, not by default)
vrany
parents:
10967
diff
changeset
|
3544 |
]. |
dc9da0fc38ef
Small improvement for auto-indent (when enabled, not by default)
vrany
parents:
10967
diff
changeset
|
3545 |
^super leftIndentForLine:lineNr |
dc9da0fc38ef
Small improvement for auto-indent (when enabled, not by default)
vrany
parents:
10967
diff
changeset
|
3546 |
|
dc9da0fc38ef
Small improvement for auto-indent (when enabled, not by default)
vrany
parents:
10967
diff
changeset
|
3547 |
"Created: / 10-12-2011 / 11:02:40 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
dc9da0fc38ef
Small improvement for auto-indent (when enabled, not by default)
vrany
parents:
10967
diff
changeset
|
3548 |
! ! |
dc9da0fc38ef
Small improvement for auto-indent (when enabled, not by default)
vrany
parents:
10967
diff
changeset
|
3549 |
|
9985 | 3550 |
!CodeView2::TextView methodsFor:'initialization'! |
3551 |
||
3552 |
initialize |
|
3553 |
||
3554 |
super initialize. |
|
3555 |
||
3556 |
changedDiffText := true. |
|
3557 |
diffMode := false. |
|
10224 | 3558 |
suppressNotifications := false. |
10781 | 3559 |
reallyModifiedChannel := false asValue. |
13813 | 3560 |
autoIndent := UserPreferences current codeView2AutoIndent. |
13942 | 3561 |
scrollInProgress := false. |
9985 | 3562 |
|
10630
d59bc761de55
fixed: #sendersMenu:selector:
Claus Gittinger <cg@exept.de>
parents:
10577
diff
changeset
|
3563 |
self enableMotionEvents. |
d59bc761de55
fixed: #sendersMenu:selector:
Claus Gittinger <cg@exept.de>
parents:
10577
diff
changeset
|
3564 |
|
9985 | 3565 |
"Created: / 23-06-2010 / 17:28:52 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
10224 | 3566 |
"Modified: / 06-07-2011 / 17:46:31 / jv" |
10630
d59bc761de55
fixed: #sendersMenu:selector:
Claus Gittinger <cg@exept.de>
parents:
10577
diff
changeset
|
3567 |
"Modified: / 21-08-2011 / 10:09:29 / cg" |
13942 | 3568 |
"Modified: / 14-02-2014 / 10:31:38 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
9985 | 3569 |
! |
3570 |
||
3571 |
setCodeView: aCodeView2 |
|
3572 |
||
3573 |
codeView := aCodeView2. |
|
3574 |
codeView addDependent: self. |
|
3575 |
gutterView := aCodeView2 gutterView. |
|
3576 |
||
3577 |
"Created: / 14-02-2010 / 15:22:47 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3578 |
"Modified: / 17-06-2011 / 12:43:53 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3579 |
! |
|
3580 |
||
3581 |
setGutterView: aGutterView |
|
3582 |
||
3583 |
self assert: gutterView isNil message:'Attempting to set gutterView twice'. |
|
3584 |
gutterView := aGutterView. |
|
3585 |
gutterView setTextView: self. |
|
3586 |
||
3587 |
"Created: / 02-09-2009 / 21:57:53 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3588 |
! ! |
|
3589 |
||
3590 |
!CodeView2::TextView methodsFor:'menu & menu actions'! |
|
3591 |
||
10781 | 3592 |
accept |
3593 |
||
3594 |
super accept. |
|
3595 |
reallyModifiedChannel value: false. |
|
10785 | 3596 |
listOriginal := list copy. |
10781 | 3597 |
|
3598 |
"Created: / 07-10-2011 / 19:36:41 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3599 |
! |
|
3600 |
||
10784 | 3601 |
cancel |
3602 |
||
10785 | 3603 |
self list: listOriginal |
10784 | 3604 |
|
3605 |
"Created: / 08-02-2010 / 09:29:43 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3606 |
! |
|
3607 |
||
9985 | 3608 |
editMenu |
3609 |
||
11398
84d3987c0155
better search (for variables)
Claus Gittinger <cg@exept.de>
parents:
11393
diff
changeset
|
3610 |
^ codeView editMenu |
9985 | 3611 |
|
3612 |
"Created: / 14-02-2010 / 15:49:03 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
11398
84d3987c0155
better search (for variables)
Claus Gittinger <cg@exept.de>
parents:
11393
diff
changeset
|
3613 |
"Modified (format): / 08-03-2012 / 12:30:22 / cg" |
84d3987c0155
better search (for variables)
Claus Gittinger <cg@exept.de>
parents:
11393
diff
changeset
|
3614 |
! |
84d3987c0155
better search (for variables)
Claus Gittinger <cg@exept.de>
parents:
11393
diff
changeset
|
3615 |
|
84d3987c0155
better search (for variables)
Claus Gittinger <cg@exept.de>
parents:
11393
diff
changeset
|
3616 |
searchVariableVisible |
84d3987c0155
better search (for variables)
Claus Gittinger <cg@exept.de>
parents:
11393
diff
changeset
|
3617 |
"search variable option in searchbox visible?" |
84d3987c0155
better search (for variables)
Claus Gittinger <cg@exept.de>
parents:
11393
diff
changeset
|
3618 |
|
84d3987c0155
better search (for variables)
Claus Gittinger <cg@exept.de>
parents:
11393
diff
changeset
|
3619 |
^ true |
84d3987c0155
better search (for variables)
Claus Gittinger <cg@exept.de>
parents:
11393
diff
changeset
|
3620 |
|
84d3987c0155
better search (for variables)
Claus Gittinger <cg@exept.de>
parents:
11393
diff
changeset
|
3621 |
"Created: / 08-03-2012 / 14:01:51 / cg" |
9985 | 3622 |
! ! |
3623 |
||
3624 |
!CodeView2::TextView methodsFor:'notification'! |
|
3625 |
||
3626 |
notifyLinesDeletedFrom: startLine to: endLine |
|
3627 |
||
10781 | 3628 |
self updateReallyModified. |
10224 | 3629 |
suppressNotifications ifTrue:[^self]. |
3630 |
codeView linesDeletedFrom: startLine to: endLine. |
|
3631 |
suppressNotifications := true. |
|
3632 |
||
9985 | 3633 |
"Created: / 28-06-2011 / 09:12:04 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
10224 | 3634 |
"Modified: / 06-07-2011 / 17:47:05 / jv" |
10781 | 3635 |
"Modified: / 07-10-2011 / 19:20:39 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
9985 | 3636 |
! |
3637 |
||
3638 |
notifyLinesInsertedFrom: startLine to: endLine |
|
3639 |
||
10781 | 3640 |
self updateReallyModified. |
10224 | 3641 |
suppressNotifications ifTrue:[^self]. |
3642 |
codeView linesInsertedFrom: startLine to: endLine. |
|
3643 |
suppressNotifications := true. |
|
3644 |
||
9985 | 3645 |
"Created: / 28-06-2011 / 09:12:14 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
10224 | 3646 |
"Modified: / 06-07-2011 / 17:47:20 / jv" |
10781 | 3647 |
"Modified: / 07-10-2011 / 19:20:49 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
10708
dd79e944752e
Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents:
10689
diff
changeset
|
3648 |
! |
dd79e944752e
Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents:
10689
diff
changeset
|
3649 |
|
dd79e944752e
Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents:
10689
diff
changeset
|
3650 |
notifyLinesModifiedFrom: startLine to: endLine |
dd79e944752e
Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents:
10689
diff
changeset
|
3651 |
|
10781 | 3652 |
self updateReallyModified. |
10708
dd79e944752e
Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents:
10689
diff
changeset
|
3653 |
suppressNotifications ifTrue:[^self]. |
dd79e944752e
Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents:
10689
diff
changeset
|
3654 |
codeView linesModifiedFrom: startLine to: endLine. |
dd79e944752e
Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents:
10689
diff
changeset
|
3655 |
suppressNotifications := true. |
dd79e944752e
Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents:
10689
diff
changeset
|
3656 |
|
dd79e944752e
Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents:
10689
diff
changeset
|
3657 |
"Modified: / 06-07-2011 / 17:47:20 / jv" |
dd79e944752e
Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents:
10689
diff
changeset
|
3658 |
"Created: / 16-09-2011 / 15:12:33 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
9985 | 3659 |
! ! |
3660 |
||
3661 |
!CodeView2::TextView methodsFor:'private'! |
|
3662 |
||
3663 |
superEditMenu |
|
3664 |
||
3665 |
^super editMenu |
|
3666 |
||
3667 |
"Created: / 14-02-2010 / 15:48:00 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
10781 | 3668 |
! |
3669 |
||
3670 |
updateReallyModified |
|
3671 |
"check for modified code by comparing the source against |
|
3672 |
the codeViews contents. |
|
3673 |
Thats the true modified value (in case user undid its changes, |
|
3674 |
and the displayed text is actually original" |
|
3675 |
||
12347 | 3676 |
|modified changedSource originalSource lastLineOfChangedSource lastLineOfOriginalSource| |
10781 | 3677 |
|
3678 |
reallyModifiedChannel isNil ifTrue:[^self]. |
|
10844
cbb5f5dd900a
Performance fix in CodeView2::TextView>>updateReallyModified
vrany
parents:
10834
diff
changeset
|
3679 |
"JV@2011-10-27: Idea is not to do anything if nobody is |
cbb5f5dd900a
Performance fix in CodeView2::TextView>>updateReallyModified
vrany
parents:
10834
diff
changeset
|
3680 |
interested. Not sure if it is a good idea, thought." |
cbb5f5dd900a
Performance fix in CodeView2::TextView>>updateReallyModified
vrany
parents:
10834
diff
changeset
|
3681 |
reallyModifiedChannel dependents isEmptyOrNil ifTrue:[^self]. |
10781 | 3682 |
|
3683 |
"/ higher prio to prevent it from being changed while we convert it (by editing) |
|
10844
cbb5f5dd900a
Performance fix in CodeView2::TextView>>updateReallyModified
vrany
parents:
10834
diff
changeset
|
3684 |
|
cbb5f5dd900a
Performance fix in CodeView2::TextView>>updateReallyModified
vrany
parents:
10834
diff
changeset
|
3685 |
modified := false. |
cbb5f5dd900a
Performance fix in CodeView2::TextView>>updateReallyModified
vrany
parents:
10834
diff
changeset
|
3686 |
|
cbb5f5dd900a
Performance fix in CodeView2::TextView>>updateReallyModified
vrany
parents:
10834
diff
changeset
|
3687 |
list size ~~ listOriginal size ifTrue:[ |
cbb5f5dd900a
Performance fix in CodeView2::TextView>>updateReallyModified
vrany
parents:
10834
diff
changeset
|
3688 |
modified := true. |
cbb5f5dd900a
Performance fix in CodeView2::TextView>>updateReallyModified
vrany
parents:
10834
diff
changeset
|
3689 |
] ifFalse:[ |
12347 | 3690 |
"/ cg: don't do that (collecting original/changedSource); |
3691 |
"/ for huge files (>8Mb), this makes editing annoying slow (editing a trace output, for example) |
|
3692 |
"/ changedSource := list ? #(). |
|
3693 |
"/ changedSource := changedSource collect:[:line | line isEmptyOrNil ifTrue:[nil] ifFalse:[line]]. |
|
3694 |
"/ [changedSource size > 0 and:[changedSource last isNil]] whileTrue:[ |
|
3695 |
"/ changedSource := changedSource removeLast. |
|
3696 |
"/ ]. |
|
3697 |
"/ |
|
3698 |
"/ originalSource := listOriginal ? #() "self model value ? ''". |
|
3699 |
"/ originalSource := originalSource collect:[:line | line isEmptyOrNil ifTrue:[nil] ifFalse:[line]]. |
|
3700 |
"/ [originalSource size > 0 and:[originalSource last isNil]] whileTrue:[ |
|
3701 |
"/ originalSource := originalSource removeLast |
|
3702 |
"/ ]. |
|
3703 |
"/ originalSource size ~~ changedSource size ifTrue:[ |
|
3704 |
"/ modified := true. |
|
3705 |
"/ ] ifFalse:[ |
|
3706 |
"/ | i stopIndex | |
|
3707 |
"/ |
|
3708 |
"/ i := 1. |
|
3709 |
"/ stopIndex := originalSource size + 1. |
|
3710 |
"/ [ modified not and:[ i < stopIndex ] ] whileTrue:[ |
|
3711 |
"/ | originalL changedL | |
|
3712 |
"/ |
|
3713 |
"/ originalL := ((originalSource at: i) ? '') string. |
|
3714 |
"/ changedL := ((changedSource at: i) ? '') string. |
|
3715 |
"/ originalL ~= changedL ifTrue:[ |
|
3716 |
"/ originalL withoutTrailingSeparators ~= changedL withoutTrailingSeparators ifTrue:[ |
|
3717 |
"/ modified := true. |
|
3718 |
"/ ] |
|
3719 |
"/ ]. |
|
3720 |
"/ i := i + 1. |
|
3721 |
"/ ] |
|
3722 |
"/ ]. |
|
3723 |
"/ instead, do everything without collecting a new stringcollection. |
|
10844
cbb5f5dd900a
Performance fix in CodeView2::TextView>>updateReallyModified
vrany
parents:
10834
diff
changeset
|
3724 |
changedSource := list ? #(). |
12347 | 3725 |
lastLineOfChangedSource := changedSource size. |
3726 |
[lastLineOfChangedSource > 0 and:[(changedSource at:lastLineOfChangedSource) isEmptyOrNil]] whileTrue:[ |
|
3727 |
lastLineOfChangedSource := lastLineOfChangedSource - 1. |
|
3728 |
]. |
|
3729 |
originalSource := listOriginal ? #(). |
|
3730 |
lastLineOfOriginalSource := originalSource size. |
|
3731 |
[lastLineOfOriginalSource > 0 and:[(originalSource at:lastLineOfOriginalSource) isEmptyOrNil]] whileTrue:[ |
|
3732 |
lastLineOfOriginalSource := lastLineOfOriginalSource - 1. |
|
3733 |
]. |
|
3734 |
||
3735 |
lastLineOfOriginalSource ~~ lastLineOfChangedSource ifTrue:[ |
|
10844
cbb5f5dd900a
Performance fix in CodeView2::TextView>>updateReallyModified
vrany
parents:
10834
diff
changeset
|
3736 |
modified := true. |
cbb5f5dd900a
Performance fix in CodeView2::TextView>>updateReallyModified
vrany
parents:
10834
diff
changeset
|
3737 |
] ifFalse:[ |
12347 | 3738 |
| i stopIndex | |
3739 |
||
10844
cbb5f5dd900a
Performance fix in CodeView2::TextView>>updateReallyModified
vrany
parents:
10834
diff
changeset
|
3740 |
i := 1. |
12347 | 3741 |
stopIndex := lastLineOfOriginalSource + 1. |
3742 |
[ modified not and:[ i < stopIndex ] ] whileTrue:[ |
|
10844
cbb5f5dd900a
Performance fix in CodeView2::TextView>>updateReallyModified
vrany
parents:
10834
diff
changeset
|
3743 |
| originalL changedL | |
cbb5f5dd900a
Performance fix in CodeView2::TextView>>updateReallyModified
vrany
parents:
10834
diff
changeset
|
3744 |
|
cbb5f5dd900a
Performance fix in CodeView2::TextView>>updateReallyModified
vrany
parents:
10834
diff
changeset
|
3745 |
originalL := ((originalSource at: i) ? '') string. |
cbb5f5dd900a
Performance fix in CodeView2::TextView>>updateReallyModified
vrany
parents:
10834
diff
changeset
|
3746 |
changedL := ((changedSource at: i) ? '') string. |
cbb5f5dd900a
Performance fix in CodeView2::TextView>>updateReallyModified
vrany
parents:
10834
diff
changeset
|
3747 |
originalL ~= changedL ifTrue:[ |
cbb5f5dd900a
Performance fix in CodeView2::TextView>>updateReallyModified
vrany
parents:
10834
diff
changeset
|
3748 |
originalL withoutTrailingSeparators ~= changedL withoutTrailingSeparators ifTrue:[ |
cbb5f5dd900a
Performance fix in CodeView2::TextView>>updateReallyModified
vrany
parents:
10834
diff
changeset
|
3749 |
modified := true. |
cbb5f5dd900a
Performance fix in CodeView2::TextView>>updateReallyModified
vrany
parents:
10834
diff
changeset
|
3750 |
] |
cbb5f5dd900a
Performance fix in CodeView2::TextView>>updateReallyModified
vrany
parents:
10834
diff
changeset
|
3751 |
]. |
cbb5f5dd900a
Performance fix in CodeView2::TextView>>updateReallyModified
vrany
parents:
10834
diff
changeset
|
3752 |
i := i + 1. |
cbb5f5dd900a
Performance fix in CodeView2::TextView>>updateReallyModified
vrany
parents:
10834
diff
changeset
|
3753 |
] |
12347 | 3754 |
]. |
3755 |
||
10781 | 3756 |
]. |
3757 |
||
3758 |
reallyModifiedChannel value: modified |
|
3759 |
||
3760 |
"Created: / 07-10-2011 / 19:16:25 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
10783 | 3761 |
"Modified: / 08-10-2011 / 11:10:01 / cg" |
10844
cbb5f5dd900a
Performance fix in CodeView2::TextView>>updateReallyModified
vrany
parents:
10834
diff
changeset
|
3762 |
"Modified: / 28-10-2011 / 09:23:01 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
9985 | 3763 |
! ! |
3764 |
||
11903
5b027fc44ff8
+supportsSyntaxElements query
Claus Gittinger <cg@exept.de>
parents:
11769
diff
changeset
|
3765 |
!CodeView2::TextView methodsFor:'queries'! |
5b027fc44ff8
+supportsSyntaxElements query
Claus Gittinger <cg@exept.de>
parents:
11769
diff
changeset
|
3766 |
|
13625 | 3767 |
editedClass |
3768 |
|cls| |
|
3769 |
||
3770 |
(cls := codeView classHolder value) notNil ifTrue:[ |
|
3771 |
^ cls |
|
3772 |
]. |
|
3773 |
^ super editedClass |
|
3774 |
! |
|
3775 |
||
3776 |
editedMethod |
|
3777 |
|cls| |
|
3778 |
||
3779 |
(cls := codeView methodHolder value) notNil ifTrue:[ |
|
3780 |
^ cls |
|
3781 |
]. |
|
3782 |
^ super editedMethod |
|
3783 |
! |
|
3784 |
||
11903
5b027fc44ff8
+supportsSyntaxElements query
Claus Gittinger <cg@exept.de>
parents:
11769
diff
changeset
|
3785 |
supportsSyntaxElements |
5b027fc44ff8
+supportsSyntaxElements query
Claus Gittinger <cg@exept.de>
parents:
11769
diff
changeset
|
3786 |
^ true |
12980 | 3787 |
! |
3788 |
||
3789 |
syntaxElementAtPosition:position |
|
3790 |
"is there is a syntax element at position? |
|
3791 |
If so, return the element; otherwise, return nil" |
|
3792 |
||
3793 |
|syntaxElements el element| |
|
3794 |
||
3795 |
syntaxElements := codeView syntaxElements. |
|
3796 |
syntaxElements isEmptyOrNil ifTrue:[^ nil]. |
|
3797 |
el := syntaxElements detect:[:el | position between:el start and:el stop] ifNone:nil. |
|
3798 |
el isNil ifTrue:[^ nil]. |
|
3799 |
element := 1234. |
|
3800 |
^ el. |
|
3801 |
||
3802 |
"Created: / 08-03-2012 / 14:21:52 / cg" |
|
3803 |
! |
|
3804 |
||
3805 |
syntaxElementForSelectedVariable |
|
3806 |
"is there is a syntax element for a variable under the cursor? |
|
3807 |
If so, return the element; otherwise, return nil" |
|
3808 |
||
3809 |
|element startPosition endPosition| |
|
3810 |
||
3811 |
self selectionAsString isEmptyOrNil ifTrue:[^ nil]. |
|
3812 |
startPosition := self characterPositionOfLine:selectionStartLine col:selectionStartCol. |
|
3813 |
endPosition := self characterPositionOfLine:selectionEndLine col:selectionEndCol. |
|
3814 |
element := self syntaxElementAtPosition:startPosition. |
|
3815 |
element isNil ifTrue:[^ nil]. |
|
3816 |
(element start = startPosition and:[element stop = endPosition]) ifFalse:[^ nil]. |
|
3817 |
||
3818 |
element isNil ifTrue:[^ nil]. |
|
3819 |
element isVariableOrSelf ifFalse:[^ nil]. |
|
3820 |
^ element |
|
3821 |
||
3822 |
"Created: / 08-03-2012 / 14:21:15 / cg" |
|
3823 |
! |
|
3824 |
||
3825 |
syntaxElementForSelectorUnderCursor |
|
3826 |
"is there is a syntax element for a message selector under the cursor? |
|
3827 |
If so, return the element; otherwise, return nil" |
|
3828 |
||
3829 |
|elementUnderCursor | |
|
3830 |
||
3831 |
elementUnderCursor := self syntaxElementAtPosition:(self characterPositionOfCursor). |
|
3832 |
elementUnderCursor isNil ifTrue:[^ nil]. |
|
3833 |
elementUnderCursor isSelector ifFalse:[^ nil]. |
|
3834 |
^ elementUnderCursor. |
|
3835 |
||
3836 |
"Created: / 08-03-2012 / 12:44:03 / cg" |
|
3837 |
! |
|
3838 |
||
3839 |
syntaxElementForVariableUnderCursor |
|
3840 |
"is there is a syntax element for a variable under the cursor? |
|
3841 |
If so, return the element; otherwise, return nil" |
|
3842 |
||
3843 |
|elementUnderCursor | |
|
3844 |
||
3845 |
elementUnderCursor := self syntaxElementAtPosition:(self characterPositionOfCursor). |
|
3846 |
elementUnderCursor isNil ifTrue:[^ nil]. |
|
3847 |
elementUnderCursor isVariableOrSelf ifFalse:[^ nil]. |
|
3848 |
^ elementUnderCursor. |
|
3849 |
||
3850 |
"Created: / 08-03-2012 / 12:44:03 / cg" |
|
11903
5b027fc44ff8
+supportsSyntaxElements query
Claus Gittinger <cg@exept.de>
parents:
11769
diff
changeset
|
3851 |
! ! |
5b027fc44ff8
+supportsSyntaxElements query
Claus Gittinger <cg@exept.de>
parents:
11769
diff
changeset
|
3852 |
|
9985 | 3853 |
!CodeView2::TextView methodsFor:'scrolling'! |
3854 |
||
13813 | 3855 |
basicScrollTo:anOrigin redraw:doRedraw |
13942 | 3856 |
| savedScrollIProgress | |
3857 |
||
3858 |
savedScrollIProgress := scrollInProgress. |
|
3859 |
scrollInProgress := true. |
|
3860 |
[ |
|
3861 |
super scrollTo:anOrigin redraw:doRedraw |
|
3862 |
] ensure:[ |
|
3863 |
scrollInProgress := savedScrollIProgress. |
|
3864 |
]. |
|
3865 |
"Modified: / 14-02-2014 / 10:12:48 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
13813 | 3866 |
! |
3867 |
||
9985 | 3868 |
originChanged:delta |
3869 |
||
3870 |
super originChanged:delta. |
|
3871 |
||
13105 | 3872 |
"/ gutterView invalidate. |
9985 | 3873 |
|
3874 |
"Created: / 07-12-2009 / 21:50:49 / Jindra <a>" |
|
3875 |
! |
|
3876 |
||
13813 | 3877 |
scrollTo:anOrigin redraw:doRedraw |
3878 |
||
3879 |
codeView scrollTo:anOrigin redraw:doRedraw in: self. |
|
3880 |
self basicScrollTo:anOrigin redraw:doRedraw |
|
3881 |
||
3882 |
"Modified: / 06-04-2010 / 14:04:28 / Jakub <zelenja7@fel.cvut.cz>" |
|
3883 |
"Modified: / 17-03-2012 / 10:06:10 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3884 |
"Created: / 19-03-2012 / 17:05:22 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
9985 | 3885 |
! ! |
3886 |
||
10224 | 3887 |
!CodeView2::TextView methodsFor:'undo & again'! |
3888 |
||
3889 |
nonUndoableDo: aBlock |
|
3890 |
||
3891 |
super nonUndoableDo: aBlock. |
|
3892 |
suppressNotifications := false. |
|
3893 |
||
3894 |
"Created: / 06-07-2011 / 17:48:27 / jv" |
|
3895 |
! |
|
3896 |
||
3897 |
undoableDo: aBlock info: into |
|
3898 |
||
3899 |
super undoableDo: aBlock info: into. |
|
3900 |
suppressNotifications := false. |
|
3901 |
||
3902 |
"Created: / 06-07-2011 / 17:48:49 / jv" |
|
3903 |
! ! |
|
3904 |
||
9985 | 3905 |
!CodeView2 class methodsFor:'documentation'! |
3906 |
||
10293 | 3907 |
version |
14194
efb533b63fee
Tools::CodeView2>>#editedLanguage:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14145
diff
changeset
|
3908 |
^ '$Header: /cvs/stx/stx/libtool/Tools__CodeView2.st,v 1.145 2014-04-09 15:33:56 vrany Exp $' |
10293 | 3909 |
! |
3910 |
||
9985 | 3911 |
version_CVS |
14194
efb533b63fee
Tools::CodeView2>>#editedLanguage:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14145
diff
changeset
|
3912 |
^ '$Header: /cvs/stx/stx/libtool/Tools__CodeView2.st,v 1.145 2014-04-09 15:33:56 vrany Exp $' |
9985 | 3913 |
! |
3914 |
||
3915 |
version_SVN |
|
14194
efb533b63fee
Tools::CodeView2>>#editedLanguage:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14145
diff
changeset
|
3916 |
^ '$Id: Tools__CodeView2.st,v 1.145 2014-04-09 15:33:56 vrany Exp $' |
9985 | 3917 |
! ! |
3918 |
||
12347 | 3919 |
|
9985 | 3920 |
CodeView2 initialize! |