author | Claus Gittinger <cg@exept.de> |
Mon, 20 Jan 2020 21:02:47 +0100 | |
changeset 19422 | c6ca1c3e0fd7 |
parent 19294 | a87c938c39e0 |
child 19470 | 4728c449a5ca |
permissions | -rw-r--r-- |
19149 | 1 |
"{ Encoding: utf8 }" |
2 |
||
10023 | 3 |
" |
4 |
COPYRIGHT (c) 2006 by eXept Software AG |
|
10042 | 5 |
All Rights Reserved |
10023 | 6 |
|
7 |
This software is furnished under a license and may be used |
|
8 |
only in accordance with the terms of that license and with the |
|
9 |
inclusion of the above copyright notice. This software may not |
|
10 |
be provided or otherwise made available to, or used by, any |
|
11 |
other person. No title to or ownership of the software is |
|
12 |
hereby transferred. |
|
13 |
" |
|
14 |
"{ Package: 'stx:libtool' }" |
|
8775 | 15 |
|
16 |
"{ NameSpace: Tools }" |
|
17 |
||
18 |
CodeView subclass:#NewSystemBrowserCodeView |
|
10172
6e6165958f2c
changed: #leftClickMenuForVariableNode:
Claus Gittinger <cg@exept.de>
parents:
10042
diff
changeset
|
19 |
instanceVariableNames:'browser parseTree selectedNode parsingProcess |
6e6165958f2c
changed: #leftClickMenuForVariableNode:
Claus Gittinger <cg@exept.de>
parents:
10042
diff
changeset
|
20 |
parsingProcessRunning highlightEmphasis seqNum' |
6e6165958f2c
changed: #leftClickMenuForVariableNode:
Claus Gittinger <cg@exept.de>
parents:
10042
diff
changeset
|
21 |
classVariableNames:'' |
6e6165958f2c
changed: #leftClickMenuForVariableNode:
Claus Gittinger <cg@exept.de>
parents:
10042
diff
changeset
|
22 |
poolDictionaries:'' |
6e6165958f2c
changed: #leftClickMenuForVariableNode:
Claus Gittinger <cg@exept.de>
parents:
10042
diff
changeset
|
23 |
category:'Interface-Browsers-New' |
8775 | 24 |
! |
25 |
||
10023 | 26 |
!NewSystemBrowserCodeView class methodsFor:'documentation'! |
27 |
||
28 |
copyright |
|
29 |
" |
|
30 |
COPYRIGHT (c) 2006 by eXept Software AG |
|
10042 | 31 |
All Rights Reserved |
10023 | 32 |
|
33 |
This software is furnished under a license and may be used |
|
34 |
only in accordance with the terms of that license and with the |
|
35 |
inclusion of the above copyright notice. This software may not |
|
36 |
be provided or otherwise made available to, or used by, any |
|
37 |
other person. No title to or ownership of the software is |
|
38 |
hereby transferred. |
|
39 |
" |
|
40 |
! ! |
|
8775 | 41 |
|
42 |
!NewSystemBrowserCodeView class methodsFor:'initialization'! |
|
43 |
||
44 |
initialize |
|
45 |
" |
|
46 |
self initialize |
|
47 |
" |
|
10024 | 48 |
"/ MUST be done in the keyboard.rc file |
10023 | 49 |
" |
50 |
Smalltalk addStartBlock: |
|
51 |
[Display keyboardMap |
|
52 |
bindValue:#ImplementorsOfIt to:#Cmdm; |
|
53 |
bindValue:#SendersOfIt to:#Cmdn; |
|
54 |
bindValue:#GoBack to:#CmdBackSpace] |
|
55 |
" |
|
8775 | 56 |
|
57 |
"Created: / 25-12-2007 / 19:58:53 / janfrog" |
|
58 |
"Modified: / 27-02-2008 / 12:16:10 / janfrog" |
|
10023 | 59 |
"Modified: / 15-04-2010 / 16:40:18 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
10024 | 60 |
"Modified (comment): / 01-07-2011 / 16:21:38 / cg" |
8775 | 61 |
! ! |
62 |
||
63 |
!NewSystemBrowserCodeView class methodsFor:'menu specs'! |
|
64 |
||
65 |
editMenuSpec |
|
66 |
"This resource specification was automatically generated |
|
67 |
by the MenuEditor of ST/X." |
|
68 |
||
69 |
"Do not manually edit this!! If it is corrupted, |
|
70 |
the MenuEditor may not be able to read the specification." |
|
71 |
||
72 |
" |
|
73 |
MenuEditor new openOnClass:Tools::NewSystemBrowserCodeView andSelector:#editMenuSpec |
|
74 |
(Menu new fromLiteralArrayEncoding:(Tools::NewSystemBrowserCodeView editMenuSpec)) startUp |
|
75 |
" |
|
76 |
||
77 |
<resource: #menu> |
|
78 |
||
79 |
^ |
|
80 |
#(Menu |
|
81 |
( |
|
82 |
(MenuItem |
|
83 |
label: 'Implementors' |
|
84 |
itemValue: browseImplementorsOfIt |
|
85 |
translateLabel: true |
|
86 |
shortcutKey: ImplementorsOfIt |
|
87 |
) |
|
88 |
(MenuItem |
|
89 |
label: 'Senders' |
|
90 |
itemValue: browseSendersOfIt |
|
91 |
translateLabel: true |
|
92 |
shortcutKey: SendersOfIt |
|
93 |
) |
|
94 |
(MenuItem |
|
95 |
label: 'Refactor' |
|
96 |
translateLabel: true |
|
97 |
isVisible: false |
|
98 |
shortcutKey: Shift |
|
99 |
) |
|
100 |
(MenuItem |
|
101 |
label: '-' |
|
102 |
) |
|
103 |
(MenuItem |
|
104 |
label: 'Accept' |
|
105 |
itemValue: accept |
|
106 |
translateLabel: true |
|
107 |
shortcutKey: Accept |
|
108 |
) |
|
109 |
(MenuItem |
|
110 |
label: '-' |
|
111 |
) |
|
112 |
(MenuItem |
|
113 |
label: 'Cut' |
|
114 |
itemValue: cut |
|
115 |
translateLabel: true |
|
116 |
shortcutKey: Cut |
|
117 |
) |
|
118 |
(MenuItem |
|
119 |
label: 'Copy' |
|
120 |
itemValue: copySelection |
|
121 |
translateLabel: true |
|
122 |
shortcutKey: Copy |
|
123 |
) |
|
124 |
(MenuItem |
|
125 |
label: 'Paste' |
|
126 |
itemValue: pasteOrReplace |
|
127 |
translateLabel: true |
|
128 |
shortcutKey: Paste |
|
129 |
) |
|
130 |
(MenuItem |
|
131 |
label: '-' |
|
132 |
) |
|
133 |
(MenuItem |
|
134 |
label: 'Undo' |
|
135 |
itemValue: undo |
|
136 |
translateLabel: true |
|
137 |
shortcutKey: Undo |
|
138 |
) |
|
139 |
(MenuItem |
|
140 |
label: '-' |
|
141 |
) |
|
142 |
(MenuItem |
|
143 |
label: 'Do it' |
|
144 |
itemValue: doIt |
|
145 |
translateLabel: true |
|
146 |
shortcutKey: DoIt |
|
147 |
) |
|
148 |
(MenuItem |
|
149 |
label: 'Print it' |
|
150 |
itemValue: printIt |
|
151 |
translateLabel: true |
|
152 |
shortcutKey: PrintIt |
|
153 |
) |
|
154 |
(MenuItem |
|
155 |
label: 'Inspect it' |
|
156 |
itemValue: inspectIt |
|
157 |
translateLabel: true |
|
158 |
shortcutKey: InspectIt |
|
159 |
) |
|
160 |
(MenuItem |
|
161 |
label: '-' |
|
162 |
) |
|
163 |
(MenuItem |
|
164 |
label: 'Special' |
|
165 |
translateLabel: true |
|
166 |
submenu: |
|
167 |
(Menu |
|
168 |
( |
|
169 |
(MenuItem |
|
170 |
label: 'Inspect RB Parse Tree' |
|
171 |
itemValue: inspectParseTree |
|
172 |
translateLabel: true |
|
173 |
) |
|
174 |
(MenuItem |
|
175 |
label: 'Inspect selected selector' |
|
176 |
itemValue: inspectSelectedSelector |
|
177 |
translateLabel: true |
|
178 |
) |
|
179 |
) |
|
180 |
nil |
|
181 |
nil |
|
182 |
) |
|
183 |
) |
|
184 |
(MenuItem |
|
185 |
label: 'More' |
|
186 |
nameKey: More |
|
187 |
translateLabel: true |
|
188 |
) |
|
189 |
) |
|
190 |
nil |
|
191 |
nil |
|
192 |
) |
|
193 |
||
194 |
"Modified: / 18-10-2008 / 18:50:01 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
195 |
! ! |
|
196 |
||
197 |
!NewSystemBrowserCodeView methodsFor:'accessing'! |
|
198 |
||
199 |
browser |
|
200 |
^ browser ? menuHolder |
|
201 |
||
202 |
"Created: / 25-12-2007 / 10:20:01 / janfrog" |
|
203 |
"Modified: / 26-12-2007 / 12:22:56 / janfrog" |
|
204 |
! |
|
205 |
||
206 |
browser:something |
|
207 |
browser := something. |
|
208 |
||
209 |
"Created: / 25-12-2007 / 10:20:01 / janfrog" |
|
210 |
! |
|
211 |
||
212 |
findNode |
|
213 |
||
214 |
^selectedNode |
|
215 |
ifNil:[self findNodeForInterval: self selectedInterval] |
|
216 |
ifNotNil:[selectedNode] |
|
217 |
||
218 |
"Created: / 18-02-2008 / 22:52:24 / janfrog" |
|
219 |
"Modified: / 19-02-2008 / 09:35:11 / janfrog" |
|
220 |
! |
|
221 |
||
222 |
findNodeForInterval:anInterval |
|
223 |
" |
|
16932 | 224 |
An empty interval check based on Claus' suggestion |
8775 | 225 |
(email Fri, 10 Oct 2008 16:10:25 +0200) |
226 |
" |
|
10023 | 227 |
anInterval isEmpty ifTrue:[^nil]. |
8775 | 228 |
|
229 |
^self findNodeIn: self parseTree forInterval: anInterval |
|
230 |
||
231 |
"Created: / 19-02-2008 / 09:44:50 / janfrog" |
|
232 |
"Modified: / 18-10-2008 / 16:47:53 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
10023 | 233 |
"Modified: / 01-09-2009 / 22:45:28 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
8775 | 234 |
! |
235 |
||
236 |
findNodeIn:tree forInterval:interval |
|
16932 | 237 |
^ DoWhatIMeanSupport findNodeIn:tree forInterval:interval |
238 |
"/ |node wouldReturn| |
|
239 |
"/ |
|
240 |
"/ node := nil. |
|
241 |
"/ tree = #error ifTrue:[^nil]. |
|
242 |
"/ tree nodesDo:[:each | |
|
243 |
"/ (each intersectsInterval:interval) ifTrue:[ |
|
244 |
"/ (node isNil or:[node == each parent]) ifTrue:[ |
|
245 |
"/ node := each |
|
246 |
"/ ] ifFalse:[ |
|
247 |
"/ (node parent notNil |
|
248 |
"/ and:[node parent isCascade and:[each parent isCascade]]) ifFalse:[^ nil] |
|
249 |
"/ ] |
|
250 |
"/ ] ifFalse:[ |
|
251 |
"/ node notNil ifTrue:[ |
|
252 |
"/ "/ already found one - beyond that one; leave |
|
253 |
"/ wouldReturn notNil ifTrue:[wouldReturn := node]. |
|
254 |
"/ ] |
|
255 |
"/ ]. |
|
256 |
"/ ]. |
|
257 |
"/(wouldReturn notNil and:[wouldReturn ~~ node]) ifTrue:[self halt]. |
|
258 |
"/ ^ node |
|
8775 | 259 |
|
260 |
"Created: / 19-02-2008 / 09:40:24 / janfrog" |
|
261 |
"Modified: / 21-02-2008 / 09:35:31 / janfrog" |
|
262 |
! |
|
263 |
||
264 |
selectedClass |
|
265 |
||
266 |
^self browser theSingleSelectedClass |
|
267 |
||
268 |
"Created: / 21-02-2008 / 09:26:55 / janfrog" |
|
269 |
! |
|
270 |
||
271 |
selectedNode |
|
272 |
^ self findNode |
|
273 |
||
274 |
"Created: / 21-02-2008 / 09:17:29 / janfrog" |
|
275 |
! |
|
276 |
||
277 |
selectedSelector |
|
278 |
|selectedText| |
|
279 |
||
10463 | 280 |
^ (selectedText := self selectionAsString) isEmptyOrNil |
10023 | 281 |
ifFalse:[ (SystemBrowser extractSelectorFrom:selectedText) asSymbol ] |
8775 | 282 |
ifTrue:[ |
283 |
selectedNode ifNil:[ self highlightNodeAtCursor ]. |
|
284 |
(selectedNode notNil and:[ selectedNode isMessage ]) ifTrue:[ |
|
285 |
selectedNode selector |
|
286 |
] ifFalse:[ nil ] |
|
287 |
] |
|
288 |
||
289 |
"Created: / 26-12-2007 / 11:12:26 / janfrog" |
|
290 |
"Modified: / 19-02-2008 / 09:16:11 / janfrog" |
|
10463 | 291 |
"Modified: / 04-08-2011 / 19:05:43 / cg" |
8775 | 292 |
! ! |
293 |
||
294 |
!NewSystemBrowserCodeView methodsFor:'accessing-contents'! |
|
295 |
||
296 |
list: anObject |
|
297 |
||
298 |
super list: anObject. |
|
299 |
self updateParseTree. |
|
300 |
||
301 |
"Created: / 25-12-2007 / 10:05:17 / janfrog" |
|
302 |
! ! |
|
303 |
||
304 |
!NewSystemBrowserCodeView methodsFor:'change & update'! |
|
305 |
||
306 |
updateParseTree |
|
307 |
||
308 |
self startParsingProcess |
|
309 |
"/Transcript showCR:'Updating parse tree' |
|
310 |
||
311 |
"Created: / 25-12-2007 / 10:05:49 / janfrog" |
|
312 |
"Modified: / 25-12-2007 / 21:29:28 / janfrog" |
|
313 |
! ! |
|
314 |
||
315 |
!NewSystemBrowserCodeView methodsFor:'event handling'! |
|
316 |
||
317 |
buttonMotion:button x:x y:y |
|
17241 | 318 |
(button == 0 and:[ self sensor ctrlDown ]) ifFalse:[ |
319 |
^ super buttonMotion:button x:x y:y |
|
320 |
]. |
|
321 |
self |
|
322 |
highlightNodeAtX:x y:y; |
|
323 |
redraw. |
|
8775 | 324 |
|
325 |
"Created: / 25-12-2007 / 21:53:50 / janfrog" |
|
326 |
"Modified: / 19-02-2008 / 09:15:09 / janfrog" |
|
327 |
! |
|
328 |
||
10023 | 329 |
buttonPress: button x: x y: y |
330 |
| node | |
|
8775 | 331 |
|
10023 | 332 |
(self sensor ctrlDown and: [ (node := self selectedNode) notNil ]) |
333 |
ifTrue: |
|
19149 | 334 |
[ button == 1 |
10023 | 335 |
ifTrue: [ ^ self openMenu: (node leftClickMenuInCodeView: self) ]. |
19149 | 336 |
button == #paste |
10023 | 337 |
ifTrue: [ ^ self openMenu: (node middleClickMenuInCodeView: self) ]. |
19149 | 338 |
button == 2 |
10023 | 339 |
ifTrue: [ ^ self openMenu: (node rightClickMenuInCodeView: self) ] ]. |
8775 | 340 |
super |
10023 | 341 |
buttonPress: button |
342 |
x: x |
|
343 |
y: y |
|
8775 | 344 |
|
345 |
"Created: / 26-12-2007 / 11:39:50 / janfrog" |
|
346 |
"Modified: / 21-02-2008 / 09:17:29 / janfrog" |
|
347 |
! |
|
348 |
||
349 |
handleNonCommandKey:keyArg |
|
350 |
||
351 |
super handleNonCommandKey: keyArg. |
|
352 |
self startParsingProcess. |
|
353 |
||
354 |
"Created: / 18-02-2008 / 17:18:22 / janfrog" |
|
355 |
! |
|
356 |
||
357 |
keyPress:key x:x y:y |
|
19294 | 358 |
<resource: #keyboard (#Control_L #Ctrl_L |
12104
ef5283010b5f
class: Tools::NewSystemBrowserCodeView
Claus Gittinger <cg@exept.de>
parents:
11790
diff
changeset
|
359 |
#Tab #Return #BackSpace #Delete |
ef5283010b5f
class: Tools::NewSystemBrowserCodeView
Claus Gittinger <cg@exept.de>
parents:
11790
diff
changeset
|
360 |
#GoBack)> |
ef5283010b5f
class: Tools::NewSystemBrowserCodeView
Claus Gittinger <cg@exept.de>
parents:
11790
diff
changeset
|
361 |
|
8775 | 362 |
(x notNil and:[ y notNil ]) ifTrue:[ |
19294 | 363 |
(#(#Control_L #Control_R #Control #Ctrl_L #Ctrl_R #Ctrl ) includes:key) ifTrue:[ |
19240 | 364 |
self highlightNodeAtX:x y:y; redraw |
8775 | 365 |
]. |
366 |
"key = #Alt_L ifTrue: [self highlightParseTreeNodeAtX: x y: y; redraw]" |
|
367 |
]. |
|
368 |
||
12104
ef5283010b5f
class: Tools::NewSystemBrowserCodeView
Claus Gittinger <cg@exept.de>
parents:
11790
diff
changeset
|
369 |
(#( #Tab #Return #BackSpace #Delete) includes:key) ifTrue:[ |
8775 | 370 |
self startParsingProcess |
371 |
]. |
|
372 |
||
373 |
key == #GoBack ifTrue:[self goBack]. |
|
374 |
||
19240 | 375 |
^ super keyPress:key x:x y:y |
8775 | 376 |
|
377 |
"Created: / 25-12-2007 / 23:49:38 / janfrog" |
|
378 |
"Modified: / 27-02-2008 / 12:18:56 / janfrog" |
|
379 |
"Modified: / 12-03-2009 / 16:35:56 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
380 |
! ! |
|
381 |
||
382 |
!NewSystemBrowserCodeView methodsFor:'menu'! |
|
383 |
||
10023 | 384 |
browseClassesMenu: classes |
385 |
| menu| |
|
386 |
||
387 |
menu := Menu new. |
|
18684 | 388 |
classes do: [:cls| |
10023 | 389 |
menu addItem:(MenuItem |
18684 | 390 |
label: ('Browse ' , cls fullName allBold) |
12957
47ba70e36a83
class: Tools::NewSystemBrowserCodeView
Claus Gittinger <cg@exept.de>
parents:
12355
diff
changeset
|
391 |
itemValue:[self browseClass: cls])]. |
10023 | 392 |
|
393 |
^ menu |
|
394 |
||
395 |
"Modified: / 19-10-2008 / 08:16:50 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
396 |
"Created: / 01-09-2009 / 09:41:59 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
18684 | 397 |
"Modified (format): / 13-03-2019 / 22:10:49 / Claus Gittinger" |
10023 | 398 |
! |
399 |
||
8775 | 400 |
editMenu |
401 |
||
402 |
| editMenu superEditMenu moreMenu moreMenuItem | |
|
403 |
editMenu := self class editMenuSpec decodeAsLiteralArray. |
|
404 |
superEditMenu := super editMenu. |
|
405 |
moreMenu := superEditMenu subMenuAt: superEditMenu numberOfItems. |
|
406 |
moreMenuItem := editMenu menuItemLabeled: 'More'. |
|
407 |
moreMenuItem submenu: moreMenu asMenu. |
|
408 |
editMenu findGuiResourcesIn: self. |
|
409 |
^editMenu |
|
410 |
||
411 |
"Created: / 25-12-2007 / 10:10:01 / janfrog" |
|
412 |
"Modified: / 25-12-2007 / 19:50:53 / janfrog" |
|
413 |
"Modified: / 18-10-2008 / 20:31:16 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
414 |
! |
|
415 |
||
416 |
messageNodeContextMenu:messageNode |
|
417 |
|menu| |
|
418 |
||
419 |
menu := Menu new. |
|
420 |
menu |
|
421 |
addItem:((MenuItem new) |
|
422 |
label:'Implementors'; |
|
423 |
shortcutKey:#ImplementorsOfIt; |
|
424 |
submenuChannel:(Promise |
|
425 |
value:[ self messageNodeImplementorsMenu:messageNode ])); |
|
426 |
addItem:((MenuItem new) |
|
427 |
label:'Senders'; |
|
428 |
shortcutKey:#SendersOfIt; |
|
429 |
submenuChannel:(Promise value:[ self messageNodeSendersMenu:messageNode ])). |
|
430 |
^ menu |
|
431 |
||
432 |
"Created: / 18-02-2008 / 21:05:36 / janfrog" |
|
433 |
! |
|
434 |
||
435 |
messageNodeImplementorsMenu:messageNode |
|
18684 | 436 |
|implementors selector menu selectorString| |
8775 | 437 |
|
18684 | 438 |
selector := messageNode selector. |
439 |
||
8775 | 440 |
menu := Menu new. |
18684 | 441 |
implementors := self implementorsOf:selector. |
10463 | 442 |
implementors isEmptyOrNil ifTrue:[ |
8775 | 443 |
menu addItem:(MenuItem label:'No implementors found') disable |
444 |
] ifFalse:[ |
|
18684 | 445 |
selectorString := selector storeString. |
8775 | 446 |
menu addItem:(MenuItem |
18684 | 447 |
label:(selectorString , (' (all implementors) ') allItalic) |
12957
47ba70e36a83
class: Tools::NewSystemBrowserCodeView
Claus Gittinger <cg@exept.de>
parents:
12355
diff
changeset
|
448 |
itemValue:[ |
18684 | 449 |
self browseMethods:implementors label:'Implementors of ' , selectorString |
8775 | 450 |
]). |
451 |
menu addSeparator. |
|
452 |
implementors do:[:mth | |
|
453 |
menu |
|
12957
47ba70e36a83
class: Tools::NewSystemBrowserCodeView
Claus Gittinger <cg@exept.de>
parents:
12355
diff
changeset
|
454 |
addItem:(MenuItem |
18684 | 455 |
label:(selectorString |
456 |
, (' in ' , mth containingClass name allBold)) |
|
457 |
itemValue:[ self browseMethod:mth label: 'Implementor of ' , selectorString ]) |
|
8775 | 458 |
] |
459 |
]. |
|
460 |
^ menu |
|
461 |
||
462 |
"Created: / 18-02-2008 / 21:05:47 / janfrog" |
|
463 |
"Modified: / 19-10-2008 / 08:16:50 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
10463 | 464 |
"Modified: / 04-08-2011 / 19:05:37 / cg" |
18684 | 465 |
"Modified: / 13-03-2019 / 22:14:27 / Claus Gittinger" |
8775 | 466 |
! |
467 |
||
468 |
messageNodeSendersMenu:messageNode |
|
18684 | 469 |
|implementors selector menu selectorString| |
8775 | 470 |
|
18684 | 471 |
selector := messageNode selector. |
472 |
||
8775 | 473 |
menu := Menu new. |
18684 | 474 |
implementors := self sendersOf:selector. |
10463 | 475 |
implementors isEmptyOrNil ifTrue:[ |
8775 | 476 |
menu addItem:(MenuItem label:'No senders found') disable |
477 |
] ifFalse:[ |
|
18684 | 478 |
selectorString := selector storeString. |
8775 | 479 |
menu addItem:(MenuItem |
18684 | 480 |
label:(selectorString , (' (all senders)') allItalic) |
12957
47ba70e36a83
class: Tools::NewSystemBrowserCodeView
Claus Gittinger <cg@exept.de>
parents:
12355
diff
changeset
|
481 |
itemValue:[ |
18684 | 482 |
self browseMethods:implementors label:'Senders of ' , selectorString |
8775 | 483 |
]). |
484 |
menu addSeparator. |
|
485 |
implementors do:[:mth | |
|
486 |
menu |
|
12957
47ba70e36a83
class: Tools::NewSystemBrowserCodeView
Claus Gittinger <cg@exept.de>
parents:
12355
diff
changeset
|
487 |
addItem:(MenuItem |
47ba70e36a83
class: Tools::NewSystemBrowserCodeView
Claus Gittinger <cg@exept.de>
parents:
12355
diff
changeset
|
488 |
label:(mth selector storeString |
18684 | 489 |
, (' in ' , mth containingClass name allBold)) |
490 |
itemValue:[ self browseMethod:mth label: 'Sender of ' , selectorString ]) |
|
8775 | 491 |
] |
492 |
]. |
|
493 |
^ menu |
|
494 |
||
495 |
"Created: / 18-02-2008 / 21:05:56 / janfrog" |
|
496 |
"Modified: / 19-10-2008 / 08:17:00 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
10463 | 497 |
"Modified: / 04-08-2011 / 19:05:40 / cg" |
18684 | 498 |
"Modified: / 13-03-2019 / 22:13:22 / Claus Gittinger" |
8775 | 499 |
! |
500 |
||
501 |
openMenu: aMenuOrNil |
|
502 |
||
503 |
aMenuOrNil ifNotNil: |
|
504 |
[self highlightClear; redraw. |
|
505 |
aMenuOrNil startUp]. |
|
506 |
||
507 |
"Created: / 18-02-2008 / 19:03:08 / janfrog" |
|
508 |
! |
|
509 |
||
510 |
variableNodeMenuContext:variableNode |
|
511 |
||
512 |
| menu | |
|
513 |
menu := Menu new. |
|
514 |
menu |
|
515 |
addItem: |
|
14596
d7265f2d768e
class: Tools::NewSystemBrowserCodeView
Claus Gittinger <cg@exept.de>
parents:
12957
diff
changeset
|
516 |
(MenuItem |
d7265f2d768e
class: Tools::NewSystemBrowserCodeView
Claus Gittinger <cg@exept.de>
parents:
12957
diff
changeset
|
517 |
label: 'Rename Local Variable' |
d7265f2d768e
class: Tools::NewSystemBrowserCodeView
Claus Gittinger <cg@exept.de>
parents:
12957
diff
changeset
|
518 |
itemValue:[self refactorMenuRenameLocalVariable] |
8775 | 519 |
enabled:(self isLocalVariableNode: variableNode)); |
520 |
addItem: |
|
14596
d7265f2d768e
class: Tools::NewSystemBrowserCodeView
Claus Gittinger <cg@exept.de>
parents:
12957
diff
changeset
|
521 |
(MenuItem |
d7265f2d768e
class: Tools::NewSystemBrowserCodeView
Claus Gittinger <cg@exept.de>
parents:
12957
diff
changeset
|
522 |
label: 'Rename Instance Variable' |
d7265f2d768e
class: Tools::NewSystemBrowserCodeView
Claus Gittinger <cg@exept.de>
parents:
12957
diff
changeset
|
523 |
itemValue:[self refactorMenuRenameInstanceVariable] |
8775 | 524 |
enabled:(self isInstanceVariableNode: variableNode)). |
525 |
||
526 |
^menu |
|
527 |
||
528 |
"Created: / 18-02-2008 / 21:10:46 / janfrog" |
|
529 |
"Modified: / 21-02-2008 / 09:40:09 / janfrog" |
|
11790 | 530 |
"Modified: / 09-09-2012 / 13:24:19 / cg" |
8775 | 531 |
! ! |
532 |
||
19240 | 533 |
!NewSystemBrowserCodeView methodsFor:'menu - double dispatch'! |
534 |
||
535 |
blueButtonMenuForMessageNode:messageNode |
|
536 |
^ self messageNodeContextMenu:messageNode |
|
537 |
||
538 |
"Created: / 18-02-2008 / 19:12:56 / janfrog" |
|
539 |
"Modified: / 18-02-2008 / 21:05:36 / janfrog" |
|
540 |
! |
|
541 |
||
542 |
blueButtonMenuForVariableNode: messageNode |
|
543 |
||
544 |
^self variableNodeMenuContext:messageNode |
|
545 |
||
546 |
"Created: / 18-02-2008 / 21:04:32 / janfrog" |
|
547 |
! |
|
548 |
||
549 |
leftClickMenuForMessageNode: messageNode |
|
550 |
^ self messageNodeImplementorsMenu: messageNode |
|
551 |
||
552 |
"Modified: / 18-02-2008 / 21:05:47 / janfrog" |
|
553 |
! |
|
554 |
||
555 |
leftClickMenuForVariableNode: varNode |
|
556 |
| environment classes | |
|
557 |
||
558 |
self browser ifNil:[^nil]. |
|
559 |
environment := self browser theSingleSelectedMethod mclass environment. |
|
560 |
classes := OrderedCollection new. |
|
561 |
[ environment notNil ] whileTrue:[ |
|
562 |
| cls | |
|
563 |
||
564 |
cls := environment at: varNode name asSymbol. |
|
565 |
cls ifNotNil:[classes add: cls]. |
|
566 |
environment := |
|
567 |
(environment == Smalltalk) |
|
568 |
ifTrue:[environment := nil] |
|
569 |
ifFalse:[environment environment] |
|
570 |
]. |
|
571 |
^classes isEmpty |
|
572 |
ifTrue:[self browseClassesMenu: classes ] |
|
573 |
ifFalse:[self variableNodeMenuContext: varNode] |
|
574 |
||
575 |
"Modified: / 18-02-2008 / 21:05:47 / janfrog" |
|
576 |
"Created: / 01-09-2009 / 08:41:37 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
577 |
"Modified: / 01-09-2009 / 09:46:10 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
578 |
"Modified (format): / 05-07-2011 / 16:04:47 / cg" |
|
579 |
! |
|
580 |
||
581 |
middleClickMenuForMessageNode: messageNode |
|
582 |
^ self messageNodeSendersMenu: messageNode |
|
583 |
||
584 |
"Created: / 18-02-2008 / 19:08:50 / janfrog" |
|
585 |
"Modified: / 18-02-2008 / 21:05:56 / janfrog" |
|
586 |
! |
|
587 |
||
588 |
redButtonMenuForMessageNode:messageNode |
|
589 |
^ self messageNodeImplementorsMenu:messageNode |
|
590 |
||
591 |
"Modified: / 18-02-2008 / 21:05:47 / janfrog" |
|
592 |
! |
|
593 |
||
594 |
rightClickMenuForMessageNode: messageNode |
|
595 |
^ self messageNodeContextMenu: messageNode |
|
596 |
||
597 |
"Created: / 18-02-2008 / 19:12:56 / janfrog" |
|
598 |
"Modified: / 18-02-2008 / 21:05:36 / janfrog" |
|
599 |
! |
|
600 |
||
601 |
rightClickMenuForVariableNode: variableNode |
|
602 |
^ self variableNodeMenuContext: variableNode |
|
603 |
||
604 |
"Created: / 18-02-2008 / 21:04:32 / janfrog" |
|
605 |
! |
|
606 |
||
607 |
yellowButtonMenuForMessageNode:messageNode |
|
608 |
^ self messageNodeSendersMenu:messageNode |
|
609 |
||
610 |
"Created: / 18-02-2008 / 19:08:50 / janfrog" |
|
611 |
"Modified: / 18-02-2008 / 21:05:56 / janfrog" |
|
612 |
! ! |
|
613 |
||
614 |
!NewSystemBrowserCodeView methodsFor:'menu actions'! |
|
8775 | 615 |
|
616 |
accept |
|
617 |
||
618 |
super accept. |
|
619 |
self startParsingProcess |
|
620 |
||
621 |
"Created: / 26-12-2007 / 12:33:19 / janfrog" |
|
622 |
! |
|
623 |
||
10023 | 624 |
browseClass: class |
625 |
||
626 |
self browser ifNil: [^NewSystemBrowser browseClass:class]. |
|
627 |
(UserPreferences current alwaysOpenNewTabWhenCtrlClick or:[self browser navigationState modified]) |
|
628 |
ifTrue: |
|
629 |
[self browser |
|
630 |
spawnClassBrowserFor:(Array with: class) |
|
631 |
in:#newBuffer] |
|
632 |
ifFalse: |
|
633 |
[self browser |
|
634 |
switchToClass: class]. |
|
635 |
||
636 |
"Modified: / 19-02-2008 / 10:15:17 / janfrog" |
|
637 |
"Created: / 01-09-2009 / 08:52:24 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
638 |
! |
|
639 |
||
8775 | 640 |
browseImplementorsOfIt |
641 |
||
642 |
| selector implementors | |
|
643 |
selector := self selectedSelector. |
|
644 |
implementors := self implementorsOf: selector. |
|
645 |
self browseMethods: implementors label: 'Implementors of: ', selector storeString |
|
646 |
||
647 |
"Created: / 26-12-2007 / 11:02:41 / janfrog" |
|
648 |
! |
|
649 |
||
650 |
browseMethod: method label: label |
|
651 |
||
652 |
self browser ifNil: [^NewSystemBrowser openInMethod:method]. |
|
653 |
(UserPreferences current alwaysOpenNewTabWhenCtrlClick or:[self browser navigationState modified]) |
|
654 |
ifTrue: |
|
655 |
[self browser |
|
656 |
spawnMethodBrowserFor:(Array with: method) |
|
657 |
in:#newBuffer |
|
658 |
label:label] |
|
659 |
ifFalse: |
|
660 |
[self browser |
|
661 |
switchToClass: method containingClass |
|
662 |
selector: method selector]. |
|
663 |
||
664 |
"Modified: / 19-02-2008 / 10:15:17 / janfrog" |
|
665 |
"Created: / 19-10-2008 / 08:16:17 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
666 |
! |
|
667 |
||
668 |
browseMethods: methods label: label |
|
669 |
||
19149 | 670 |
methods size == 1 ifTrue: |
8775 | 671 |
[^self browseMethod: methods anyOne label: label]. |
672 |
||
673 |
self browser |
|
674 |
ifNil: [NewSystemBrowser browseMethods: methods title: label] |
|
675 |
ifNotNil:[self browser spawnMethodBrowserFor:methods in:#newBuffer label:label] |
|
676 |
||
677 |
"Created: / 26-12-2007 / 11:32:04 / janfrog" |
|
678 |
"Modified: / 19-10-2008 / 08:17:28 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
679 |
! |
|
680 |
||
681 |
browseSendersOfIt |
|
682 |
||
683 |
| selector implementors | |
|
684 |
selector := self selectedSelector. |
|
685 |
implementors := self sendersOf: selector. |
|
686 |
self browseMethods: implementors label: 'Senders of: ', selector storeString |
|
687 |
||
688 |
"Created: / 26-12-2007 / 11:35:43 / janfrog" |
|
689 |
! |
|
690 |
||
691 |
goBack |
|
692 |
||
693 |
(self browser respondsTo: #goBack) |
|
694 |
ifTrue:[self browser goBack] |
|
695 |
||
696 |
"Created: / 27-02-2008 / 12:18:02 / janfrog" |
|
697 |
! |
|
698 |
||
699 |
inspectParseTree |
|
700 |
^ self parseTree inspect |
|
701 |
||
702 |
"Created: / 25-12-2007 / 21:36:09 / janfrog" |
|
703 |
"Modified: / 19-02-2008 / 09:20:03 / janfrog" |
|
704 |
! |
|
705 |
||
706 |
inspectSelectedSelector |
|
707 |
||
708 |
^self selectedSelector inspect |
|
709 |
||
710 |
"Created: / 26-12-2007 / 11:16:48 / janfrog" |
|
711 |
! |
|
712 |
||
713 |
refactorMenuRenameInstanceVariable |
|
714 |
||
715 |
self topView application codeMenuRenameTemporary |
|
716 |
||
717 |
"Created: / 21-02-2008 / 09:15:08 / janfrog" |
|
718 |
! |
|
719 |
||
720 |
refactorMenuRenameLocalVariable |
|
721 |
||
722 |
self browser codeMenuRenameTemporary |
|
723 |
||
724 |
"Created: / 18-02-2008 / 21:21:26 / janfrog" |
|
725 |
"Modified: / 19-02-2008 / 09:59:11 / janfrog" |
|
726 |
! ! |
|
727 |
||
728 |
!NewSystemBrowserCodeView methodsFor:'private'! |
|
729 |
||
730 |
implementorsOf: selector |
|
731 |
||
732 |
selector ifNil:[^#()]. |
|
733 |
^SystemBrowser |
|
734 |
findImplementorsOf: selector |
|
735 |
in: Smalltalk allClasses |
|
736 |
ignoreCase: false |
|
737 |
||
738 |
"Created: / 26-12-2007 / 11:37:11 / janfrog" |
|
739 |
! |
|
740 |
||
741 |
sendersOf: selector |
|
742 |
||
743 |
^SystemBrowser |
|
744 |
findSendersOf: selector |
|
745 |
in: Smalltalk allClasses |
|
746 |
ignoreCase: false |
|
747 |
||
748 |
"Created: / 26-12-2007 / 11:37:22 / janfrog" |
|
749 |
! ! |
|
750 |
||
751 |
!NewSystemBrowserCodeView methodsFor:'private - highlighting'! |
|
752 |
||
753 |
highlightClear |
|
10023 | 754 |
self list ifNil:[ ^ self ]. |
755 |
self list do:[:line | |
|
756 |
line isText ifTrue:[ |
|
757 |
line emphasisAllRemove:self selectorEmphasis |
|
758 |
] |
|
759 |
] |
|
8775 | 760 |
|
761 |
"Created: / 25-12-2007 / 23:26:27 / janfrog" |
|
762 |
"Modified: / 26-12-2007 / 12:28:05 / janfrog" |
|
763 |
! |
|
764 |
||
765 |
highlightFrom: start to: end |
|
766 |
"Remove underlined emphasis" |
|
767 |
||
768 |
|startLine startCol endLine endCol| |
|
769 |
||
770 |
startLine := self lineOfCharacterPosition:start. |
|
771 |
startCol := start - (self characterPositionOfLine:startLine col:1) + 1. |
|
772 |
endLine := self lineOfCharacterPosition:end. |
|
773 |
endCol := end - (self characterPositionOfLine:endLine col:1) + 1. |
|
774 |
self highlightFromLine: startLine col: startCol toLine: endLine col: endCol |
|
775 |
||
776 |
"Created: / 25-12-2007 / 22:56:28 / janfrog" |
|
777 |
! |
|
778 |
||
10023 | 779 |
highlightLine:lineNo fromLine:startLine col:endLine toLine:startCol col:endCol emphasis: em |
780 |
|line start end| |
|
8775 | 781 |
|
10023 | 782 |
(lineNo between:startLine and:endLine) ifFalse:[ |
783 |
^ self |
|
784 |
]. |
|
785 |
line := self listAt:lineNo. |
|
786 |
start := lineNo = startLine ifTrue:[ |
|
787 |
startCol |
|
788 |
] ifFalse:[ |
|
789 |
line indexOfFirstNonBlankCharacter |
|
790 |
]. |
|
791 |
end := lineNo = endLine ifTrue:[ |
|
792 |
endCol |
|
793 |
] ifFalse:[ line size ]. |
|
794 |
line |
|
795 |
emphasisFrom:start |
|
796 |
to:end |
|
797 |
add: em |
|
8775 | 798 |
|
10023 | 799 |
"Created: / 25-06-2010 / 13:59:17 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
8775 | 800 |
! |
801 |
||
802 |
highlightNode:node |
|
803 |
selectedNode == node ifTrue:[^ self]. |
|
804 |
selectedNode := node. |
|
805 |
selectedNode ifNil:[ ^ self highlightClear ]. |
|
806 |
selectedNode highlightInCodeView:self. |
|
807 |
||
808 |
"Created: / 19-02-2008 / 09:14:38 / janfrog" |
|
809 |
! |
|
810 |
||
811 |
highlightNodeAtCursor |
|
812 |
self highlightNodeAtLine:self cursorLine col:self cursorCol |
|
813 |
||
814 |
"Created: / 19-02-2008 / 09:14:46 / janfrog" |
|
815 |
! |
|
816 |
||
817 |
highlightNodeAtLine:line col:col |
|
818 |
|characterPosition node| |
|
819 |
||
820 |
(self parseTree isNil or:[ self parseTree = #error ]) ifTrue:[ |
|
821 |
^ self |
|
822 |
]. |
|
823 |
characterPosition := self characterPositionOfLine:line col:col. |
|
824 |
node := self findNodeForInterval: (characterPosition to:characterPosition). |
|
825 |
self highlightNode:node |
|
826 |
||
827 |
"Created: / 19-02-2008 / 09:14:58 / janfrog" |
|
828 |
! |
|
829 |
||
830 |
highlightNodeAtX:x y:y |
|
831 |
|visibleLine line col| |
|
832 |
||
833 |
(self parseTree isNil or:[ self parseTree = #error ]) ifTrue:[ |
|
834 |
^ self |
|
835 |
]. |
|
836 |
visibleLine := self visibleLineOfY:y. |
|
837 |
col := self colOfX:x inVisibleLine:visibleLine. |
|
838 |
line := self visibleLineToAbsoluteLine:visibleLine. |
|
839 |
self highlightNodeAtLine:line col:col |
|
840 |
||
841 |
"Created: / 19-02-2008 / 09:15:09 / janfrog" |
|
842 |
! |
|
843 |
||
844 |
highlightWithoutClearFrom: start to: end |
|
845 |
"Remove underlined emphasis" |
|
846 |
||
847 |
|startLine startCol endLine endCol| |
|
848 |
||
849 |
startLine := self lineOfCharacterPosition:start. |
|
850 |
startCol := start - (self characterPositionOfLine:startLine col:1) + 1. |
|
851 |
endLine := self lineOfCharacterPosition:end. |
|
852 |
endCol := end - (self characterPositionOfLine:endLine col:1) + 1. |
|
853 |
self highlightWithoutClearFromLine: startLine col: startCol toLine: endLine col: endCol |
|
854 |
||
855 |
"Created: / 25-12-2007 / 23:27:14 / janfrog" |
|
856 |
! |
|
857 |
||
858 |
highlightWithoutClearFromLine: startLine col: startCol toLine: endLine col: endCol |
|
859 |
||
860 |
self list keysAndValuesDo: |
|
861 |
[:lineNo :line| |
|
862 |
|start end| |
|
863 |
line isText ifTrue: |
|
864 |
[self highlightLine: lineNo fromLine: startLine col: endLine toLine: startCol col: endCol]]. |
|
865 |
||
866 |
"Created: / 25-12-2007 / 23:35:07 / janfrog" |
|
10023 | 867 |
! |
868 |
||
869 |
highlightWithoutClearFromLine: startLine col: startCol toLine: endLine col: endCol emphasis: em |
|
870 |
||
871 |
self list keysAndValuesDo: |
|
872 |
[:lineNo :line| |
|
873 |
|start end| |
|
874 |
line isText ifTrue: |
|
875 |
[self highlightLine: lineNo fromLine: startLine col: endLine toLine: startCol col: endCol emphasis: em]]. |
|
876 |
||
877 |
"Created: / 25-06-2010 / 13:58:32 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
878 |
! |
|
879 |
||
880 |
selectorEmphasis |
|
16798 | 881 |
highlightEmphasis isNil ifTrue:[ |
882 |
highlightEmphasis := #(underline bold) |
|
883 |
]. |
|
884 |
^ highlightEmphasis. |
|
10023 | 885 |
|
886 |
"Created: / 25-12-2007 / 22:57:23 / janfrog" |
|
887 |
"Modified: / 01-09-2009 / 22:29:20 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
8775 | 888 |
! ! |
889 |
||
890 |
!NewSystemBrowserCodeView methodsFor:'private - highlighting - nodes'! |
|
891 |
||
892 |
highlightLiteralNode: node |
|
893 |
||
894 |
node value isSymbol ifTrue: |
|
895 |
[self highlightFrom: node start to: node stop] |
|
896 |
||
897 |
"Created: / 26-12-2007 / 10:19:08 / janfrog" |
|
898 |
! |
|
899 |
||
900 |
highlightMessageNode: node |
|
901 |
||
902 |
self highlightClear. |
|
903 |
node selectorParts do: |
|
904 |
[:part|self highlightWithoutClearFrom: part start to: part stop] |
|
905 |
||
906 |
"Created: / 25-12-2007 / 23:41:36 / janfrog" |
|
907 |
! |
|
908 |
||
909 |
highlightVariableNode: node |
|
910 |
(#('self' 'super' 'here' 'thisContext') includes:node name) ifTrue:[^self]. |
|
911 |
^ self highlightFrom: node start to: node stop |
|
912 |
||
913 |
"Created: / 25-12-2007 / 23:45:42 / janfrog" |
|
914 |
"Modified: / 18-02-2008 / 20:51:51 / janfrog" |
|
915 |
! ! |
|
916 |
||
917 |
!NewSystemBrowserCodeView methodsFor:'private - parsing'! |
|
918 |
||
919 |
parseTree |
|
920 |
||
921 |
^ parseTree |
|
922 |
||
923 |
"Created: / 19-02-2008 / 09:20:03 / janfrog" |
|
924 |
"Modified: / 19-10-2008 / 07:36:36 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
925 |
! |
|
926 |
||
927 |
parseTree:something |
|
928 |
parseTree := something. |
|
929 |
||
930 |
"Created: / 19-10-2008 / 07:39:15 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
931 |
! |
|
932 |
||
933 |
parseTree:something sequenceNumber: givenSeqNum |
|
934 |
||
935 |
givenSeqNum < seqNum ifFalse: |
|
936 |
[parseTree := something]. |
|
937 |
||
938 |
"Created: / 12-03-2009 / 16:29:11 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
939 |
! |
|
940 |
||
941 |
startParsingProcess |
|
942 |
|prio contents| |
|
943 |
||
944 |
seqNum := ((seqNum ? 0) + 1). |
|
945 |
parsingProcess |
|
946 |
ifNotNil:[ |
|
947 |
parsingProcessRunning ~~ true ifTrue:[ |
|
948 |
^ self |
|
949 |
]. |
|
950 |
self stopParsingProcess |
|
951 |
]. |
|
952 |
prio := Processor userBackgroundPriority - 1. |
|
953 |
self shown ifFalse:[ |
|
954 |
prio := prio - 1 max:1 |
|
955 |
]. |
|
956 |
contents := self contents. |
|
957 |
parsingProcess := [ |
|
958 |
[ |
|
959 |
| tree | |
|
10463 | 960 |
tree := ((contents isEmptyOrNil) |
8775 | 961 |
ifTrue:[ nil ] |
962 |
ifFalse:[ RBParser parseMethod:contents onError:[:err :pos | #error ] ]). |
|
963 |
self sensor |
|
964 |
pushUserEvent:#parseTree:sequenceNumber: |
|
965 |
for: self |
|
966 |
withArguments: |
|
967 |
(Array with: tree with: seqNum) |
|
968 |
] ensure:[ |
|
969 |
parsingProcessRunning := false. |
|
970 |
parsingProcess := nil. |
|
971 |
] |
|
972 |
] forkAt:prio |
|
973 |
||
974 |
"Modified: / 19-02-2008 / 09:22:57 / janfrog" |
|
975 |
"Created: / 21-08-2009 / 15:40:06 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
976 |
"Modified: / 22-08-2009 / 11:51:27 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
10463 | 977 |
"Modified: / 04-08-2011 / 19:05:45 / cg" |
8775 | 978 |
! |
979 |
||
980 |
stopParsingProcess |
|
981 |
|p| |
|
982 |
||
983 |
(p := parsingProcess) notNil ifTrue:[ |
|
984 |
parsingProcess := nil. |
|
985 |
p terminate. |
|
986 |
"/ raise its prio to make it terminate quickly |
|
987 |
p priority:(Processor userSchedulingPriority + 1) |
|
988 |
] |
|
989 |
||
990 |
"Created: / 25-12-2007 / 21:16:03 / janfrog" |
|
991 |
! ! |
|
992 |
||
993 |
!NewSystemBrowserCodeView methodsFor:'private - testing'! |
|
994 |
||
995 |
isInstanceVariableNode: node |
|
996 |
||
997 |
||
998 |
node isVariable ifFalse:[^false]. |
|
999 |
^(self selectedClass allInstVarNames includes:(node name)) |
|
1000 |
||
1001 |
"Created: / 21-02-2008 / 09:39:10 / janfrog" |
|
1002 |
! |
|
1003 |
||
1004 |
isLocalVariableNode: node |
|
1005 |
||
1006 |
||
1007 |
(self parseTree arguments includes: node) ifTrue:[^true]. |
|
1008 |
(self parseTree body temporaries includes: node) ifTrue:[^true]. |
|
1009 |
^false |
|
1010 |
||
1011 |
"Created: / 21-02-2008 / 09:32:33 / janfrog" |
|
1012 |
! ! |
|
1013 |
||
1014 |
!NewSystemBrowserCodeView class methodsFor:'documentation'! |
|
1015 |
||
8806 | 1016 |
version_CVS |
16798 | 1017 |
^ '$Header$' |
10023 | 1018 |
! |
1019 |
||
1020 |
version_SVN |
|
16798 | 1021 |
^ '$Id$' |
8775 | 1022 |
! ! |
1023 |
||
12104
ef5283010b5f
class: Tools::NewSystemBrowserCodeView
Claus Gittinger <cg@exept.de>
parents:
11790
diff
changeset
|
1024 |
|
8775 | 1025 |
NewSystemBrowserCodeView initialize! |