-
-
Notifications
You must be signed in to change notification settings - Fork 353
/
PharoCommonTools.class.st
391 lines (312 loc) · 8.87 KB
/
PharoCommonTools.class.st
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
"
A PharoCommonTools is a ToolRegistry that knows about common tools that may be replaced by other packages. It manages a list of the recently registered tools and provides settings for reregistering to a former registered tool.
"
Class {
#name : #PharoCommonTools,
#superclass : #ToolRegistry,
#instVars : [
'recentTools'
],
#category : #'Tool-Registry'
}
{ #category : #settings }
PharoCommonTools class >> browsingSettingsOn: aBuilder [
<systemsettings>
"create empty #codeBrowsing and #qualityAssistant settings groups so the tools can use it"
(aBuilder group: #codeBrowsing)
label: 'Code Browsing';
description: 'All settings concerned with code browsing look''n feel'.
(aBuilder group: #qualityAssistant)
label: 'QualityAssistant';
parent: #codeBrowsing.
]
{ #category : #initialization }
PharoCommonTools class >> initialize [
SessionManager default
registerToolClassNamed: self name
]
{ #category : #settings }
PharoCommonTools class >> settingsOn: aBuilder [
<systemsettings>
Smalltalk tools class == self
ifFalse: [ ^ self ].
(aBuilder group: #pharoTools)
parent: #pharoSystem;
label: 'Recent Tools';
description: 'Recently registered Tools';
with: [
(aBuilder pickOne: #browserTool)
target: Smalltalk;
targetSelector: #tools;
getSelector: #browserTool;
setSelector: #browserTool:;
label: 'Systembrowser';
default: (Smalltalk at: #ClyFullBrowser);
domainValues: Smalltalk tools recentBrowserTools ];
with: [
(aBuilder pickOne: #inspectorTool)
target: Smalltalk;
targetSelector: #tools;
getSelector: #inspectorTool;
setSelector: #inspectorTool:;
default: (Smalltalk at: #GTInspector);
label: 'Inspector';
domainValues: Smalltalk tools recentInspectorTools ];
with: [
(aBuilder pickOne: #workspaceTool)
target: Smalltalk;
targetSelector: #tools;
getSelector: #workspaceTool;
setSelector: #workspaceTool:;
label: 'Workspace';
default: (Smalltalk at: #GTPlayground);
domainValues: Smalltalk tools recentWorkspaceTools ];
with: [
(aBuilder pickOne: #debuggerTool)
target: Smalltalk;
targetSelector: #tools;
label: 'Debugger';
domainValues: Smalltalk tools recentDebuggerTools ];
with: [
(aBuilder pickOne: #messageListTool)
target: Smalltalk;
targetSelector: #tools;
label: 'Messagelist';
default: (Smalltalk at: #ClyOldMessageBrowserAdapter);
domainValues: Smalltalk tools recentMessageListTools ];
with: [
(aBuilder pickOne: #versionBrowserTool)
target: Smalltalk;
targetSelector: #tools;
label: 'Versionbrowser';
domainValues: Smalltalk tools recentVersionBrowserTools ];
with: [
(aBuilder pickOne: #fileListTool)
target: Smalltalk;
targetSelector: #tools;
label: 'Filelist';
default: (Smalltalk at: #FileList);
domainValues: Smalltalk tools recentFileListTools];
with: [
(aBuilder pickOne: #changeSorterTool)
target: Smalltalk;
targetSelector: #tools;
label: 'Changesorter';
domainValues: Smalltalk tools recentChangeSorterTools]
]
{ #category : #'system startup' }
PharoCommonTools class >> shutDown: aboutToQuit [
Smalltalk image tools cleanUp
]
{ #category : #'world menu' }
PharoCommonTools class >> worldMenuOn: aBuilder [
<worldMenu>
(aBuilder item: #'System Browser')
parent: #Tools;
action: [ Smalltalk tools openClassBrowser ];
order: 0;
keyText: 'o, b';
help: 'System browser to browse and edit code.';
iconName: #smallSystemBrowser
]
{ #category : #'registry access' }
PharoCommonTools >> basicInspector [
^ self toolNamed: #basicInspector
]
{ #category : #'registry access' }
PharoCommonTools >> browser [
^ self toolNamed: #browser
]
{ #category : #tools }
PharoCommonTools >> browserTool [
^ self browser
]
{ #category : #tools }
PharoCommonTools >> browserTool: aTool [
^ self register: aTool as: #browser
]
{ #category : #'registry access' }
PharoCommonTools >> changeList [
^ self toolNamed: #changeList
]
{ #category : #'registry access' }
PharoCommonTools >> changeSorter [
^ self toolNamed: #changeSorter
]
{ #category : #tools }
PharoCommonTools >> changeSorterTool [
^ self changeSorter
]
{ #category : #tools }
PharoCommonTools >> changeSorterTool: aTool [
^ self register: aTool as: #changeSorter
]
{ #category : #cleanup }
PharoCommonTools >> cleanUp [
recentTools keysAndValuesDo:[:name :toolSet|
toolSet copy do:[:tool | tool isObsolete ifTrue:[ toolSet remove: tool]]]
]
{ #category : #'registry access' }
PharoCommonTools >> debugger [
^ self toolNamed: #debugger
]
{ #category : #tools }
PharoCommonTools >> debuggerTool [
^ self debugger
]
{ #category : #tools }
PharoCommonTools >> debuggerTool: aTool [
^ self register: aTool as: #debugger
]
{ #category : #'registry access' }
PharoCommonTools >> debuggers [
^ self toolNamed: #debuggers
]
{ #category : #'registry access' }
PharoCommonTools >> fileList [
^ self toolNamed: #fileList
]
{ #category : #tools }
PharoCommonTools >> fileListTool [
^ self fileList
]
{ #category : #tools }
PharoCommonTools >> fileListTool: aTool [
^ self register: aTool as: #fileList
]
{ #category : #'registry access' }
PharoCommonTools >> finder [
^ self toolNamed: #finder
]
{ #category : #initialization }
PharoCommonTools >> initialize [
recentTools := Dictionary new.
super initialize.
]
{ #category : #'registry access' }
PharoCommonTools >> inspector [
^ self toolNamed: #inspector
]
{ #category : #tools }
PharoCommonTools >> inspectorTool [
^ self inspector
]
{ #category : #tools }
PharoCommonTools >> inspectorTool: aTool [
^ self register: aTool as: #inspector
]
{ #category : #'registry access' }
PharoCommonTools >> messageList [
^ self toolNamed: #messageList
]
{ #category : #tools }
PharoCommonTools >> messageListTool [
^ self messageList
]
{ #category : #tools }
PharoCommonTools >> messageListTool: aTool [
^ self register: aTool as: #messageList
]
{ #category : #'registry access' }
PharoCommonTools >> monticelloBrowser [
^ self toolNamed: #monticelloBrowser
]
{ #category : #'registry access' }
PharoCommonTools >> pointerExplorer [
^ self toolNamed: #pointerExplorer
]
{ #category : #'registry access' }
PharoCommonTools >> processBrowser [
^ self toolNamed: #processBrowser
]
{ #category : #registration }
PharoCommonTools >> recentBrowserTools [
^ self recentToolsFor: #browser
]
{ #category : #registration }
PharoCommonTools >> recentChangeSorterTools [
^ self recentToolsFor: #changeSorter
]
{ #category : #registration }
PharoCommonTools >> recentDebuggerTools [
^ self recentToolsFor: #debugger
]
{ #category : #registration }
PharoCommonTools >> recentFileListTools [
^ self recentToolsFor: #fileList
]
{ #category : #registration }
PharoCommonTools >> recentInspectorTools [
^ self recentToolsFor: #inspector
]
{ #category : #registration }
PharoCommonTools >> recentMessageListTools [
^ self recentToolsFor: #messageList
]
{ #category : #registration }
PharoCommonTools >> recentToolsFor: aName [
^ (recentTools at: aName ifAbsent: [ {} ]) reject: [ :tool | tool isObsolete ]
]
{ #category : #registration }
PharoCommonTools >> recentVersionBrowserTools [
^ self recentToolsFor: #versionBrowser
]
{ #category : #registration }
PharoCommonTools >> recentWorkspaceTools [
^ self recentToolsFor: #workspace
]
{ #category : #registration }
PharoCommonTools >> register: anTool as: aNameSelector [
| usedToolSet |
anTool ifNil:[ ^ self].
super register: anTool as: aNameSelector.
usedToolSet := recentTools at: aNameSelector ifAbsentPut: [ Set new ].
usedToolSet add: anTool
]
{ #category : #'registry access' }
PharoCommonTools >> syntaxErrorDebugger [
^ self toolNamed: #syntaxErrorDebugger
]
{ #category : #'registry access' }
PharoCommonTools >> testRunner [
^ self toolNamed: #testRunner
]
{ #category : #'registry access' }
PharoCommonTools >> timeProfiler [
^ self toolNamed: #timeProfiler
]
{ #category : #private }
PharoCommonTools >> toolNamed: aSymbol [
tools at: aSymbol ifPresent: [ :tool | ^ tool ].
aSymbol = #debugger ifTrue: [
Smalltalk
logError: 'No debugger installed to handle debug request.'
inContext: thisContext.
^ nil. "Smalltalk snapshot: false andQuit: true."
].
self error: 'No tool named: "' , aSymbol , '" present in the registry'.
]
{ #category : #'registry access' }
PharoCommonTools >> versionBrowser [
^ self toolNamed: #versionBrowser
]
{ #category : #tools }
PharoCommonTools >> versionBrowserTool [
^ self versionBrowser
]
{ #category : #tools }
PharoCommonTools >> versionBrowserTool: aTool [
^ self register: aTool as: #versionBrowser
]
{ #category : #'registry access' }
PharoCommonTools >> workspace [
^ self toolNamed: #workspace
]
{ #category : #tools }
PharoCommonTools >> workspaceTool [
^ self workspace
]
{ #category : #tools }
PharoCommonTools >> workspaceTool: aTool [
^ self register: aTool as: #workspace
]