ToolBuilder
Last updated at 11:12 am UTC on 19 April 2007
The ToolBuilder is a simple framework to achieve cross-UI-framework (MVC, Morphic, Tweak) support for a limited number of widgets which are critical for various Squeak tools, including (but not limited to) Browser, Debugger, ChangeSorter, SqueakMap, Monticello and more. It also includes the UIManager library.
It is available from http://www.squeaksource.com/ToolBuilder, using the Monticello browser (included since 3.9)
This is a temporary place to upload some changes that cannot be attached to the Squeaksource.com wiki.
PopUpMenu Refactor
- Changeset to fix references to PopUpMenu for 3.9g-6590, leaves 43 explicit references to PopUpMenu.
There are a couple of comments by me asking how we should handle some situations, so take a look!
- Please note some patterns I used in doing this work. One of the protocols recognized by PopUpMenu would
take a large string and break it up based on spaces, or in some cases, carriage returns. In the cases where a string literal was in a method, I simple rewrote the expression to be an Array, such as the original (emphasis added):
chooseSubjectPrefixForEmail
| subjectIndex |
subjectIndex := (PopUpMenu labels: 'Bug fix [FIX]\Enhancement [ENH]\Goodie [GOODIE]\Test suite [TEST]\None of the above (will not be archived)' withCRs)
^ #('[CS] ' '[FIX] ' '[ENH] ' '[GOODIE] ' '[TEST] ' '[CS] ' ) at: subjectIndex + 1
... being changed to ChangeSet>>chooseSubjectPrefixForEmail
(emphasis added):
chooseSubjectPrefixForEmail
| subjectIndex |
subjectIndex := UIManager default
chooseFrom: #('Bug fix [FIX]' 'Enhancement [ENH]' 'Goodie [GOODIE]'
'Test suite [TEST]' 'None of the above (will not be archived)' )
title: 'What type of change set\are you submitting to the list?' withCRs.
^ #('[CS] ' '[FIX] ' '[ENH] ' '[GOODIE] ' '[TEST] ' '[CS] ' ) at: subjectIndex + 1
Also, in some cases where there were strings and variables being catenated, #()
won't work, so I used Array with:with: ...
instead.
In cases where a Stream was created, the easiest and least intrusive thing seemed to be sending #substrings to as in the following.
Here is the original ChangeList>>selectConflictsWith
(emphasis added):
selectConflictsWith
"Selects all method definitions for which there is ALSO an entry
in the specified changeSet or changList chosen by the user.
4/11/96 tk"
| aStream all index |
aStream _ WriteStream on: (String new: 200).
(all _ ChangeSorter allChangeSets copy) do:
[:sel | aStream nextPutAll: (sel name contractTo: 40); cr].
ChangeList allSubInstancesDo:
[:sel | aStream nextPutAll: (sel file name); cr.
all addLast: sel].
aStream skip: -1.
index _ (PopUpMenu labels: aStream contents) startUp.
index > 0 ifTrue: [
self selectConflicts: (all at: index)].
And here is my change (emphasis added):
selectConflictsWith
"Selects all method definitions for which there is ALSO an entry
in the specified changeSet or changList chosen by the user.
4/11/96 tk"
| aStream all index |
aStream := WriteStream
on: (String new: 200).
(all := ChangeSorter allChangeSets copy)
do: [:sel | aStream
nextPutAll: (sel name contractTo: 40);
cr].
ChangeList
allSubInstancesDo: [:sel |
aStream nextPutAll: sel file name;
cr.
all addLast: sel].
aStream skip: -1.
index := UIManager default chooseFrom: aStream contents substrings.
index := (PopUpMenu labels: aStream contents) startUp.
index > 0
ifTrue: [self
selectConflicts: (all at: index)]
ToolBuilder-UI-Refactor-PopUpMenu.cs
- Changeset to fix references to FillInTheBlank for 3.9g-6590, leaves 108 explicit references to the class,
all of which are in Morphic, EToys, or the ToolBuilder classes themselves.
ToolBuilder-UI-Refactor-FillInTheBlank.cs
- Monticello file for Squeak Map in 3.9g-6590, removes explicit references to FillInTheBlank.
SMBase-rbb.mcz
UIManagerReplacePopUpMenu.cs (How do you get rid of uploaded files you don't need? ;-)