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