Squeak
  links to this page:    
View this PageEdit this PageUploads to this PageHistory of this PageTop of the SwikiRecent ChangesSearch the SwikiHelp Guide
ToolBuilder
Last updated at 7:10 am UTC on 30 August 2016
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.

Note that ToolBuilder is now part of the standard image and as such is kept actively up to date.

The ToolBuilder class comment gives an overview. Tools are described with ToolBuilderSpec objects.

See also
UIManager



Archive


The following notes apply to Toolbuilder before it was moved into the image and are out of date.

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





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

ToolBuilder-UI-Refactor-FillInTheBlank.cs

SMBase-rbb.mcz


UIManagerReplacePopUpMenu.cs (How do you get rid of uploaded files you don't need? ;-)