author | Claus Gittinger <cg@exept.de> |
Thu, 26 Feb 2015 03:51:21 +0100 | |
changeset 15435 | 0f10cd04a1fa |
parent 15434 | 680fce340e4f |
child 15566 | 184cea584be5 |
child 15603 | 5bf4ed5e910d |
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 |
||
82 |
isPseudoProtocol:protocol |
|
83 |
^ protocol = self nameListEntryForObsolete |
|
84 |
or:[ protocol = self nameListEntryForSuperSend |
|
85 |
or:[ protocol = self nameListEntryForUncommented ]] |
|
86 |
! |
|
87 |
||
88 |
markForBeingInChangeList |
|
89 |
^ ' *' |
|
90 |
||
91 |
"Created: / 29-08-2006 / 10:26:05 / cg" |
|
92 |
! |
|
93 |
||
94 |
markForBeingManagedBySVN: package |
|
95 |
||
96 |
| repo branch mark | |
|
97 |
||
98 |
(ConfigurableFeatures includesFeature: #SubversionSupportEnabled) ifFalse:[^'']. |
|
99 |
package = PackageId noProjectID ifTrue:[^'']. |
|
100 |
||
101 |
"/ use Smalltalk-at to trick the dependency/prerequisite generator |
|
102 |
repo := (Smalltalk at:#SVN::RepositoryManager) current |
|
103 |
repositoryForPackage: package onlyFromCache: true. |
|
104 |
repo ifNil:[^'']. |
|
105 |
mark := ' [SVN]'. |
|
106 |
branch := repo workingCopy branchOrNil. |
|
107 |
branch ifNotNil:[mark := ' [SVN: ', branch path,']']. |
|
108 |
^mark asText colorizeAllWith: Color gray |
|
109 |
||
110 |
"Created: / 06-04-2010 / 11:23:27 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
111 |
"Modified (comment): / 07-09-2011 / 10:43:00 / cg" |
|
112 |
"Modified: / 19-01-2012 / 10:44:25 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
113 |
! |
|
114 |
||
115 |
markForBeingManagedBySVN: package branch: branch |
|
116 |
||
117 |
| mark | |
|
118 |
mark := branch |
|
119 |
ifNil: |
|
120 |
[' [SVN]'] |
|
121 |
ifNotNil: |
|
122 |
[' [SVN: ',branch,']']. |
|
123 |
||
124 |
^mark asText colorizeAllWith: Color gray. |
|
125 |
||
126 |
"Created: / 14-12-2010 / 15:56:23 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
127 |
! |
|
128 |
||
129 |
nameListEntryForALL |
|
130 |
^ AllEntry ? '* all *' |
|
131 |
||
132 |
"Created: / 24.2.2000 / 13:39:10 / cg" |
|
133 |
"Modified: / 25.2.2000 / 21:18:30 / cg" |
|
134 |
! |
|
135 |
||
136 |
nameListEntryForALLWithCount |
|
137 |
^ '* all (%1) *' |
|
138 |
! |
|
139 |
||
15435
0f10cd04a1fa
class: Tools::NavigatorModel
Claus Gittinger <cg@exept.de>
parents:
15434
diff
changeset
|
140 |
nameListEntryForAllTests |
0f10cd04a1fa
class: Tools::NavigatorModel
Claus Gittinger <cg@exept.de>
parents:
15434
diff
changeset
|
141 |
^ '* all tests (%1) *' |
0f10cd04a1fa
class: Tools::NavigatorModel
Claus Gittinger <cg@exept.de>
parents:
15434
diff
changeset
|
142 |
! |
0f10cd04a1fa
class: Tools::NavigatorModel
Claus Gittinger <cg@exept.de>
parents:
15434
diff
changeset
|
143 |
|
15434 | 144 |
nameListEntryForAnnotated |
145 |
^ '* annotated (%1) *' |
|
146 |
||
147 |
"Created: / 07-09-2011 / 10:11:40 / cg" |
|
148 |
! |
|
149 |
||
150 |
nameListEntryForBookmarked |
|
151 |
^ '* bookmarked (%1) *' |
|
152 |
! |
|
153 |
||
154 |
nameListEntryForChanged |
|
155 |
^ '* changed *' |
|
156 |
! |
|
157 |
||
158 |
nameListEntryForChangedWithCount |
|
159 |
^ '* changed (%1) *' |
|
160 |
! |
|
161 |
||
162 |
nameListEntryForDocumentation |
|
163 |
^ '* documentation (%1) *' |
|
164 |
! |
|
165 |
||
166 |
nameListEntryForExtendedClasses |
|
167 |
^ '* extended *' |
|
168 |
! |
|
169 |
||
170 |
nameListEntryForExtendedClassesWithCount |
|
171 |
^ '* extended (%1) *' |
|
172 |
! |
|
173 |
||
174 |
nameListEntryForExtensions |
|
175 |
^ '* extensions (%1) *' |
|
176 |
! |
|
177 |
||
178 |
nameListEntryForFailedTests |
|
179 |
^ '* failed tests (%1) *' |
|
180 |
||
181 |
"Created: / 08-03-2010 / 18:26:37 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
182 |
! |
|
183 |
||
184 |
nameListEntryForFullyCovered |
|
185 |
^ '* covered (%1) *' |
|
186 |
||
187 |
"Created: / 20-07-2011 / 18:20:53 / cg" |
|
188 |
! |
|
189 |
||
190 |
nameListEntryForInheritedTests |
|
191 |
^ '* inherited tests (%1) *' |
|
192 |
! |
|
193 |
||
194 |
nameListEntryForLong |
|
195 |
^ '* long (%1) *' |
|
196 |
! |
|
197 |
||
198 |
nameListEntryForMustBeRedefinedInSubclass |
|
199 |
^ '* must be redefined (%1) *' |
|
200 |
! |
|
201 |
||
202 |
nameListEntryForNILCategory |
|
203 |
^ '* no category *' |
|
204 |
! |
|
205 |
||
206 |
nameListEntryForNonStatic |
|
207 |
^ '* instance *' |
|
208 |
! |
|
209 |
||
210 |
nameListEntryForNotInstrumented |
|
211 |
^ '* coverage unknown or not instrumented (%1) *' |
|
212 |
||
213 |
"Created: / 20-07-2011 / 18:41:53 / cg" |
|
214 |
! |
|
215 |
||
216 |
nameListEntryForObsolete |
|
217 |
^ '* obsolete (%1) *' |
|
218 |
! |
|
219 |
||
220 |
nameListEntryForOverride |
|
221 |
^ '* override (%1) *' |
|
222 |
! |
|
223 |
||
224 |
nameListEntryForPartiallyCovered |
|
225 |
^ '* partially covered (%1) *' |
|
226 |
||
227 |
"Created: / 20-07-2011 / 18:21:05 / cg" |
|
228 |
! |
|
229 |
||
230 |
nameListEntryForPassedTests |
|
231 |
^ '* passed tests (%1) *' |
|
232 |
||
233 |
"Created: / 08-03-2010 / 18:26:53 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
234 |
! |
|
235 |
||
236 |
nameListEntryForRedefine |
|
237 |
^ '* redefine (%1) *' |
|
238 |
! |
|
239 |
||
240 |
nameListEntryForRedefined |
|
241 |
^ '* redefined (%1) *' |
|
242 |
! |
|
243 |
||
244 |
nameListEntryForRequired |
|
245 |
^ '* required (%1) *' |
|
246 |
! |
|
247 |
||
248 |
nameListEntryForStatic |
|
249 |
^ '* static *' |
|
250 |
! |
|
251 |
||
252 |
nameListEntryForSuperSend |
|
253 |
^ '* super (%1) *' |
|
254 |
! |
|
255 |
||
256 |
nameListEntryForUncommented |
|
257 |
^ '* uncommented (%1) *' |
|
258 |
! |
|
259 |
||
260 |
nameListEntryForUncovered |
|
261 |
^ '* not covered (%1) *' |
|
262 |
||
263 |
"Created: / 20-07-2011 / 18:20:44 / cg" |
|
264 |
! |
|
265 |
||
266 |
nameListEntryForUndocumented |
|
267 |
^ '* undocumented *' |
|
268 |
! |
|
269 |
||
270 |
nameListEntryForUndocumentedWithCount |
|
271 |
^ '* undocumented (%1) *' |
|
272 |
! |
|
273 |
||
274 |
nameListEntryForUnloaded |
|
275 |
^ '* unloaded *' |
|
276 |
! |
|
277 |
||
278 |
nameListEntryForUnloadedWithCount |
|
279 |
^ '* unloaded (%1) *' |
|
280 |
! |
|
281 |
||
282 |
nameListEntryForVisited |
|
283 |
^ '* visited (%1) *' |
|
284 |
! |
|
285 |
||
286 |
pseudoEntryForegroundColor |
|
287 |
^ UserPreferences current colorForPseudoProtocolsInMethodListInBrowser. |
|
288 |
||
289 |
"Modified: / 07-09-2011 / 09:59:55 / cg" |
|
290 |
! ! |
|
291 |
||
292 |
!NavigatorModel class methodsFor:'interface specs'! |
|
293 |
||
294 |
metaSpec |
|
295 |
"This resource specification was automatically generated |
|
296 |
by the UIPainter of ST/X." |
|
297 |
||
298 |
"Do not manually edit this!! If it is corrupted, |
|
299 |
the UIPainter may not be able to read the specification." |
|
300 |
||
301 |
" |
|
302 |
UIPainter new openOnClass:Tools::NavigatorModel andSelector:#metaSpec |
|
303 |
Tools::NavigatorModel new openInterface:#metaSpec |
|
304 |
" |
|
305 |
||
306 |
<resource: #canvas> |
|
307 |
||
308 |
^ |
|
309 |
#(FullSpec |
|
310 |
name: metaSpec |
|
311 |
window: |
|
312 |
(WindowSpec |
|
313 |
label: 'MetaToggles' |
|
314 |
name: 'MetaToggles' |
|
315 |
min: (Point 0 0) |
|
316 |
max: (Point 1024 721) |
|
317 |
bounds: (Rectangle 0 0 300 28) |
|
318 |
) |
|
319 |
component: |
|
320 |
(SpecCollection |
|
321 |
collection: ( |
|
322 |
(RadioButtonSpec |
|
323 |
label: 'Instance' |
|
324 |
name: 'InstanceToggle' |
|
325 |
layout: (LayoutFrame 0 0.0 0 0.0 0 0.5 25 0) |
|
326 |
translateLabel: true |
|
327 |
tabable: true |
|
328 |
model: notMetaToggle |
|
329 |
isTriggerOnDown: true |
|
330 |
select: true |
|
331 |
isToggle: true |
|
332 |
) |
|
333 |
(RadioButtonSpec |
|
334 |
label: 'Class' |
|
335 |
name: 'ClassToggle' |
|
336 |
layout: (LayoutFrame 0 0.5 0 0 0 1.0 25 0) |
|
337 |
translateLabel: true |
|
338 |
labelChannel: metaToggleLabelHolder |
|
339 |
tabable: false |
|
340 |
model: metaToggle |
|
341 |
isTriggerOnDown: true |
|
342 |
select: true |
|
343 |
isToggle: true |
|
344 |
) |
|
345 |
) |
|
346 |
||
347 |
) |
|
348 |
) |
|
349 |
! ! |
|
350 |
||
351 |
!NavigatorModel class methodsFor:'misc'! |
|
352 |
||
353 |
classResources |
|
354 |
^ NewSystemBrowser classResources |
|
355 |
! ! |
|
356 |
||
357 |
!NavigatorModel class methodsFor:'plugIn spec'! |
|
358 |
||
359 |
aspectSelectors |
|
360 |
||
361 |
^#( |
|
362 |
environmentHolder |
|
363 |
) |
|
364 |
||
365 |
"Created: / 24-02-2014 / 10:35:14 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
366 |
! ! |
|
367 |
||
368 |
!NavigatorModel class methodsFor:'queries'! |
|
369 |
||
370 |
hasSubversionSupport |
|
371 |
^ ConfigurableFeatures includesFeature: #SubversionSupportEnabled |
|
372 |
||
373 |
"Created: / 06-04-2010 / 11:09:07 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
374 |
"Modified: / 07-09-2011 / 10:45:45 / cg" |
|
375 |
"Modified: / 19-01-2012 / 10:43:59 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
376 |
! |
|
377 |
||
378 |
isAbstract |
|
379 |
^ self == Tools::NavigatorModel |
|
380 |
||
381 |
"Created: / 03-09-2013 / 15:36:44 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
382 |
! ! |
|
383 |
||
384 |
!NavigatorModel methodsFor:'accessing'! |
|
385 |
||
386 |
environment |
|
387 |
^ environment |
|
388 |
||
389 |
"Created: / 03-09-2013 / 19:19:47 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
390 |
! |
|
391 |
||
392 |
environment:env |
|
393 |
self environmentHolder value: env. |
|
394 |
||
395 |
"Modified: / 24-02-2014 / 10:21:39 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
396 |
! ! |
|
397 |
||
398 |
!NavigatorModel methodsFor:'aspects'! |
|
399 |
||
400 |
environmentHolder |
|
401 |
"return/create the 'environmentHolder' value holder (automatically generated)" |
|
402 |
||
403 |
environmentHolder isNil ifTrue:[ |
|
404 |
environmentHolder := ValueHolder with: environment. |
|
405 |
"/ environmentHolder := ValueHolder with: nil. |
|
406 |
||
407 |
environmentHolder addDependent:self. |
|
408 |
]. |
|
409 |
^ environmentHolder |
|
410 |
||
411 |
"Modified: / 28-02-2014 / 19:27:47 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
412 |
! |
|
413 |
||
414 |
environmentHolder:aValueModel |
|
415 |
"set the 'environmentHolder' value holder (automatically generated)" |
|
416 |
||
417 |
| oldValue newValue | |
|
418 |
||
419 |
environmentHolder notNil ifTrue:[ |
|
420 |
oldValue := environmentHolder value. |
|
421 |
environmentHolder removeDependent:self. |
|
422 |
] ifFalse:[ |
|
423 |
oldValue := environment. |
|
424 |
]. |
|
425 |
||
426 |
environmentHolder := aValueModel. |
|
427 |
environmentHolder notNil ifTrue:[ |
|
428 |
environmentHolder addDependent:self. |
|
429 |
]. |
|
430 |
newValue := environmentHolder value. |
|
431 |
oldValue ~~ newValue ifTrue:[ |
|
432 |
self |
|
433 |
update:#value |
|
434 |
with:newValue |
|
435 |
from:environmentHolder. |
|
436 |
]. |
|
437 |
||
438 |
"Modified: / 28-02-2014 / 19:30:20 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
439 |
! ! |
|
440 |
||
441 |
!NavigatorModel methodsFor:'change & update'! |
|
442 |
||
443 |
environmentChanged |
|
444 |
"My environment has changed. Update cached environment value. |
|
445 |
Subclasses may need to override and invalidate it's contents." |
|
446 |
||
447 |
| env | |
|
448 |
||
449 |
env := environmentHolder value. |
|
450 |
environment := env. |
|
451 |
||
452 |
"Created: / 24-02-2014 / 10:18:01 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
453 |
"Modified: / 24-02-2014 / 23:34:00 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
454 |
! |
|
455 |
||
456 |
update:something with:aParameter from:changedObject |
|
457 |
"Invoked when an object that I depend upon sends a change notification." |
|
458 |
||
459 |
changedObject == environmentHolder ifTrue:[ |
|
460 |
self environmentChanged. |
|
461 |
^ self. |
|
462 |
]. |
|
463 |
super update:something with:aParameter from:changedObject |
|
464 |
||
465 |
"Modified: / 24-02-2014 / 10:18:01 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
466 |
! ! |
|
467 |
||
468 |
!NavigatorModel methodsFor:'initialization'! |
|
469 |
||
470 |
initialize |
|
471 |
||
472 |
environment := environment ? Smalltalk. |
|
473 |
super initialize. |
|
474 |
||
475 |
"Created: / 03-09-2013 / 15:35:56 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
476 |
"Modified: / 24-02-2014 / 23:27:00 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
477 |
! ! |
|
478 |
||
479 |
!NavigatorModel methodsFor:'misc'! |
|
480 |
||
481 |
resources |
|
482 |
"answer the resources of my masterApp, if there is one" |
|
483 |
||
484 |
|m| |
|
485 |
||
486 |
(m := self masterApplication) notNil ifTrue:[ |
|
487 |
^ m resources |
|
488 |
]. |
|
489 |
^ super resources |
|
490 |
! ! |
|
491 |
||
492 |
!NavigatorModel methodsFor:'queries'! |
|
493 |
||
494 |
hasSubversionSupport |
|
495 |
^ ConfigurableFeatures includesFeature: #SubversionSupportEnabled |
|
496 |
||
497 |
"Modified: / 07-09-2011 / 10:45:49 / cg" |
|
498 |
"Modified: / 19-01-2012 / 10:43:52 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
499 |
! ! |
|
500 |
||
501 |
!NavigatorModel class methodsFor:'documentation'! |
|
502 |
||
503 |
version |
|
15435
0f10cd04a1fa
class: Tools::NavigatorModel
Claus Gittinger <cg@exept.de>
parents:
15434
diff
changeset
|
504 |
^ '$Header: /cvs/stx/stx/libtool/Tools__NavigatorModel.st,v 1.32 2015-02-26 02:51:21 cg Exp $' |
15434 | 505 |
! |
506 |
||
507 |
version_CVS |
|
15435
0f10cd04a1fa
class: Tools::NavigatorModel
Claus Gittinger <cg@exept.de>
parents:
15434
diff
changeset
|
508 |
^ '$Header: /cvs/stx/stx/libtool/Tools__NavigatorModel.st,v 1.32 2015-02-26 02:51:21 cg Exp $' |
15434 | 509 |
! |
510 |
||
511 |
version_HG |
|
512 |
||
513 |
^ '$Changeset: <not expanded> $' |
|
514 |
! |
|
515 |
||
516 |
version_SVN |
|
15435
0f10cd04a1fa
class: Tools::NavigatorModel
Claus Gittinger <cg@exept.de>
parents:
15434
diff
changeset
|
517 |
^ '$Id: Tools__NavigatorModel.st,v 1.32 2015-02-26 02:51:21 cg Exp $' |
15434 | 518 |
! ! |
519 |
||
520 |
||
521 |
NavigatorModel initialize! |