author | Claus Gittinger <cg@exept.de> |
Wed, 22 Aug 2018 15:37:08 +0200 | |
changeset 18348 | b3cdcd31f2cf |
parent 18093 | af2d8b0f8715 |
child 19073 | 187b9328a18e |
permissions | -rw-r--r-- |
18092 | 1 |
"{ Encoding: utf8 }" |
2 |
||
15434 | 3 |
" |
4 |
COPYRIGHT (c) 2000 by eXept Software AG |
|
5 |
All Rights Reserved |
|
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' }" |
|
15 |
||
16 |
"{ NameSpace: Tools }" |
|
17 |
||
18 |
ApplicationModel subclass:#NavigatorModel |
|
19 |
instanceVariableNames:'environmentHolder environment' |
|
20 |
classVariableNames:'AllEntry SuperSendEntry UncommentedEntry' |
|
21 |
poolDictionaries:'' |
|
22 |
category:'Interface-Browsers-New' |
|
23 |
! |
|
24 |
||
25 |
!NavigatorModel class methodsFor:'documentation'! |
|
26 |
||
27 |
copyright |
|
28 |
" |
|
29 |
COPYRIGHT (c) 2000 by eXept Software AG |
|
30 |
All Rights Reserved |
|
31 |
||
32 |
This software is furnished under a license and may be used |
|
33 |
only in accordance with the terms of that license and with the |
|
34 |
inclusion of the above copyright notice. This software may not |
|
35 |
be provided or otherwise made available to, or used by, any |
|
36 |
other person. No title to or ownership of the software is |
|
37 |
hereby transferred. |
|
38 |
" |
|
39 |
! |
|
40 |
||
41 |
documentation |
|
42 |
" |
|
43 |
A base abstract superclass for all tools browsing the code. |
|
44 |
||
45 |
The `environment` instvar should be used to access the code elements |
|
46 |
(classes, packages, namespace). The tool should never access Smalltalk |
|
47 |
directly, but the `environment`. By default, the `environment` is |
|
48 |
initialized to Smalltalk. The `environment` could be whatever object |
|
49 |
you like, but it MUST be polymorph with Smalltalk. Also, all classes-like |
|
50 |
objects it returns MUST be polymorph with Class. Otherwise, expect |
|
51 |
a lot of DNUs. |
|
52 |
||
53 |
[author:] |
|
54 |
Jan Vrany <jan.vrany@fit.cvut.cz> |
|
55 |
||
56 |
[instance variables:] |
|
57 |
environment |
|
58 |
||
59 |
[class variables:] |
|
60 |
||
61 |
[see also:] |
|
62 |
||
63 |
" |
|
64 |
! ! |
|
65 |
||
66 |
!NavigatorModel class methodsFor:'initialization'! |
|
67 |
||
68 |
initialize |
|
69 |
AllEntry := '* all *'. |
|
70 |
||
71 |
"Created: / 24.2.2000 / 13:41:29 / cg" |
|
72 |
! ! |
|
73 |
||
74 |
!NavigatorModel class methodsFor:'defaults'! |
|
75 |
||
76 |
isPseudoCategory:cat |
|
77 |
^ cat = self nameListEntryForChanged |
|
78 |
or:[ cat = self nameListEntryForUndocumented |
|
79 |
or:[ cat = self nameListEntryForUnloaded |
|
80 |
or:[ cat = self nameListEntryForExtendedClasses |
|
81 |
or:[ cat = self nameListEntryForALL ]]]] |
|
82 |
! |
|
83 |
||
15603
5bf4ed5e910d
class: Tools::NavigatorModel
Claus Gittinger <cg@exept.de>
parents:
15435
diff
changeset
|
84 |
isPseudoProject:prj |
5bf4ed5e910d
class: Tools::NavigatorModel
Claus Gittinger <cg@exept.de>
parents:
15435
diff
changeset
|
85 |
^ prj = self nameListEntryForChanged |
5bf4ed5e910d
class: Tools::NavigatorModel
Claus Gittinger <cg@exept.de>
parents:
15435
diff
changeset
|
86 |
or:[ prj = self nameListEntryForALL ] |
5bf4ed5e910d
class: Tools::NavigatorModel
Claus Gittinger <cg@exept.de>
parents:
15435
diff
changeset
|
87 |
! |
5bf4ed5e910d
class: Tools::NavigatorModel
Claus Gittinger <cg@exept.de>
parents:
15435
diff
changeset
|
88 |
|
15434 | 89 |
isPseudoProtocol:protocol |
90 |
^ protocol = self nameListEntryForObsolete |
|
91 |
or:[ protocol = self nameListEntryForSuperSend |
|
92 |
or:[ protocol = self nameListEntryForUncommented ]] |
|
93 |
! |
|
94 |
||
95 |
markForBeingInChangeList |
|
18092 | 96 |
"items in the changeList are marked with this cahracter; |
97 |
the '*' is disturbing arithmetic messages (i.e. Integer >> *) |
|
98 |
therefore, it was changed to the '!!', which is nowhere implemented." |
|
99 |
||
18093 | 100 |
^ ' ∆'. |
101 |
"/ ^ ' !!'. |
|
18092 | 102 |
"/ ^ ' °'. |
103 |
"/ ^ ' *' |
|
15434 | 104 |
|
105 |
"Created: / 29-08-2006 / 10:26:05 / cg" |
|
106 |
! |
|
107 |
||
108 |
markForBeingManagedBySVN: package |
|
109 |
||
110 |
| repo branch mark | |
|
111 |
||
112 |
(ConfigurableFeatures includesFeature: #SubversionSupportEnabled) ifFalse:[^'']. |
|
113 |
package = PackageId noProjectID ifTrue:[^'']. |
|
114 |
||
115 |
"/ use Smalltalk-at to trick the dependency/prerequisite generator |
|
116 |
repo := (Smalltalk at:#SVN::RepositoryManager) current |
|
117 |
repositoryForPackage: package onlyFromCache: true. |
|
118 |
repo ifNil:[^'']. |
|
119 |
mark := ' [SVN]'. |
|
120 |
branch := repo workingCopy branchOrNil. |
|
121 |
branch ifNotNil:[mark := ' [SVN: ', branch path,']']. |
|
16499 | 122 |
^mark withColor: Color gray |
15434 | 123 |
|
124 |
"Created: / 06-04-2010 / 11:23:27 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
125 |
"Modified (comment): / 07-09-2011 / 10:43:00 / cg" |
|
126 |
"Modified: / 19-01-2012 / 10:44:25 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
127 |
! |
|
128 |
||
129 |
markForBeingManagedBySVN: package branch: branch |
|
130 |
||
131 |
| mark | |
|
132 |
mark := branch |
|
133 |
ifNil: |
|
134 |
[' [SVN]'] |
|
135 |
ifNotNil: |
|
136 |
[' [SVN: ',branch,']']. |
|
137 |
||
16499 | 138 |
^mark withColor: Color gray. |
15434 | 139 |
|
140 |
"Created: / 14-12-2010 / 15:56:23 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
141 |
! |
|
142 |
||
143 |
nameListEntryForALL |
|
144 |
^ AllEntry ? '* all *' |
|
145 |
||
146 |
"Created: / 24.2.2000 / 13:39:10 / cg" |
|
147 |
"Modified: / 25.2.2000 / 21:18:30 / cg" |
|
148 |
! |
|
149 |
||
150 |
nameListEntryForALLWithCount |
|
151 |
^ '* all (%1) *' |
|
152 |
! |
|
153 |
||
15435
0f10cd04a1fa
class: Tools::NavigatorModel
Claus Gittinger <cg@exept.de>
parents:
15434
diff
changeset
|
154 |
nameListEntryForAllTests |
0f10cd04a1fa
class: Tools::NavigatorModel
Claus Gittinger <cg@exept.de>
parents:
15434
diff
changeset
|
155 |
^ '* all tests (%1) *' |
0f10cd04a1fa
class: Tools::NavigatorModel
Claus Gittinger <cg@exept.de>
parents:
15434
diff
changeset
|
156 |
! |
0f10cd04a1fa
class: Tools::NavigatorModel
Claus Gittinger <cg@exept.de>
parents:
15434
diff
changeset
|
157 |
|
15434 | 158 |
nameListEntryForAnnotated |
159 |
^ '* annotated (%1) *' |
|
160 |
||
161 |
"Created: / 07-09-2011 / 10:11:40 / cg" |
|
162 |
! |
|
163 |
||
164 |
nameListEntryForBookmarked |
|
165 |
^ '* bookmarked (%1) *' |
|
166 |
! |
|
167 |
||
168 |
nameListEntryForChanged |
|
169 |
^ '* changed *' |
|
170 |
! |
|
171 |
||
172 |
nameListEntryForChangedWithCount |
|
173 |
^ '* changed (%1) *' |
|
174 |
! |
|
175 |
||
176 |
nameListEntryForDocumentation |
|
177 |
^ '* documentation (%1) *' |
|
178 |
! |
|
179 |
||
180 |
nameListEntryForExtendedClasses |
|
181 |
^ '* extended *' |
|
182 |
! |
|
183 |
||
184 |
nameListEntryForExtendedClassesWithCount |
|
185 |
^ '* extended (%1) *' |
|
186 |
! |
|
187 |
||
188 |
nameListEntryForExtensions |
|
189 |
^ '* extensions (%1) *' |
|
190 |
! |
|
191 |
||
192 |
nameListEntryForFailedTests |
|
16068 | 193 |
"obsoleted by nameListEntryForTestsNotPassed, because it is unclear what failed test means |
194 |
(any of error, fail, inconc, never run, or only the explicit fail?)" |
|
195 |
||
15434 | 196 |
^ '* failed tests (%1) *' |
197 |
||
198 |
"Created: / 08-03-2010 / 18:26:37 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
199 |
! |
|
200 |
||
201 |
nameListEntryForFullyCovered |
|
202 |
^ '* covered (%1) *' |
|
203 |
||
204 |
"Created: / 20-07-2011 / 18:20:53 / cg" |
|
205 |
! |
|
206 |
||
207 |
nameListEntryForInheritedTests |
|
208 |
^ '* inherited tests (%1) *' |
|
209 |
! |
|
210 |
||
211 |
nameListEntryForLong |
|
212 |
^ '* long (%1) *' |
|
213 |
! |
|
214 |
||
215 |
nameListEntryForMustBeRedefinedInSubclass |
|
216 |
^ '* must be redefined (%1) *' |
|
217 |
! |
|
218 |
||
219 |
nameListEntryForNILCategory |
|
220 |
^ '* no category *' |
|
221 |
! |
|
222 |
||
223 |
nameListEntryForNonStatic |
|
224 |
^ '* instance *' |
|
225 |
! |
|
226 |
||
227 |
nameListEntryForNotInstrumented |
|
228 |
^ '* coverage unknown or not instrumented (%1) *' |
|
229 |
||
230 |
"Created: / 20-07-2011 / 18:41:53 / cg" |
|
231 |
! |
|
232 |
||
233 |
nameListEntryForObsolete |
|
234 |
^ '* obsolete (%1) *' |
|
235 |
! |
|
236 |
||
237 |
nameListEntryForOverride |
|
238 |
^ '* override (%1) *' |
|
239 |
! |
|
240 |
||
241 |
nameListEntryForPartiallyCovered |
|
242 |
^ '* partially covered (%1) *' |
|
243 |
||
244 |
"Created: / 20-07-2011 / 18:21:05 / cg" |
|
245 |
! |
|
246 |
||
247 |
nameListEntryForPassedTests |
|
248 |
^ '* passed tests (%1) *' |
|
249 |
||
250 |
"Created: / 08-03-2010 / 18:26:53 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
251 |
! |
|
252 |
||
253 |
nameListEntryForRedefine |
|
254 |
^ '* redefine (%1) *' |
|
255 |
! |
|
256 |
||
257 |
nameListEntryForRedefined |
|
258 |
^ '* redefined (%1) *' |
|
259 |
! |
|
260 |
||
261 |
nameListEntryForRequired |
|
262 |
^ '* required (%1) *' |
|
263 |
! |
|
264 |
||
265 |
nameListEntryForStatic |
|
266 |
^ '* static *' |
|
267 |
! |
|
268 |
||
269 |
nameListEntryForSuperSend |
|
270 |
^ '* super (%1) *' |
|
271 |
! |
|
272 |
||
16068 | 273 |
nameListEntryForTestsNotPassed |
274 |
"includes all non-passed states |
|
275 |
(i.e. fail, error, skipped, inconclusive and never run)" |
|
276 |
||
277 |
^ '* tests not passed (%1) *' |
|
278 |
! |
|
279 |
||
15434 | 280 |
nameListEntryForUncommented |
281 |
^ '* uncommented (%1) *' |
|
282 |
! |
|
283 |
||
284 |
nameListEntryForUncovered |
|
285 |
^ '* not covered (%1) *' |
|
286 |
||
287 |
"Created: / 20-07-2011 / 18:20:44 / cg" |
|
288 |
! |
|
289 |
||
290 |
nameListEntryForUndocumented |
|
291 |
^ '* undocumented *' |
|
292 |
! |
|
293 |
||
294 |
nameListEntryForUndocumentedWithCount |
|
295 |
^ '* undocumented (%1) *' |
|
296 |
! |
|
297 |
||
298 |
nameListEntryForUnloaded |
|
299 |
^ '* unloaded *' |
|
300 |
! |
|
301 |
||
302 |
nameListEntryForUnloadedWithCount |
|
303 |
^ '* unloaded (%1) *' |
|
304 |
! |
|
305 |
||
306 |
nameListEntryForVisited |
|
307 |
^ '* visited (%1) *' |
|
308 |
! |
|
309 |
||
310 |
pseudoEntryForegroundColor |
|
311 |
^ UserPreferences current colorForPseudoProtocolsInMethodListInBrowser. |
|
312 |
||
313 |
"Modified: / 07-09-2011 / 09:59:55 / cg" |
|
314 |
! ! |
|
315 |
||
316 |
!NavigatorModel class methodsFor:'interface specs'! |
|
317 |
||
318 |
metaSpec |
|
319 |
"This resource specification was automatically generated |
|
320 |
by the UIPainter of ST/X." |
|
321 |
||
322 |
"Do not manually edit this!! If it is corrupted, |
|
323 |
the UIPainter may not be able to read the specification." |
|
324 |
||
325 |
" |
|
326 |
UIPainter new openOnClass:Tools::NavigatorModel andSelector:#metaSpec |
|
327 |
Tools::NavigatorModel new openInterface:#metaSpec |
|
328 |
" |
|
329 |
||
330 |
<resource: #canvas> |
|
331 |
||
332 |
^ |
|
333 |
#(FullSpec |
|
334 |
name: metaSpec |
|
335 |
window: |
|
336 |
(WindowSpec |
|
337 |
label: 'MetaToggles' |
|
338 |
name: 'MetaToggles' |
|
339 |
min: (Point 0 0) |
|
340 |
max: (Point 1024 721) |
|
341 |
bounds: (Rectangle 0 0 300 28) |
|
342 |
) |
|
343 |
component: |
|
344 |
(SpecCollection |
|
345 |
collection: ( |
|
346 |
(RadioButtonSpec |
|
347 |
label: 'Instance' |
|
348 |
name: 'InstanceToggle' |
|
349 |
layout: (LayoutFrame 0 0.0 0 0.0 0 0.5 25 0) |
|
350 |
translateLabel: true |
|
351 |
tabable: true |
|
352 |
model: notMetaToggle |
|
353 |
isTriggerOnDown: true |
|
354 |
select: true |
|
355 |
isToggle: true |
|
356 |
) |
|
357 |
(RadioButtonSpec |
|
358 |
label: 'Class' |
|
359 |
name: 'ClassToggle' |
|
360 |
layout: (LayoutFrame 0 0.5 0 0 0 1.0 25 0) |
|
361 |
translateLabel: true |
|
362 |
labelChannel: metaToggleLabelHolder |
|
363 |
tabable: false |
|
364 |
model: metaToggle |
|
365 |
isTriggerOnDown: true |
|
366 |
select: true |
|
367 |
isToggle: true |
|
368 |
) |
|
369 |
) |
|
370 |
||
371 |
) |
|
372 |
) |
|
373 |
! ! |
|
374 |
||
375 |
!NavigatorModel class methodsFor:'misc'! |
|
376 |
||
377 |
classResources |
|
378 |
^ NewSystemBrowser classResources |
|
379 |
! ! |
|
380 |
||
381 |
!NavigatorModel class methodsFor:'plugIn spec'! |
|
382 |
||
383 |
aspectSelectors |
|
384 |
||
385 |
^#( |
|
386 |
environmentHolder |
|
387 |
) |
|
388 |
||
389 |
"Created: / 24-02-2014 / 10:35:14 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
390 |
! ! |
|
391 |
||
392 |
!NavigatorModel class methodsFor:'queries'! |
|
393 |
||
394 |
hasSubversionSupport |
|
395 |
^ ConfigurableFeatures includesFeature: #SubversionSupportEnabled |
|
396 |
||
397 |
"Created: / 06-04-2010 / 11:09:07 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
398 |
"Modified: / 07-09-2011 / 10:45:45 / cg" |
|
399 |
"Modified: / 19-01-2012 / 10:43:59 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
400 |
! |
|
401 |
||
402 |
isAbstract |
|
403 |
^ self == Tools::NavigatorModel |
|
404 |
||
405 |
"Created: / 03-09-2013 / 15:36:44 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
406 |
! ! |
|
407 |
||
408 |
!NavigatorModel methodsFor:'accessing'! |
|
409 |
||
410 |
environment |
|
411 |
^ environment |
|
412 |
||
413 |
"Created: / 03-09-2013 / 19:19:47 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
414 |
! |
|
415 |
||
416 |
environment:env |
|
417 |
self environmentHolder value: env. |
|
418 |
||
419 |
"Modified: / 24-02-2014 / 10:21:39 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
420 |
! ! |
|
421 |
||
422 |
!NavigatorModel methodsFor:'aspects'! |
|
423 |
||
424 |
environmentHolder |
|
425 |
"return/create the 'environmentHolder' value holder (automatically generated)" |
|
426 |
||
427 |
environmentHolder isNil ifTrue:[ |
|
428 |
environmentHolder := ValueHolder with: environment. |
|
429 |
"/ environmentHolder := ValueHolder with: nil. |
|
430 |
||
431 |
environmentHolder addDependent:self. |
|
432 |
]. |
|
433 |
^ environmentHolder |
|
434 |
||
435 |
"Modified: / 28-02-2014 / 19:27:47 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
436 |
! |
|
437 |
||
438 |
environmentHolder:aValueModel |
|
439 |
"set the 'environmentHolder' value holder (automatically generated)" |
|
440 |
||
441 |
| oldValue newValue | |
|
442 |
||
443 |
environmentHolder notNil ifTrue:[ |
|
444 |
oldValue := environmentHolder value. |
|
445 |
environmentHolder removeDependent:self. |
|
446 |
] ifFalse:[ |
|
447 |
oldValue := environment. |
|
448 |
]. |
|
449 |
||
450 |
environmentHolder := aValueModel. |
|
451 |
environmentHolder notNil ifTrue:[ |
|
452 |
environmentHolder addDependent:self. |
|
453 |
]. |
|
454 |
newValue := environmentHolder value. |
|
455 |
oldValue ~~ newValue ifTrue:[ |
|
456 |
self |
|
457 |
update:#value |
|
458 |
with:newValue |
|
459 |
from:environmentHolder. |
|
460 |
]. |
|
461 |
||
462 |
"Modified: / 28-02-2014 / 19:30:20 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
463 |
! ! |
|
464 |
||
465 |
!NavigatorModel methodsFor:'change & update'! |
|
466 |
||
467 |
environmentChanged |
|
468 |
"My environment has changed. Update cached environment value. |
|
469 |
Subclasses may need to override and invalidate it's contents." |
|
470 |
||
471 |
| env | |
|
472 |
||
473 |
env := environmentHolder value. |
|
474 |
environment := env. |
|
475 |
||
476 |
"Created: / 24-02-2014 / 10:18:01 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
477 |
"Modified: / 24-02-2014 / 23:34:00 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
478 |
! |
|
479 |
||
480 |
update:something with:aParameter from:changedObject |
|
481 |
"Invoked when an object that I depend upon sends a change notification." |
|
482 |
||
483 |
changedObject == environmentHolder ifTrue:[ |
|
484 |
self environmentChanged. |
|
485 |
^ self. |
|
486 |
]. |
|
487 |
super update:something with:aParameter from:changedObject |
|
488 |
||
489 |
"Modified: / 24-02-2014 / 10:18:01 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
490 |
! ! |
|
491 |
||
492 |
!NavigatorModel methodsFor:'initialization'! |
|
493 |
||
494 |
initialize |
|
495 |
||
496 |
environment := environment ? Smalltalk. |
|
497 |
super initialize. |
|
498 |
||
499 |
"Created: / 03-09-2013 / 15:35:56 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
500 |
"Modified: / 24-02-2014 / 23:27:00 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
501 |
! ! |
|
502 |
||
503 |
!NavigatorModel methodsFor:'misc'! |
|
504 |
||
505 |
resources |
|
506 |
"answer the resources of my masterApp, if there is one" |
|
507 |
||
508 |
|m| |
|
509 |
||
510 |
(m := self masterApplication) notNil ifTrue:[ |
|
511 |
^ m resources |
|
512 |
]. |
|
513 |
^ super resources |
|
514 |
! ! |
|
515 |
||
516 |
!NavigatorModel methodsFor:'queries'! |
|
517 |
||
518 |
hasSubversionSupport |
|
519 |
^ ConfigurableFeatures includesFeature: #SubversionSupportEnabled |
|
520 |
||
521 |
"Modified: / 07-09-2011 / 10:45:49 / cg" |
|
522 |
"Modified: / 19-01-2012 / 10:43:52 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
523 |
! ! |
|
524 |
||
525 |
!NavigatorModel class methodsFor:'documentation'! |
|
526 |
||
527 |
version |
|
16068 | 528 |
^ '$Header$' |
15434 | 529 |
! |
530 |
||
531 |
version_CVS |
|
16068 | 532 |
^ '$Header$' |
15434 | 533 |
! |
534 |
||
535 |
version_HG |
|
536 |
||
537 |
^ '$Changeset: <not expanded> $' |
|
538 |
! |
|
539 |
||
540 |
version_SVN |
|
16068 | 541 |
^ '$Id$' |
15434 | 542 |
! ! |
543 |
||
544 |
||
545 |
NavigatorModel initialize! |