author | Stefan Vogel <sv@exept.de> |
Fri, 17 May 2019 17:09:44 +0200 | |
changeset 18766 | e0a9a93a8edc |
parent 14023 | b3e220d2a1a0 |
child 15566 | 184cea584be5 |
permissions | -rw-r--r-- |
13503 | 1 |
" |
2 |
COPYRIGHT (c) 2006 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 |
Object subclass:#Toolbox |
|
17 |
instanceVariableNames:'browser environment' |
|
18 |
classVariableNames:'' |
|
19 |
poolDictionaries:'' |
|
20 |
category:'Interface-Tools' |
|
21 |
! |
|
22 |
||
23 |
!Toolbox class methodsFor:'documentation'! |
|
24 |
||
25 |
copyright |
|
26 |
" |
|
27 |
COPYRIGHT (c) 2006 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 |
" |
|
13995
ca1ec96850b5
Introduced GeneritToolbox / SmalltalkToolbox.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13503
diff
changeset
|
37 |
! |
ca1ec96850b5
Introduced GeneritToolbox / SmalltalkToolbox.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13503
diff
changeset
|
38 |
|
ca1ec96850b5
Introduced GeneritToolbox / SmalltalkToolbox.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13503
diff
changeset
|
39 |
documentation |
ca1ec96850b5
Introduced GeneritToolbox / SmalltalkToolbox.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13503
diff
changeset
|
40 |
" |
ca1ec96850b5
Introduced GeneritToolbox / SmalltalkToolbox.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13503
diff
changeset
|
41 |
Concrete subclasses provide lenguage-specfici services for other tools |
ca1ec96850b5
Introduced GeneritToolbox / SmalltalkToolbox.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13503
diff
changeset
|
42 |
like list of classes/globals used in a method, list of messages sent by |
ca1ec96850b5
Introduced GeneritToolbox / SmalltalkToolbox.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13503
diff
changeset
|
43 |
this method, senders/implementors of a selector and so on. |
ca1ec96850b5
Introduced GeneritToolbox / SmalltalkToolbox.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13503
diff
changeset
|
44 |
|
ca1ec96850b5
Introduced GeneritToolbox / SmalltalkToolbox.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13503
diff
changeset
|
45 |
NOTE: Lot of code used to be directly in tools, namely NewSystemBrowser. |
ca1ec96850b5
Introduced GeneritToolbox / SmalltalkToolbox.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13503
diff
changeset
|
46 |
The code should be moved to toolbox classes to allow reuse and to allow |
ca1ec96850b5
Introduced GeneritToolbox / SmalltalkToolbox.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13503
diff
changeset
|
47 |
for multiple languages (Smalltalk / Java / JavaScript / Ruby). |
ca1ec96850b5
Introduced GeneritToolbox / SmalltalkToolbox.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13503
diff
changeset
|
48 |
|
ca1ec96850b5
Introduced GeneritToolbox / SmalltalkToolbox.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13503
diff
changeset
|
49 |
[author:] |
ca1ec96850b5
Introduced GeneritToolbox / SmalltalkToolbox.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13503
diff
changeset
|
50 |
Jan Vrany <jan.vrany@fit.cvut.cz> |
ca1ec96850b5
Introduced GeneritToolbox / SmalltalkToolbox.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13503
diff
changeset
|
51 |
|
ca1ec96850b5
Introduced GeneritToolbox / SmalltalkToolbox.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13503
diff
changeset
|
52 |
[instance variables:] |
ca1ec96850b5
Introduced GeneritToolbox / SmalltalkToolbox.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13503
diff
changeset
|
53 |
|
ca1ec96850b5
Introduced GeneritToolbox / SmalltalkToolbox.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13503
diff
changeset
|
54 |
[class variables:] |
ca1ec96850b5
Introduced GeneritToolbox / SmalltalkToolbox.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13503
diff
changeset
|
55 |
|
ca1ec96850b5
Introduced GeneritToolbox / SmalltalkToolbox.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13503
diff
changeset
|
56 |
[see also:] |
ca1ec96850b5
Introduced GeneritToolbox / SmalltalkToolbox.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13503
diff
changeset
|
57 |
|
ca1ec96850b5
Introduced GeneritToolbox / SmalltalkToolbox.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13503
diff
changeset
|
58 |
" |
13503 | 59 |
! ! |
60 |
||
61 |
!Toolbox class methodsFor:'instance creation'! |
|
62 |
||
63 |
new |
|
64 |
"return an initialized instance" |
|
65 |
||
66 |
^ self basicNew initialize. |
|
67 |
! ! |
|
68 |
||
69 |
!Toolbox methodsFor:'accessing'! |
|
70 |
||
71 |
browser |
|
72 |
^ browser |
|
73 |
! |
|
74 |
||
75 |
browser:aNewSystemBrowser |
|
76 |
browser := aNewSystemBrowser. |
|
77 |
! |
|
78 |
||
79 |
environment |
|
80 |
^ environment |
|
81 |
! |
|
82 |
||
83 |
environment:env |
|
84 |
environment := env. |
|
85 |
! ! |
|
86 |
||
14023
b3e220d2a1a0
Refactoring of NavigatorModel's environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13995
diff
changeset
|
87 |
!Toolbox methodsFor:'accessing-methods'! |
b3e220d2a1a0
Refactoring of NavigatorModel's environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13995
diff
changeset
|
88 |
|
b3e220d2a1a0
Refactoring of NavigatorModel's environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13995
diff
changeset
|
89 |
globalsReferencedByMethods: methods |
b3e220d2a1a0
Refactoring of NavigatorModel's environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13995
diff
changeset
|
90 |
"Returns a list of globals (classes) referenced by given methods" |
b3e220d2a1a0
Refactoring of NavigatorModel's environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13995
diff
changeset
|
91 |
|
b3e220d2a1a0
Refactoring of NavigatorModel's environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13995
diff
changeset
|
92 |
^ self subclassResponsibility |
b3e220d2a1a0
Refactoring of NavigatorModel's environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13995
diff
changeset
|
93 |
|
b3e220d2a1a0
Refactoring of NavigatorModel's environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13995
diff
changeset
|
94 |
"Created: / 24-02-2014 / 16:19:57 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
b3e220d2a1a0
Refactoring of NavigatorModel's environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13995
diff
changeset
|
95 |
! ! |
b3e220d2a1a0
Refactoring of NavigatorModel's environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13995
diff
changeset
|
96 |
|
13503 | 97 |
!Toolbox methodsFor:'initialization'! |
98 |
||
99 |
initialize |
|
100 |
"Invoked when a new instance is created." |
|
101 |
||
102 |
"/ please change as required (and remove this comment) |
|
103 |
"/ browser := nil. |
|
104 |
environment := Smalltalk |
|
105 |
||
106 |
"/ super initialize. -- commented since inherited method does nothing |
|
107 |
||
108 |
"Modified: / 05-09-2013 / 12:46:08 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
109 |
! ! |
|
110 |
||
14023
b3e220d2a1a0
Refactoring of NavigatorModel's environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13995
diff
changeset
|
111 |
!Toolbox methodsFor:'menu-methods'! |
13503 | 112 |
|
13995
ca1ec96850b5
Introduced GeneritToolbox / SmalltalkToolbox.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13503
diff
changeset
|
113 |
messagesMenuFor:actionSelector |
ca1ec96850b5
Introduced GeneritToolbox / SmalltalkToolbox.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13503
diff
changeset
|
114 |
withMethods: methods |
ca1ec96850b5
Introduced GeneritToolbox / SmalltalkToolbox.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13503
diff
changeset
|
115 |
withMethodSelectors:withMethodSelectors |
ca1ec96850b5
Introduced GeneritToolbox / SmalltalkToolbox.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13503
diff
changeset
|
116 |
withSentSelectors: withSentSelectors |
ca1ec96850b5
Introduced GeneritToolbox / SmalltalkToolbox.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13503
diff
changeset
|
117 |
withSelfSelectorsOnly: withSelfSelectorsOnly |
13503 | 118 |
|
14023
b3e220d2a1a0
Refactoring of NavigatorModel's environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13995
diff
changeset
|
119 |
^ self subclassResponsibility. |
13503 | 120 |
|
14023
b3e220d2a1a0
Refactoring of NavigatorModel's environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13995
diff
changeset
|
121 |
"Modified: / 24-02-2014 / 16:17:52 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
13503 | 122 |
! ! |
123 |
||
124 |
!Toolbox methodsFor:'private'! |
|
125 |
||
126 |
ensureBrowser |
|
127 |
browser isNil ifTrue:[ |
|
128 |
browser := NewSystemBrowser new. |
|
129 |
browser open. |
|
130 |
]. |
|
131 |
^ browser |
|
132 |
||
133 |
"Created: / 31-08-2013 / 22:46:22 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
134 |
! ! |
|
135 |
||
136 |
!Toolbox class methodsFor:'documentation'! |
|
137 |
||
138 |
version |
|
14023
b3e220d2a1a0
Refactoring of NavigatorModel's environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13995
diff
changeset
|
139 |
^ '$Header: /cvs/stx/stx/libtool/Tools__Toolbox.st,v 1.3 2014-02-25 10:41:16 vrany Exp $' |
13503 | 140 |
! |
141 |
||
142 |
version_CVS |
|
14023
b3e220d2a1a0
Refactoring of NavigatorModel's environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13995
diff
changeset
|
143 |
^ '$Header: /cvs/stx/stx/libtool/Tools__Toolbox.st,v 1.3 2014-02-25 10:41:16 vrany Exp $' |
13503 | 144 |
! ! |
145 |