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